diff options
Diffstat (limited to 'llvm/lib/Transforms/IPO/PruneEH.cpp')
| -rw-r--r-- | llvm/lib/Transforms/IPO/PruneEH.cpp | 12 | 
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);        }      } | 

