[ThinLTO] Allow indexing to request backend to ignore the module

Summary:
Gold plugin does not add pass to ThinLTO modules without useful symbols.
In this case ThinLTO can't create corresponding index file and some features, like CFI,
cannot be processes by backed correctly without index.
Given that we don't need the backed output we can request it to avoid
processing the module. This is implemented by this patch using new
"SkipModuleByDistributedBackend" flag.

Reviewers: pcc, tejohnson

Subscribers: mehdi_amini, inglorion, eraman, cfe-commits

Differential Revision: https://reviews.llvm.org/D42995

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325411 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Vitaly Buka
2018-02-16 23:38:22 +00:00
parent 1ef7c4d987
commit 2749eb2cdf
5 changed files with 62 additions and 8 deletions

View File

@@ -5186,11 +5186,14 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) {
case bitc::FS_FLAGS: { // [flags]
uint64_t Flags = Record[0];
// Scan flags (set only on the combined index).
assert(Flags <= 1 && "Unexpected bits in flag");
assert(Flags <= 0x3 && "Unexpected bits in flag");
// 1 bit: WithGlobalValueDeadStripping flag.
if (Flags & 0x1)
TheIndex.setWithGlobalValueDeadStripping();
// 1 bit: SkipModuleByDistributedBackend flag.
if (Flags & 0x2)
TheIndex.setSkipModuleByDistributedBackend();
break;
}
case bitc::FS_VALUE_GUID: { // [valueid, refguid]