diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2017-04-06 19:39:24 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2017-04-06 19:39:24 +0000 |
commit | db4cafa6c40a4ea99643642dd5f2532bc0745eea (patch) | |
tree | e27b7fd0e231e6e67ffa90f29df878eeaf48b80c /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | 8024cac19a0f02644530372528d7df39386823e1 (diff) | |
download | bcm5719-llvm-db4cafa6c40a4ea99643642dd5f2532bc0745eea.tar.gz bcm5719-llvm-db4cafa6c40a4ea99643642dd5f2532bc0745eea.zip |
Bitcode: Do not create FNENTRYs for aliases of functions.
There doesn't seem to be any point in doing this.
Differential Revision: https://reviews.llvm.org/D31691
llvm-svn: 299694
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 23649e811ed..80a2c918916 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -1796,22 +1796,16 @@ Error BitcodeReader::parseValueSymbolTable(uint64_t Offset) { return Err; Value *V = ValOrErr.get(); - auto *GO = dyn_cast<GlobalObject>(V); - if (!GO) { - // If this is an alias, need to get the actual Function object - // it aliases, in order to set up the DeferredFunctionInfo entry below. - auto *GA = dyn_cast<GlobalAlias>(V); - if (GA) - GO = GA->getBaseObject(); - assert(GO); - } + auto *F = dyn_cast<Function>(V); + // Ignore function offsets emitted for aliases of functions in older + // versions of LLVM. + if (!F) + break; // Note that we subtract 1 here because the offset is relative to one word // before the start of the identification or module block, which was // historically always the start of the regular bitcode header. uint64_t FuncWordOffset = Record[1] - 1; - Function *F = dyn_cast<Function>(GO); - assert(F); uint64_t FuncBitOffset = FuncWordOffset * 32; DeferredFunctionInfo[F] = FuncBitOffset + FuncBitcodeOffsetDelta; // Set the LastFunctionBlockBit to point to the last function block. |