summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2013-06-15 10:55:39 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2013-06-15 10:55:39 +0000
commit9ddfaf2be68726cba175938b0c2ec8cd5ae855a6 (patch)
treec86fb8bd866a19f3d4daf6b1d1b2f98b4fd83764 /llvm/lib/Transforms
parent60afa2d923e6032b3295a87ca5144322437a59ce (diff)
downloadbcm5719-llvm-9ddfaf2be68726cba175938b0c2ec8cd5ae855a6.tar.gz
bcm5719-llvm-9ddfaf2be68726cba175938b0c2ec8cd5ae855a6.zip
PruneEH: Only merge attribute sets when used. No functionality change.
llvm-svn: 184041
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/IPO/PruneEH.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/IPO/PruneEH.cpp b/llvm/lib/Transforms/IPO/PruneEH.cpp
index 73d9323195b..89529dee110 100644
--- a/llvm/lib/Transforms/IPO/PruneEH.cpp
+++ b/llvm/lib/Transforms/IPO/PruneEH.cpp
@@ -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);
}
}
OpenPOWER on IntegriCloud