diff options
author | Arthur Eubanks <aeubanks@google.com> | 2021-08-16 18:24:22 -0700 |
---|---|---|
committer | Arthur Eubanks <aeubanks@google.com> | 2021-08-17 21:05:41 -0700 |
commit | de0ae9e89ec437d9f58e4b2da04d210c161854a3 (patch) | |
tree | 195a1215f00baa00c52e9fe6729951b07c985349 /clang/lib/CodeGen/CGCall.cpp | |
parent | cc327bd5231126006b4177b8ce0946ce52e2f645 (diff) | |
download | llvm-de0ae9e89ec437d9f58e4b2da04d210c161854a3.zip llvm-de0ae9e89ec437d9f58e4b2da04d210c161854a3.tar.gz llvm-de0ae9e89ec437d9f58e4b2da04d210c161854a3.tar.bz2 |
[NFC] Cleanup more AttributeList::addAttribute()
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 4b15243..c9dc1c8 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -4527,7 +4527,7 @@ maybeRaiseRetAlignmentAttribute(llvm::LLVMContext &Ctx, return Attrs; llvm::Attribute AlignAttr = llvm::Attribute::getWithAlignment(Ctx, NewAlign); return Attrs.removeRetAttribute(Ctx, llvm::Attribute::AttrKind::Alignment) - .addAttribute(Ctx, llvm::AttributeList::ReturnIndex, AlignAttr); + .addRetAttribute(Ctx, AlignAttr); } template <typename AlignedAttrTy> class AbstractAssumeAlignedAttrEmitter { @@ -5188,15 +5188,11 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(CurFuncDecl)) if (FD->hasAttr<StrictFPAttr>()) // All calls within a strictfp function are marked strictfp - Attrs = - Attrs.addAttribute(getLLVMContext(), llvm::AttributeList::FunctionIndex, - llvm::Attribute::StrictFP); + Attrs = Attrs.addFnAttribute(getLLVMContext(), llvm::Attribute::StrictFP); // Add call-site nomerge attribute if exists. if (InNoMergeAttributedStmt) - Attrs = - Attrs.addAttribute(getLLVMContext(), llvm::AttributeList::FunctionIndex, - llvm::Attribute::NoMerge); + Attrs = Attrs.addFnAttribute(getLLVMContext(), llvm::Attribute::NoMerge); // Apply some call-site-specific attributes. // TODO: work this into building the attribute set. @@ -5206,15 +5202,12 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, if (CurCodeDecl && CurCodeDecl->hasAttr<FlattenAttr>() && !(TargetDecl && TargetDecl->hasAttr<NoInlineAttr>())) { Attrs = - Attrs.addAttribute(getLLVMContext(), llvm::AttributeList::FunctionIndex, - llvm::Attribute::AlwaysInline); + Attrs.addFnAttribute(getLLVMContext(), llvm::Attribute::AlwaysInline); } // Disable inlining inside SEH __try blocks. if (isSEHTryScope()) { - Attrs = - Attrs.addAttribute(getLLVMContext(), llvm::AttributeList::FunctionIndex, - llvm::Attribute::NoInline); + Attrs = Attrs.addFnAttribute(getLLVMContext(), llvm::Attribute::NoInline); } // Decide whether to use a call or an invoke. @@ -5282,8 +5275,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, if (const auto *FD = dyn_cast_or_null<FunctionDecl>(CurFuncDecl)) { if (const auto *A = FD->getAttr<CFGuardAttr>()) { if (A->getGuard() == CFGuardAttr::GuardArg::nocf && !CI->getCalledFunction()) - Attrs = Attrs.addAttribute( - getLLVMContext(), llvm::AttributeList::FunctionIndex, "guard_nocf"); + Attrs = Attrs.addFnAttribute(getLLVMContext(), "guard_nocf"); } } |