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
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) {
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;
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
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;
}
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.
.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();
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, ...)
return CGM.CreateRuntimeFunction(llvm::FunctionType::get(CGM.Int32Ty,
params, false),
"_setjmp",
- llvm::Attributes::get(B));
+ llvm::Attributes::get(CGM.getLLVMContext(),
+ B));
}
public:
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.
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;
}
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,
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,
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 {
// 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));
}
}
}