summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/CodeExtractor.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-12-18 05:52:56 +0000
committerChris Lattner <sabre@nondot.org>2008-12-18 05:52:56 +0000
commit4caf5eb70cfd5a4d01a8cb97ccac28013aa9f3ef (patch)
tree6cf1fab6d83f3d09f4722829215dde6e6ace2f10 /llvm/lib/Transforms/Utils/CodeExtractor.cpp
parent6437a9eaf66bc513b368a1d86d337c548255525e (diff)
downloadbcm5719-llvm-4caf5eb70cfd5a4d01a8cb97ccac28013aa9f3ef.tar.gz
bcm5719-llvm-4caf5eb70cfd5a4d01a8cb97ccac28013aa9f3ef.zip
Fix PR2929 by making bugpoint/code extract propagate the nothrow
bit from the original function to the cloned one. llvm-svn: 61194
Diffstat (limited to 'llvm/lib/Transforms/Utils/CodeExtractor.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/CodeExtractor.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/CodeExtractor.cpp b/llvm/lib/Transforms/Utils/CodeExtractor.cpp
index 2f4698dce1e..6d5904e3088 100644
--- a/llvm/lib/Transforms/Utils/CodeExtractor.cpp
+++ b/llvm/lib/Transforms/Utils/CodeExtractor.cpp
@@ -283,6 +283,10 @@ Function *CodeExtractor::constructFunction(const Values &inputs,
GlobalValue::InternalLinkage,
oldFunction->getName() + "_" +
header->getName(), M);
+ // If the old function is no-throw, so is the new one.
+ if (oldFunction->doesNotThrow())
+ newFunction->setDoesNotThrow(true);
+
newFunction->getBasicBlockList().push_back(newRootNode);
// Create an iterator to name all of the arguments we inserted.
OpenPOWER on IntegriCloud