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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user