[llvm] r184041 - PruneEH: Only merge attribute sets when used. No functionality change.
Benjamin Kramer
benny.kra at googlemail.com
Sat Jun 15 03:55:39 PDT 2013
Author: d0k
Date: Sat Jun 15 05:55:39 2013
New Revision: 184041
URL: http://llvm.org/viewvc/llvm-project?rev=184041&view=rev
Log:
PruneEH: Only merge attribute sets when used. No functionality change.
Modified:
llvm/trunk/lib/Transforms/IPO/PruneEH.cpp
Modified: llvm/trunk/lib/Transforms/IPO/PruneEH.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/PruneEH.cpp?rev=184041&r1=184040&r2=184041&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/PruneEH.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/PruneEH.cpp Sat Jun 15 05:55:39 2013
@@ -145,15 +145,13 @@ bool PruneEH::runOnSCC(CallGraphSCC &SCC
NewAttributes.addAttribute(Attribute::NoReturn);
Function *F = (*I)->getFunction();
- const AttributeSet &PAL = F->getAttributes();
- const AttributeSet &NPAL =
- PAL.addAttributes(F->getContext(), AttributeSet::FunctionIndex,
- AttributeSet::get(F->getContext(),
- AttributeSet::FunctionIndex,
- NewAttributes));
+ const AttributeSet &PAL = F->getAttributes().getFnAttributes();
+ const AttributeSet &NPAL = AttributeSet::get(
+ F->getContext(), AttributeSet::FunctionIndex, NewAttributes);
+
if (PAL != NPAL) {
MadeChange = true;
- F->setAttributes(NPAL);
+ F->addAttributes(AttributeSet::FunctionIndex, NPAL);
}
}
More information about the llvm-commits
mailing list