projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix PR2929 by making bugpoint/code extract propagate the nothrow
[oota-llvm.git]
/
lib
/
Transforms
/
Utils
/
CodeExtractor.cpp
diff --git
a/lib/Transforms/Utils/CodeExtractor.cpp
b/lib/Transforms/Utils/CodeExtractor.cpp
index 2f4698dce1eef5b708e6f4be0ebd3b19e7849fca..6d5904e308867180ea6e6655578681fcd15fb109 100644
(file)
--- a/
lib/Transforms/Utils/CodeExtractor.cpp
+++ b/
lib/Transforms/Utils/CodeExtractor.cpp
@@
-283,6
+283,10
@@
Function *CodeExtractor::constructFunction(const Values &inputs,
GlobalValue::InternalLinkage,
oldFunction->getName() + "_" +
header->getName(), M);
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.
newFunction->getBasicBlockList().push_back(newRootNode);
// Create an iterator to name all of the arguments we inserted.