Move the Attributes::Builder outside of the Attributes class and into its own class named AttrBuilder. No functionality change.

llvm-svn: 165961
This commit is contained in:
Bill Wendling 2012-10-15 20:36:26 +00:00
parent 50d27849f6
commit a514ebc1db
6 changed files with 14 additions and 14 deletions

View File

@ -924,8 +924,8 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
const Decl *TargetDecl,
AttributeListType &PAL,
unsigned &CallingConv) {
llvm::Attributes::Builder FuncAttrs;
llvm::Attributes::Builder RetAttrs;
llvm::AttrBuilder FuncAttrs;
llvm::AttrBuilder RetAttrs;
CallingConv = FI.getEffectiveCallingConvention();
@ -984,7 +984,7 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
break;
case ABIArgInfo::Indirect: {
llvm::Attributes::Builder SRETAttrs;
llvm::AttrBuilder SRETAttrs;
SRETAttrs.addAttribute(llvm::Attributes::StructRet);
if (RetAI.getInReg())
SRETAttrs.addAttribute(llvm::Attributes::InReg);
@ -1014,7 +1014,7 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
ie = FI.arg_end(); it != ie; ++it) {
QualType ParamType = it->type;
const ABIArgInfo &AI = it->info;
llvm::Attributes::Builder Attrs;
llvm::AttrBuilder Attrs;
// 'restrict' -> 'noalias' is done in EmitFunctionProlog when we
// have the corresponding parameter variable. It doesn't make
@ -1131,7 +1131,7 @@ void CodeGenFunction::EmitFunctionProlog(const CGFunctionInfo &FI,
// Name the struct return argument.
if (CGM.ReturnTypeUsesSRet(FI)) {
AI->setName("agg.result");
llvm::Attributes::Builder B;
llvm::AttrBuilder B;
B.addAttribute(llvm::Attributes::NoAlias);
AI->addAttr(llvm::Attributes::get(getLLVMContext(), B));
++AI;
@ -1203,7 +1203,7 @@ void CodeGenFunction::EmitFunctionProlog(const CGFunctionInfo &FI,
llvm::Value *V = AI;
if (Arg->getType().isRestrictQualified()) {
llvm::Attributes::Builder B;
llvm::AttrBuilder B;
B.addAttribute(llvm::Attributes::NoAlias);
AI->addAttr(llvm::Attributes::get(getLLVMContext(), B));
}

View File

@ -2081,7 +2081,7 @@ void CodeGenFunction::EmitCheck(llvm::Value *Checked, StringRef CheckName,
llvm::FunctionType *FnType =
llvm::FunctionType::get(CGM.VoidTy, ArgTypes, false);
llvm::Attributes::Builder B;
llvm::AttrBuilder B;
B.addAttribute(llvm::Attributes::NoReturn)
.addAttribute(llvm::Attributes::NoUnwind)
.addAttribute(llvm::Attributes::UWTable);

View File

@ -63,7 +63,7 @@ private:
// Add the non-lazy-bind attribute, since objc_msgSend is likely to
// be called a lot.
llvm::Type *params[] = { ObjectPtrTy, SelectorPtrTy };
llvm::Attributes::Builder B;
llvm::AttrBuilder B;
B.addAttribute(llvm::Attributes::NonLazyBind);
return CGM.CreateRuntimeFunction(llvm::FunctionType::get(ObjectPtrTy,
params, true),
@ -583,7 +583,7 @@ public:
llvm::Constant *getSetJmpFn() {
// This is specifically the prototype for x86.
llvm::Type *params[] = { CGM.Int32Ty->getPointerTo() };
llvm::Attributes::Builder B;
llvm::AttrBuilder B;
B.addAttribute(llvm::Attributes::NonLazyBind);
return CGM.CreateRuntimeFunction(llvm::FunctionType::get(CGM.Int32Ty,
params, false),

View File

@ -1632,7 +1632,7 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) {
llvm::InlineAsm::get(FTy, AsmString, Constraints, HasSideEffect,
/* IsAlignStack */ false, AsmDialect);
llvm::CallInst *Result = Builder.CreateCall(IA, Args);
llvm::Attributes::Builder B;
llvm::AttrBuilder B;
B.addAttribute(llvm::Attributes::NoUnwind);
Result->addAttribute(llvm::AttrListPtr::FunctionIndex,
llvm::Attributes::get(getLLVMContext(), B));

View File

@ -950,7 +950,7 @@ static llvm::Constant *getGuardAcquireFn(CodeGenModule &CGM,
llvm::FunctionType *FTy =
llvm::FunctionType::get(CGM.getTypes().ConvertType(CGM.getContext().IntTy),
GuardPtrTy, /*isVarArg=*/false);
llvm::Attributes::Builder B;
llvm::AttrBuilder B;
B.addAttribute(llvm::Attributes::NoUnwind);
return CGM.CreateRuntimeFunction(FTy, "__cxa_guard_acquire",
llvm::Attributes::get(CGM.getLLVMContext(),
@ -962,7 +962,7 @@ static llvm::Constant *getGuardReleaseFn(CodeGenModule &CGM,
// void __cxa_guard_release(__guard *guard_object);
llvm::FunctionType *FTy =
llvm::FunctionType::get(CGM.VoidTy, GuardPtrTy, /*isVarArg=*/false);
llvm::Attributes::Builder B;
llvm::AttrBuilder B;
B.addAttribute(llvm::Attributes::NoUnwind);
return CGM.CreateRuntimeFunction(FTy, "__cxa_guard_release",
llvm::Attributes::get(CGM.getLLVMContext(),
@ -974,7 +974,7 @@ static llvm::Constant *getGuardAbortFn(CodeGenModule &CGM,
// void __cxa_guard_abort(__guard *guard_object);
llvm::FunctionType *FTy =
llvm::FunctionType::get(CGM.VoidTy, GuardPtrTy, /*isVarArg=*/false);
llvm::Attributes::Builder B;
llvm::AttrBuilder B;
B.addAttribute(llvm::Attributes::NoUnwind);
return CGM.CreateRuntimeFunction(FTy, "__cxa_guard_abort",
llvm::Attributes::get(CGM.getLLVMContext(),

View File

@ -968,7 +968,7 @@ void X86_32TargetCodeGenInfo::SetTargetAttributes(const Decl *D,
llvm::Function *Fn = cast<llvm::Function>(GV);
// Now add the 'alignstack' attribute with a value of 16.
llvm::Attributes::Builder B;
llvm::AttrBuilder B;
B.addStackAlignmentAttr(16);
Fn->addAttribute(llvm::AttrListPtr::FunctionIndex,
llvm::Attributes::get(CGM.getLLVMContext(), B));