mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-13 06:38:44 +00:00
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
This commit is contained in:
parent
aaaae51647
commit
1750632ee1
@ -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
Block a user