From 31535f1f04853974ec53dfc61d90e8dc4a09b456 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 18 Dec 2008 05:52:56 +0000 Subject: Fix PR2929 by making bugpoint/code extract propagate the nothrow bit from the original function to the cloned one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61194 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/CodeExtractor.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/Transforms/Utils/CodeExtractor.cpp') diff --git a/lib/Transforms/Utils/CodeExtractor.cpp b/lib/Transforms/Utils/CodeExtractor.cpp index 2f4698dce1..6d5904e308 100644 --- 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); + // 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. -- cgit v1.2.3-18-g5258