[cfe-commits] r165918 - in /cfe/trunk/lib/CodeGen: CGCall.cpp CGExpr.cpp CGObjCMac.cpp CGStmt.cpp CodeGenModule.cpp ItaniumCXXABI.cpp TargetInfo.cpp
Bill Wendling
isanbard at gmail.com
Sun Oct 14 21:47:45 PDT 2012
Author: void
Date: Sun Oct 14 23:47:45 2012
New Revision: 165918
URL: http://llvm.org/viewvc/llvm-project?rev=165918&view=rev
Log:
Attributes Rewrite
Convert the uses of the Attributes class over to the new format. The
Attributes::get method call now takes an LLVM context so that the attributes
object can be uniquified and stored.
Modified:
cfe/trunk/lib/CodeGen/CGCall.cpp
cfe/trunk/lib/CodeGen/CGExpr.cpp
cfe/trunk/lib/CodeGen/CGObjCMac.cpp
cfe/trunk/lib/CodeGen/CGStmt.cpp
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp
cfe/trunk/lib/CodeGen/TargetInfo.cpp
Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=165918&r1=165917&r2=165918&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGCall.cpp Sun Oct 14 23:47:45 2012
@@ -990,7 +990,8 @@
SRETAttrs.addAttribute(llvm::Attributes::InReg);
PAL.push_back(llvm::
AttributeWithIndex::get(Index,
- llvm::Attributes::get(SRETAttrs)));
+ llvm::Attributes::get(getLLVMContext(),
+ SRETAttrs)));
++Index;
// sret disables readnone and readonly
@@ -1006,7 +1007,8 @@
if (RetAttrs.hasAttributes())
PAL.push_back(llvm::
AttributeWithIndex::get(0,
- llvm::Attributes::get(RetAttrs)));
+ llvm::Attributes::get(getLLVMContext(),
+ RetAttrs)));
for (CGFunctionInfo::const_arg_iterator it = FI.arg_begin(),
ie = FI.arg_end(); it != ie; ++it) {
@@ -1039,7 +1041,8 @@
if (Attrs.hasAttributes())
for (unsigned I = 0; I < Extra; ++I)
PAL.push_back(llvm::AttributeWithIndex::get(Index + I,
- llvm::Attributes::get(Attrs)));
+ llvm::Attributes::get(getLLVMContext(),
+ Attrs)));
Index += Extra;
}
break;
@@ -1072,12 +1075,14 @@
if (Attrs.hasAttributes())
PAL.push_back(llvm::AttributeWithIndex::get(Index,
- llvm::Attributes::get(Attrs)));
+ llvm::Attributes::get(getLLVMContext(),
+ Attrs)));
++Index;
}
if (FuncAttrs.hasAttributes())
PAL.push_back(llvm::AttributeWithIndex::get(~0,
- llvm::Attributes::get(FuncAttrs)));
+ llvm::Attributes::get(getLLVMContext(),
+ FuncAttrs)));
}
/// An argument came in as a promoted argument; demote it back to its
@@ -1127,7 +1132,7 @@
AI->setName("agg.result");
llvm::Attributes::Builder B;
B.addAttribute(llvm::Attributes::NoAlias);
- AI->addAttr(llvm::Attributes::get(B));
+ AI->addAttr(llvm::Attributes::get(getLLVMContext(), B));
++AI;
}
@@ -1199,7 +1204,7 @@
if (Arg->getType().isRestrictQualified()) {
llvm::Attributes::Builder B;
B.addAttribute(llvm::Attributes::NoAlias);
- AI->addAttr(llvm::Attributes::get(B));
+ AI->addAttr(llvm::Attributes::get(getLLVMContext(), B));
}
// Ensure the argument is the correct type.
Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=165918&r1=165917&r2=165918&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Sun Oct 14 23:47:45 2012
@@ -2087,7 +2087,8 @@
.addAttribute(llvm::Attributes::UWTable);
llvm::Value *Fn = CGM.CreateRuntimeFunction(FnType,
("__ubsan_handle_" + CheckName).str(),
- llvm::Attributes::get(B));
+ llvm::Attributes::get(getLLVMContext(),
+ B));
llvm::CallInst *HandlerCall = Builder.CreateCall(Fn, Args);
HandlerCall->setDoesNotReturn();
HandlerCall->setDoesNotThrow();
Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=165918&r1=165917&r2=165918&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Sun Oct 14 23:47:45 2012
@@ -68,7 +68,8 @@
return CGM.CreateRuntimeFunction(llvm::FunctionType::get(ObjectPtrTy,
params, true),
"objc_msgSend",
- llvm::Attributes::get(B));
+ llvm::Attributes::get(CGM.getLLVMContext(),
+ B));
}
/// void objc_msgSend_stret (id, SEL, ...)
@@ -587,7 +588,8 @@
return CGM.CreateRuntimeFunction(llvm::FunctionType::get(CGM.Int32Ty,
params, false),
"_setjmp",
- llvm::Attributes::get(B));
+ llvm::Attributes::get(CGM.getLLVMContext(),
+ B));
}
public:
Modified: cfe/trunk/lib/CodeGen/CGStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmt.cpp?rev=165918&r1=165917&r2=165918&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGStmt.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGStmt.cpp Sun Oct 14 23:47:45 2012
@@ -1634,7 +1634,7 @@
llvm::CallInst *Result = Builder.CreateCall(IA, Args);
llvm::Attributes::Builder B;
B.addAttribute(llvm::Attributes::NoUnwind);
- Result->addAttribute(~0, llvm::Attributes::get(B));
+ Result->addAttribute(~0, llvm::Attributes::get(getLLVMContext(), B));
// Slap the source location of the inline asm into a !srcloc metadata on the
// call. FIXME: Handle metadata for MS-style inline asms.
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=165918&r1=165917&r2=165918&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Sun Oct 14 23:47:45 2012
@@ -646,7 +646,8 @@
if (unsigned IID = F->getIntrinsicID()) {
// If this is an intrinsic function, set the function's attributes
// to the intrinsic's attributes.
- F->setAttributes(llvm::Intrinsic::getAttributes((llvm::Intrinsic::ID)IID));
+ F->setAttributes(llvm::Intrinsic::getAttributes(getLLVMContext(),
+ (llvm::Intrinsic::ID)IID));
return;
}
Modified: cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp?rev=165918&r1=165917&r2=165918&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp (original)
+++ cfe/trunk/lib/CodeGen/ItaniumCXXABI.cpp Sun Oct 14 23:47:45 2012
@@ -953,7 +953,8 @@
llvm::Attributes::Builder B;
B.addAttribute(llvm::Attributes::NoUnwind);
return CGM.CreateRuntimeFunction(FTy, "__cxa_guard_acquire",
- llvm::Attributes::get(B));
+ llvm::Attributes::get(CGM.getLLVMContext(),
+ B));
}
static llvm::Constant *getGuardReleaseFn(CodeGenModule &CGM,
@@ -964,7 +965,8 @@
llvm::Attributes::Builder B;
B.addAttribute(llvm::Attributes::NoUnwind);
return CGM.CreateRuntimeFunction(FTy, "__cxa_guard_release",
- llvm::Attributes::get(B));
+ llvm::Attributes::get(CGM.getLLVMContext(),
+ B));
}
static llvm::Constant *getGuardAbortFn(CodeGenModule &CGM,
@@ -975,7 +977,8 @@
llvm::Attributes::Builder B;
B.addAttribute(llvm::Attributes::NoUnwind);
return CGM.CreateRuntimeFunction(FTy, "__cxa_guard_abort",
- llvm::Attributes::get(B));
+ llvm::Attributes::get(CGM.getLLVMContext(),
+ B));
}
namespace {
Modified: cfe/trunk/lib/CodeGen/TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/TargetInfo.cpp?rev=165918&r1=165917&r2=165918&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/TargetInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/TargetInfo.cpp Sun Oct 14 23:47:45 2012
@@ -970,7 +970,7 @@
// Now add the 'alignstack' attribute with a value of 16.
llvm::Attributes::Builder B;
B.addStackAlignmentAttr(16);
- Fn->addAttribute(~0U, llvm::Attributes::get(B));
+ Fn->addAttribute(~0U, llvm::Attributes::get(CGM.getLLVMContext(), B));
}
}
}
More information about the cfe-commits
mailing list