mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +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 the SCC doesn't unwind or doesn't throw, note this fact.
|
||||||
if (!SCCMightUnwind || !SCCMightReturn)
|
if (!SCCMightUnwind || !SCCMightReturn)
|
||||||
for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I) {
|
for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I) {
|
||||||
Attributes NewAttributes = Attribute::None;
|
Attributes::Builder NewAttributes;
|
||||||
|
|
||||||
if (!SCCMightUnwind)
|
if (!SCCMightUnwind)
|
||||||
NewAttributes |= Attribute::NoUnwind;
|
NewAttributes.addNoUnwindAttr();
|
||||||
if (!SCCMightReturn)
|
if (!SCCMightReturn)
|
||||||
NewAttributes |= Attribute::NoReturn;
|
NewAttributes.addNoReturnAttr();
|
||||||
|
|
||||||
Function *F = (*I)->getFunction();
|
Function *F = (*I)->getFunction();
|
||||||
const AttrListPtr &PAL = F->getAttributes();
|
const AttrListPtr &PAL = F->getAttributes();
|
||||||
const AttrListPtr &NPAL = PAL.addAttr(~0, NewAttributes);
|
const AttrListPtr &NPAL = PAL.addAttr(~0, Attributes::get(NewAttributes));
|
||||||
if (PAL != NPAL) {
|
if (PAL != NPAL) {
|
||||||
MadeChange = true;
|
MadeChange = true;
|
||||||
F->setAttributes(NPAL);
|
F->setAttributes(NPAL);
|
||||||
|
@ -1788,7 +1788,9 @@ Constant *ObjCARCOpt::getRetainRVCallee(Module *M) {
|
|||||||
Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
|
Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
|
||||||
Type *Params[] = { I8X };
|
Type *Params[] = { I8X };
|
||||||
FunctionType *FTy = FunctionType::get(I8X, Params, /*isVarArg=*/false);
|
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 =
|
RetainRVCallee =
|
||||||
M->getOrInsertFunction("objc_retainAutoreleasedReturnValue", FTy,
|
M->getOrInsertFunction("objc_retainAutoreleasedReturnValue", FTy,
|
||||||
Attributes);
|
Attributes);
|
||||||
@ -1802,7 +1804,9 @@ Constant *ObjCARCOpt::getAutoreleaseRVCallee(Module *M) {
|
|||||||
Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
|
Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
|
||||||
Type *Params[] = { I8X };
|
Type *Params[] = { I8X };
|
||||||
FunctionType *FTy = FunctionType::get(I8X, Params, /*isVarArg=*/false);
|
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 =
|
AutoreleaseRVCallee =
|
||||||
M->getOrInsertFunction("objc_autoreleaseReturnValue", FTy,
|
M->getOrInsertFunction("objc_autoreleaseReturnValue", FTy,
|
||||||
Attributes);
|
Attributes);
|
||||||
@ -1814,7 +1818,9 @@ Constant *ObjCARCOpt::getReleaseCallee(Module *M) {
|
|||||||
if (!ReleaseCallee) {
|
if (!ReleaseCallee) {
|
||||||
LLVMContext &C = M->getContext();
|
LLVMContext &C = M->getContext();
|
||||||
Type *Params[] = { PointerType::getUnqual(Type::getInt8Ty(C)) };
|
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 =
|
ReleaseCallee =
|
||||||
M->getOrInsertFunction(
|
M->getOrInsertFunction(
|
||||||
"objc_release",
|
"objc_release",
|
||||||
@ -1828,7 +1834,9 @@ Constant *ObjCARCOpt::getRetainCallee(Module *M) {
|
|||||||
if (!RetainCallee) {
|
if (!RetainCallee) {
|
||||||
LLVMContext &C = M->getContext();
|
LLVMContext &C = M->getContext();
|
||||||
Type *Params[] = { PointerType::getUnqual(Type::getInt8Ty(C)) };
|
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 =
|
RetainCallee =
|
||||||
M->getOrInsertFunction(
|
M->getOrInsertFunction(
|
||||||
"objc_retain",
|
"objc_retain",
|
||||||
@ -1857,7 +1865,9 @@ Constant *ObjCARCOpt::getAutoreleaseCallee(Module *M) {
|
|||||||
if (!AutoreleaseCallee) {
|
if (!AutoreleaseCallee) {
|
||||||
LLVMContext &C = M->getContext();
|
LLVMContext &C = M->getContext();
|
||||||
Type *Params[] = { PointerType::getUnqual(Type::getInt8Ty(C)) };
|
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 =
|
AutoreleaseCallee =
|
||||||
M->getOrInsertFunction(
|
M->getOrInsertFunction(
|
||||||
"objc_autorelease",
|
"objc_autorelease",
|
||||||
@ -3830,9 +3840,10 @@ Constant *ObjCARCContract::getStoreStrongCallee(Module *M) {
|
|||||||
Type *I8XX = PointerType::getUnqual(I8X);
|
Type *I8XX = PointerType::getUnqual(I8X);
|
||||||
Type *Params[] = { I8XX, I8X };
|
Type *Params[] = { I8XX, I8X };
|
||||||
|
|
||||||
AttrListPtr Attributes = AttrListPtr()
|
Attributes::Builder B;
|
||||||
.addAttr(~0u, Attribute::NoUnwind)
|
B.addNoUnwindAttr();
|
||||||
.addAttr(1, Attribute::NoCapture);
|
B.addNoCaptureAttr();
|
||||||
|
AttrListPtr Attributes = AttrListPtr().addAttr(~0u, Attributes::get(B));
|
||||||
|
|
||||||
StoreStrongCallee =
|
StoreStrongCallee =
|
||||||
M->getOrInsertFunction(
|
M->getOrInsertFunction(
|
||||||
@ -3849,7 +3860,9 @@ Constant *ObjCARCContract::getRetainAutoreleaseCallee(Module *M) {
|
|||||||
Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
|
Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
|
||||||
Type *Params[] = { I8X };
|
Type *Params[] = { I8X };
|
||||||
FunctionType *FTy = FunctionType::get(I8X, Params, /*isVarArg=*/false);
|
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 =
|
RetainAutoreleaseCallee =
|
||||||
M->getOrInsertFunction("objc_retainAutorelease", FTy, Attributes);
|
M->getOrInsertFunction("objc_retainAutorelease", FTy, Attributes);
|
||||||
}
|
}
|
||||||
@ -3862,7 +3875,9 @@ Constant *ObjCARCContract::getRetainAutoreleaseRVCallee(Module *M) {
|
|||||||
Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
|
Type *I8X = PointerType::getUnqual(Type::getInt8Ty(C));
|
||||||
Type *Params[] = { I8X };
|
Type *Params[] = { I8X };
|
||||||
FunctionType *FTy = FunctionType::get(I8X, Params, /*isVarArg=*/false);
|
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 =
|
RetainAutoreleaseRVCallee =
|
||||||
M->getOrInsertFunction("objc_retainAutoreleaseReturnValue", FTy,
|
M->getOrInsertFunction("objc_retainAutoreleaseReturnValue", FTy,
|
||||||
Attributes);
|
Attributes);
|
||||||
|
Reference in New Issue
Block a user