mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-27 14:34:58 +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:
parent
341873ae02
commit
c40abb0b68
@ -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);
|
||||
|
@ -1788,7 +1788,9 @@ Constant *ObjCARCOpt::getRetainRVCallee(Module *M) {
|
||||
Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
|
||||
Type *Params[] = { I8X };
|
||||
FunctionType *FTy = FunctionType::get(I8X, Params, /*isVarArg=*/false);
|
||||
AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attribute::NoUnwind);
|
||||
Attributes::Builder B;
|
||||
B.addNoUnwindAttr();
|
||||
AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
|
||||
RetainRVCallee =
|
||||
M->getOrInsertFunction("objc_retainAutoreleasedReturnValue", FTy,
|
||||
Attributes);
|
||||
@ -1802,7 +1804,9 @@ Constant *ObjCARCOpt::getAutoreleaseRVCallee(Module *M) {
|
||||
Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
|
||||
Type *Params[] = { I8X };
|
||||
FunctionType *FTy = FunctionType::get(I8X, Params, /*isVarArg=*/false);
|
||||
AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attribute::NoUnwind);
|
||||
Attributes::Builder B;
|
||||
B.addNoUnwindAttr();
|
||||
AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
|
||||
AutoreleaseRVCallee =
|
||||
M->getOrInsertFunction("objc_autoreleaseReturnValue", FTy,
|
||||
Attributes);
|
||||
@ -1814,7 +1818,9 @@ Constant *ObjCARCOpt::getReleaseCallee(Module *M) {
|
||||
if (!ReleaseCallee) {
|
||||
LLVMContext &C = M->getContext();
|
||||
Type *Params[] = { PointerType::getUnqual(Type::getInt8Ty(C)) };
|
||||
AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attribute::NoUnwind);
|
||||
Attributes::Builder B;
|
||||
B.addNoUnwindAttr();
|
||||
AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
|
||||
ReleaseCallee =
|
||||
M->getOrInsertFunction(
|
||||
"objc_release",
|
||||
@ -1828,7 +1834,9 @@ Constant *ObjCARCOpt::getRetainCallee(Module *M) {
|
||||
if (!RetainCallee) {
|
||||
LLVMContext &C = M->getContext();
|
||||
Type *Params[] = { PointerType::getUnqual(Type::getInt8Ty(C)) };
|
||||
AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attribute::NoUnwind);
|
||||
Attributes::Builder B;
|
||||
B.addNoUnwindAttr();
|
||||
AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
|
||||
RetainCallee =
|
||||
M->getOrInsertFunction(
|
||||
"objc_retain",
|
||||
@ -1857,7 +1865,9 @@ Constant *ObjCARCOpt::getAutoreleaseCallee(Module *M) {
|
||||
if (!AutoreleaseCallee) {
|
||||
LLVMContext &C = M->getContext();
|
||||
Type *Params[] = { PointerType::getUnqual(Type::getInt8Ty(C)) };
|
||||
AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attribute::NoUnwind);
|
||||
Attributes::Builder B;
|
||||
B.addNoUnwindAttr();
|
||||
AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
|
||||
AutoreleaseCallee =
|
||||
M->getOrInsertFunction(
|
||||
"objc_autorelease",
|
||||
@ -3830,9 +3840,10 @@ Constant *ObjCARCContract::getStoreStrongCallee(Module *M) {
|
||||
Type *I8XX = PointerType::getUnqual(I8X);
|
||||
Type *Params[] = { I8XX, I8X };
|
||||
|
||||
AttrListPtr Attributes = AttrListPtr()
|
||||
.addAttr(~0u, Attribute::NoUnwind)
|
||||
.addAttr(1, Attribute::NoCapture);
|
||||
Attributes::Builder B;
|
||||
B.addNoUnwindAttr();
|
||||
B.addNoCaptureAttr();
|
||||
AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
|
||||
|
||||
StoreStrongCallee =
|
||||
M->getOrInsertFunction(
|
||||
@ -3849,7 +3860,9 @@ Constant *ObjCARCContract::getRetainAutoreleaseCallee(Module *M) {
|
||||
Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
|
||||
Type *Params[] = { I8X };
|
||||
FunctionType *FTy = FunctionType::get(I8X, Params, /*isVarArg=*/false);
|
||||
AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attribute::NoUnwind);
|
||||
Attributes::Builder B;
|
||||
B.addNoUnwindAttr();
|
||||
AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
|
||||
RetainAutoreleaseCallee =
|
||||
M->getOrInsertFunction("objc_retainAutorelease", FTy, Attributes);
|
||||
}
|
||||
@ -3862,7 +3875,9 @@ Constant *ObjCARCContract::getRetainAutoreleaseRVCallee(Module *M) {
|
||||
Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
|
||||
Type *Params[] = { I8X };
|
||||
FunctionType *FTy = FunctionType::get(I8X, Params, /*isVarArg=*/false);
|
||||
AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attribute::NoUnwind);
|
||||
Attributes::Builder B;
|
||||
B.addNoUnwindAttr();
|
||||
AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
|
||||
RetainAutoreleaseRVCallee =
|
||||
M->getOrInsertFunction("objc_retainAutoreleaseReturnValue", FTy,
|
||||
Attributes);
|
||||
|
Loading…
x
Reference in New Issue
Block a user