diff options
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Reader/BitcodeReader.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp index 2f9331e..a428416 100644 --- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp @@ -3002,6 +3002,7 @@ Error BitcodeReader::globalCleanup() { return error("Malformed global initializer set"); // Look for intrinsic functions which need to be upgraded at some point + // and functions that need to have their function attributes upgraded. for (Function &F : *TheModule) { MDLoader->upgradeDebugIntrinsics(F); Function *NewFn; @@ -3012,6 +3013,8 @@ Error BitcodeReader::globalCleanup() { // loaded in the same LLVMContext (LTO scenario). In this case we should // remangle intrinsics names as well. RemangledIntrinsics[&F] = Remangled.getValue(); + // Look for functions that rely on old function attribute behavior. + UpgradeFunctionAttributes(F); } // Look for global variables which need to be renamed. @@ -5376,6 +5379,9 @@ Error BitcodeReader::materialize(GlobalValue *GV) { } } + // Look for functions that rely on old function attribute behavior. + UpgradeFunctionAttributes(*F); + // Bring in any functions that this function forward-referenced via // blockaddresses. return materializeForwardReferencedFunctions(); |