summaryrefslogtreecommitdiff
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
commit1750632ee13c51e6191c513b163c5f41e0dab4eb (patch)
treefc2188ee001ebf8a3b2246b378bd331ecf93fa93
parentaaaae516470f20a76950f434695b64c40a44e5de (diff)
downloadllvm-1750632ee13c51e6191c513b163c5f41e0dab4eb.tar.gz
llvm-1750632ee13c51e6191c513b163c5f41e0dab4eb.tar.bz2
llvm-1750632ee13c51e6191c513b163c5f41e0dab4eb.tar.xz
PruneEH: Only merge attribute sets when used. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184041 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/IPO/PruneEH.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Transforms/IPO/PruneEH.cpp b/lib/Transforms/IPO/PruneEH.cpp
index 73d9323195..89529dee11 100644
--- a/lib/Transforms/IPO/PruneEH.cpp
+++ b/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);
}
}