aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/CGCall.cpp5
-rw-r--r--lib/CodeGen/CGStmt.cpp3
-rw-r--r--lib/CodeGen/CodeGenModule.cpp10
-rw-r--r--lib/CodeGen/TargetInfo.cpp3
4 files changed, 14 insertions, 7 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp
index 15db9fd305..715438c8ff 100644
--- a/lib/CodeGen/CGCall.cpp
+++ b/lib/CodeGen/CGCall.cpp
@@ -1006,7 +1006,7 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
if (RetAttrs.hasAttributes())
PAL.push_back(llvm::
- AttributeWithIndex::get(0,
+ AttributeWithIndex::get(llvm::AttrListPtr::ReturnIndex,
llvm::Attributes::get(getLLVMContext(),
RetAttrs)));
@@ -1080,7 +1080,8 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
++Index;
}
if (FuncAttrs.hasAttributes())
- PAL.push_back(llvm::AttributeWithIndex::get(~0,
+ PAL.push_back(llvm::
+ AttributeWithIndex::get(llvm::AttrListPtr::FunctionIndex,
llvm::Attributes::get(getLLVMContext(),
FuncAttrs)));
}
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp
index 3b28a61939..976d69d6b3 100644
--- a/lib/CodeGen/CGStmt.cpp
+++ b/lib/CodeGen/CGStmt.cpp
@@ -1634,7 +1634,8 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) {
llvm::CallInst *Result = Builder.CreateCall(IA, Args);
llvm::Attributes::Builder B;
B.addAttribute(llvm::Attributes::NoUnwind);
- Result->addAttribute(~0, llvm::Attributes::get(getLLVMContext(), B));
+ Result->addAttribute(llvm::AttrListPtr::FunctionIndex,
+ llvm::Attributes::get(getLLVMContext(), B));
// Slap the source location of the inline asm into a !srcloc metadata on the
// call. FIXME: Handle metadata for MS-style inline asms.
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 073b59ef8d..6be225c6b5 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/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.
diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp
index 497adcd753..dca335d69d 100644
--- a/lib/CodeGen/TargetInfo.cpp
+++ b/lib/CodeGen/TargetInfo.cpp
@@ -970,7 +970,8 @@ void X86_32TargetCodeGenInfo::SetTargetAttributes(const Decl *D,
// Now add the 'alignstack' attribute with a value of 16.
llvm::Attributes::Builder B;
B.addStackAlignmentAttr(16);
- Fn->addAttribute(~0U, llvm::Attributes::get(CGM.getLLVMContext(), B));
+ Fn->addAttribute(llvm::AttrListPtr::FunctionIndex,
+ llvm::Attributes::get(CGM.getLLVMContext(), B));
}
}
}