diff options
author | Arthur Eubanks <aeubanks@google.com> | 2021-08-16 16:29:20 -0700 |
---|---|---|
committer | Arthur Eubanks <aeubanks@google.com> | 2021-08-17 21:05:40 -0700 |
commit | 46cf82532cf1502b6320517a2ef42d8c435e598a (patch) | |
tree | c4eef49199276faf133fb0041a8747b93be6e589 /llvm/lib/Transforms/Utils/ModuleUtils.cpp | |
parent | b41bfb819d0c3cbffe6dc0679f427ab1f44377b9 (diff) | |
download | llvm-46cf82532cf1502b6320517a2ef42d8c435e598a.zip llvm-46cf82532cf1502b6320517a2ef42d8c435e598a.tar.gz llvm-46cf82532cf1502b6320517a2ef42d8c435e598a.tar.bz2 |
[NFC] Replace Function handling of attributes with less confusing calls
To avoid magic constants and confusing indexes.
Diffstat (limited to 'llvm/lib/Transforms/Utils/ModuleUtils.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/ModuleUtils.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/ModuleUtils.cpp b/llvm/lib/Transforms/Utils/ModuleUtils.cpp index 2aef3720..aa95204 100644 --- a/llvm/lib/Transforms/Utils/ModuleUtils.cpp +++ b/llvm/lib/Transforms/Utils/ModuleUtils.cpp @@ -125,7 +125,7 @@ Function *llvm::createSanitizerCtor(Module &M, StringRef CtorName) { Function *Ctor = Function::createWithDefaultAttr( FunctionType::get(Type::getVoidTy(M.getContext()), false), GlobalValue::InternalLinkage, 0, CtorName, &M); - Ctor->addAttribute(AttributeList::FunctionIndex, Attribute::NoUnwind); + Ctor->addFnAttr(Attribute::NoUnwind); BasicBlock *CtorBB = BasicBlock::Create(M.getContext(), "", Ctor); ReturnInst::Create(M.getContext(), CtorBB); // Ensure Ctor cannot be discarded, even if in a comdat. |