[llvm] r179696 - Don't store AttributeSet::FunctionIndex as an int.

Benjamin Kramer benny.kra at googlemail.com
Wed Apr 17 10:51:20 PDT 2013


Author: d0k
Date: Wed Apr 17 12:51:19 2013
New Revision: 179696

URL: http://llvm.org/viewvc/llvm-project?rev=179696&view=rev
Log:
Don't store AttributeSet::FunctionIndex as an int.

GCC complains: Core.cpp:1449:27: warning: overflow in implicit constant conversion [-Woverflow]
I'm not sure if that's really a problem here, but using the enum type is better
style anyways.

Modified:
    llvm/trunk/lib/IR/Core.cpp

Modified: llvm/trunk/lib/IR/Core.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Core.cpp?rev=179696&r1=179695&r2=179696&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Core.cpp (original)
+++ llvm/trunk/lib/IR/Core.cpp Wed Apr 17 12:51:19 2013
@@ -1446,7 +1446,7 @@ void LLVMAddFunctionAttr(LLVMValueRef Fn
 void LLVMAddTargetDependentFunctionAttr(LLVMValueRef Fn, const char *A,
                                         const char *V) {
   Function *Func = unwrap<Function>(Fn);
-  int Idx = AttributeSet::FunctionIndex;
+  AttributeSet::AttrIndex Idx = AttributeSet::FunctionIndex;
   AttrBuilder B;
 
   B.addAttribute(A, V);





More information about the llvm-commits mailing list