[CodeExtractor] Remove unnecessary explicit attribute handling (NFC)
authorNikita Popov <npopov@redhat.com>
Mon, 3 Jan 2022 13:11:56 +0000 (14:11 +0100)
committerNikita Popov <npopov@redhat.com>
Mon, 3 Jan 2022 13:23:25 +0000 (14:23 +0100)
The nounwind and uwtable attributes will get handled as part of
the loop below as well, there is no need to special-case them here.

llvm/lib/Transforms/Utils/CodeExtractor.cpp

index 4669f4b..f577643 100644 (file)
@@ -871,13 +871,6 @@ Function *CodeExtractor::constructFunction(const ValueSet &inputs,
   Function *newFunction = Function::Create(
       funcType, GlobalValue::InternalLinkage, oldFunction->getAddressSpace(),
       oldFunction->getName() + "." + SuffixToUse, M);
-  // If the old function is no-throw, so is the new one.
-  if (oldFunction->doesNotThrow())
-    newFunction->setDoesNotThrow();
-
-  // Inherit the uwtable attribute if we need to.
-  if (oldFunction->hasUWTable())
-    newFunction->setHasUWTable();
 
   // Inherit all of the target dependent attributes and white-listed
   // target independent attributes.