mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
Convert to using the Attributes::Builder class to create attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165468 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -137,16 +137,16 @@ bool PruneEH::runOnSCC(CallGraphSCC &SCC) {
|
||||
// If the SCC doesn't unwind or doesn't throw, note this fact.
|
||||
if (!SCCMightUnwind || !SCCMightReturn)
|
||||
for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I) {
|
||||
Attributes NewAttributes = Attribute::None;
|
||||
Attributes::Builder NewAttributes;
|
||||
|
||||
if (!SCCMightUnwind)
|
||||
NewAttributes |= Attribute::NoUnwind;
|
||||
NewAttributes.addNoUnwindAttr();
|
||||
if (!SCCMightReturn)
|
||||
NewAttributes |= Attribute::NoReturn;
|
||||
NewAttributes.addNoReturnAttr();
|
||||
|
||||
Function *F = (*I)->getFunction();
|
||||
const AttrListPtr &PAL = F->getAttributes();
|
||||
const AttrListPtr &NPAL = PAL.addAttr(~0, NewAttributes);
|
||||
const AttrListPtr &NPAL = PAL.addAttr(~0, Attributes::get(NewAttributes));
|
||||
if (PAL != NPAL) {
|
||||
MadeChange = true;
|
||||
F->setAttributes(NPAL);
|
||||
|
Reference in New Issue
Block a user