summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2016-02-10 19:11:15 +0000
committerTeresa Johnson <tejohnson@google.com>2016-02-10 19:11:15 +0000
commit89f38fb5cc8006dfb9737417257307b4fda9c44c (patch)
tree9566557c429cad5fef83b095f7dc154b9b060187 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parentd16cebef5df2c38067bb0168819a4a4f6b443ee9 (diff)
downloadbcm5719-llvm-89f38fb5cc8006dfb9737417257307b4fda9c44c.tar.gz
bcm5719-llvm-89f38fb5cc8006dfb9737417257307b4fda9c44c.zip
Revert "[ThinLTO] Use MD5 hash in function index." due to bot failure
This reverts commit r260408. Bot failure that I need to investigate. llvm-svn: 260412
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp54
1 files changed, 9 insertions, 45 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 8183a378908..36eff135395 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -458,9 +458,6 @@ class FunctionIndexBitcodeReader {
/// summary records.
DenseMap<uint64_t, StringRef> ModuleIdMap;
- /// Original source file name recorded in a bitcode record.
- std::string SourceFileName;
-
public:
std::error_code error(BitcodeError E, const Twine &Message);
std::error_code error(BitcodeError E);
@@ -3700,13 +3697,6 @@ std::error_code BitcodeReader::parseModule(uint64_t ResumeBit,
assert(MetadataList.size() == 0);
MetadataList.resize(NumModuleMDs);
break;
- /// MODULE_CODE_SOURCE_FILENAME: [namechar x N]
- case bitc::MODULE_CODE_SOURCE_FILENAME:
- SmallString<128> ValueName;
- if (convertToString(Record, 0, ValueName))
- return error("Invalid record");
- TheModule->setSourceFileName(ValueName);
- break;
}
Record.clear();
}
@@ -5464,31 +5454,24 @@ std::error_code FunctionIndexBitcodeReader::parseValueSymbolTable() {
return error("Invalid record");
unsigned ValueID = Record[0];
uint64_t FuncOffset = Record[1];
- assert(!IsLazy && "Lazy summary read only supported for combined index");
- // Gracefully handle bitcode without a function summary section,
- // which will simply not populate the index.
- if (foundFuncSummary()) {
+ std::unique_ptr<FunctionInfo> FuncInfo =
+ llvm::make_unique<FunctionInfo>(FuncOffset);
+ if (foundFuncSummary() && !IsLazy) {
DenseMap<uint64_t, std::unique_ptr<FunctionSummary>>::iterator SMI =
SummaryMap.find(ValueID);
assert(SMI != SummaryMap.end() && "Summary info not found");
- std::unique_ptr<FunctionInfo> FuncInfo =
- llvm::make_unique<FunctionInfo>(FuncOffset);
FuncInfo->setFunctionSummary(std::move(SMI->second));
- assert(!SourceFileName.empty());
- TheIndex->addFunctionInfo(
- Function::getGlobalIdentifier(
- ValueName, FuncInfo->functionSummary()->getFunctionLinkage(),
- SourceFileName),
- std::move(FuncInfo));
}
+ TheIndex->addFunctionInfo(ValueName, std::move(FuncInfo));
ValueName.clear();
break;
}
case bitc::VST_CODE_COMBINED_FNENTRY: {
- // VST_CODE_COMBINED_FNENTRY: [offset, funcguid]
+ // VST_CODE_FNENTRY: [offset, namechar x N]
+ if (convertToString(Record, 1, ValueName))
+ return error("Invalid record");
uint64_t FuncSummaryOffset = Record[0];
- uint64_t FuncGUID = Record[1];
std::unique_ptr<FunctionInfo> FuncInfo =
llvm::make_unique<FunctionInfo>(FuncSummaryOffset);
if (foundFuncSummary() && !IsLazy) {
@@ -5497,7 +5480,7 @@ std::error_code FunctionIndexBitcodeReader::parseValueSymbolTable() {
assert(SMI != SummaryMap.end() && "Summary info not found");
FuncInfo->setFunctionSummary(std::move(SMI->second));
}
- TheIndex->addFunctionInfo(FuncGUID, std::move(FuncInfo));
+ TheIndex->addFunctionInfo(ValueName, std::move(FuncInfo));
ValueName.clear();
break;
@@ -5516,8 +5499,6 @@ std::error_code FunctionIndexBitcodeReader::parseModule() {
if (Stream.EnterSubBlock(bitc::MODULE_BLOCK_ID))
return error("Invalid record");
- SmallVector<uint64_t, 64> Record;
-
// Read the function index for this module.
while (1) {
BitstreamEntry Entry = Stream.advance();
@@ -5570,24 +5551,7 @@ std::error_code FunctionIndexBitcodeReader::parseModule() {
continue;
case BitstreamEntry::Record:
- // Once we find the single record of interest, skip the rest.
- if (!SourceFileName.empty())
- Stream.skipRecord(Entry.ID);
- else {
- Record.clear();
- auto BitCode = Stream.readRecord(Entry.ID, Record);
- switch (BitCode) {
- default:
- break; // Default behavior, ignore unknown content.
- /// MODULE_CODE_SOURCE_FILENAME: [namechar x N]
- case bitc::MODULE_CODE_SOURCE_FILENAME:
- SmallString<128> ValueName;
- if (convertToString(Record, 0, ValueName))
- return error("Invalid record");
- SourceFileName = ValueName.c_str();
- break;
- }
- }
+ Stream.skipRecord(Entry.ID);
continue;
}
}
OpenPOWER on IntegriCloud