diff options
author | Bill Wendling <isanbard@gmail.com> | 2012-10-15 07:31:59 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2012-10-15 07:31:59 +0000 |
commit | 4f0c080b93adfe769bfeeff92c6d768df2a31b3d (patch) | |
tree | 314cae79c308d5e5bd3b7315760a564a234dba23 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | fbd38fe2e34e5c4d0415514e24bacc02d6876540 (diff) | |
download | bcm5719-llvm-4f0c080b93adfe769bfeeff92c6d768df2a31b3d.tar.gz bcm5719-llvm-4f0c080b93adfe769bfeeff92c6d768df2a31b3d.zip |
Use enum values instead of magic numbers for indexing into the attribute list.
llvm-svn: 165925
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 073b59ef8dc..6be225c6b52 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -1139,7 +1139,7 @@ CodeGenModule::GetOrCreateLLVMFunction(StringRef MangledName, if (D.getDecl()) SetFunctionAttributes(D, F, IsIncompleteFunction); if (ExtraAttrs.hasAttributes()) - F->addAttribute(~0, ExtraAttrs); + F->addAttribute(llvm::AttrListPtr::FunctionIndex, ExtraAttrs); // This is the first use or definition of a mangled name. If there is a // deferred decl with this name, remember that we need to emit it at the end @@ -1822,7 +1822,9 @@ static void ReplaceUsesOfNonProtoTypeWithRealFunction(llvm::GlobalValue *Old, // Add the return attributes. if (RAttrs.hasAttributes()) - AttrVec.push_back(llvm::AttributeWithIndex::get(0, RAttrs)); + AttrVec.push_back(llvm:: + AttributeWithIndex::get(llvm::AttrListPtr::ReturnIndex, + RAttrs)); // If the function was passed too few arguments, don't transform. If extra // arguments were passed, we silently drop them. If any of the types @@ -1847,7 +1849,9 @@ static void ReplaceUsesOfNonProtoTypeWithRealFunction(llvm::GlobalValue *Old, llvm::Attributes FnAttrs = AttrList.getFnAttributes(); if (FnAttrs.hasAttributes()) - AttrVec.push_back(llvm::AttributeWithIndex::get(~0, FnAttrs)); + AttrVec.push_back(llvm:: + AttributeWithIndex::get(llvm::AttrListPtr::FunctionIndex, + FnAttrs)); // Okay, we can transform this. Create the new call instruction and copy // over the required information. |