Function attributes have index ~0, not 0
authorKenneth Uildriks <kennethuil@gmail.com>
Tue, 16 Feb 2010 19:28:02 +0000 (19:28 +0000)
committerKenneth Uildriks <kennethuil@gmail.com>
Tue, 16 Feb 2010 19:28:02 +0000 (19:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96370 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Core.cpp

index a044fc5b1a04d7b945375e4c72712a2bc2f181cd..5883cdbfbbb6c78b6cb790a94f7daf87e29ab83f 100644 (file)
@@ -1215,14 +1215,14 @@ void LLVMSetGC(LLVMValueRef Fn, const char *GC) {
 void LLVMAddFunctionAttr(LLVMValueRef Fn, LLVMAttribute PA) {
   Function *Func = unwrap<Function>(Fn);
   const AttrListPtr PAL = Func->getAttributes();
-  const AttrListPtr PALnew = PAL.addAttr(0, PA);
+  const AttrListPtr PALnew = PAL.addAttr(~0U, PA);
   Func->setAttributes(PALnew);
 }
 
 void LLVMRemoveFunctionAttr(LLVMValueRef Fn, LLVMAttribute PA) {
   Function *Func = unwrap<Function>(Fn);
   const AttrListPtr PAL = Func->getAttributes();
-  const AttrListPtr PALnew = PAL.removeAttr(0, PA);
+  const AttrListPtr PALnew = PAL.removeAttr(~0U, PA);
   Func->setAttributes(PALnew);
 }