forked from OSchip/llvm-project
PruneEH: Only merge attribute sets when used. No functionality change.
llvm-svn: 184041
This commit is contained in:
parent
60afa2d923
commit
9ddfaf2be6
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue