aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorKevin P. Neal <kevin.neal@sas.com>2020-05-14 11:57:19 -0700
committerKevin P. Neal <kevin.neal@sas.com>2020-06-15 10:05:35 -0400
commit07f335128410ca2dbb4b78050132ecd070e2e425 (patch)
tree3bdff6f160ea8033d6f7b2b0846bb3cefce2fe44 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent8799ebbc1f03a348f732fc14242ad4c395076bcc (diff)
downloadllvm-07f335128410ca2dbb4b78050132ecd070e2e425.zip
llvm-07f335128410ca2dbb4b78050132ecd070e2e425.tar.gz
llvm-07f335128410ca2dbb4b78050132ecd070e2e425.tar.bz2
[strictfp] Replace dangling strictfp attrs with nobuiltin
In preparation for a patch that will enforce new rules for the usage of the strictfp attribute, this patch introduces auto-upgrade behavior that will replace the strictfp attribute on callsites with nobuiltin if the enclosing function declaration doesn't also have the strictfp attribute. This auto-upgrade isn't being performed on .ll files because that would prevent us from writing a test for the forthcoming verifier behavior. Differential Revision: https://reviews.llvm.org/D70096
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp6
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();