summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-01-27 02:46:53 +0000
committerBill Wendling <isanbard@gmail.com>2013-01-27 02:46:53 +0000
commit290d952bb47e90cc742ff4c2138c5c85c84e4726 (patch)
treeaecccaa0d63672cb3f82b0ee7ccdd47cd1ebc078 /clang/lib/CodeGen/CGCall.cpp
parentf5075a4fe0b85bd24b49251ce2d01afca4351714 (diff)
downloadbcm5719-llvm-290d952bb47e90cc742ff4c2138c5c85c84e4726.tar.gz
bcm5719-llvm-290d952bb47e90cc742ff4c2138c5c85c84e4726.zip
Use the AttributeSet instead of AttributeWithIndex.
In the future, AttributeWithIndex won't be used anymore. Besides, it exposes the internals of the AttributeSet to outside users, which isn't goodness. llvm-svn: 173605
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp35
1 files changed, 13 insertions, 22 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 55588241adf..c29230f75bf 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -1037,9 +1037,7 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
if (RetAI.getInReg())
SRETAttrs.addAttribute(llvm::Attribute::InReg);
PAL.push_back(llvm::
- AttributeWithIndex::get(Index,
- llvm::Attribute::get(getLLVMContext(),
- SRETAttrs)));
+ AttributeSet::get(getLLVMContext(), Index, SRETAttrs));
++Index;
// sret disables readnone and readonly
@@ -1054,9 +1052,9 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
if (RetAttrs.hasAttributes())
PAL.push_back(llvm::
- AttributeWithIndex::get(llvm::AttributeSet::ReturnIndex,
- llvm::Attribute::get(getLLVMContext(),
- RetAttrs)));
+ AttributeSet::get(getLLVMContext(),
+ llvm::AttributeSet::ReturnIndex,
+ RetAttrs));
for (CGFunctionInfo::const_arg_iterator it = FI.arg_begin(),
ie = FI.arg_end(); it != ie; ++it) {
@@ -1065,13 +1063,9 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
llvm::AttrBuilder Attrs;
if (AI.getPaddingType()) {
- if (AI.getPaddingInReg()) {
- llvm::AttrBuilder PadAttrs;
- PadAttrs.addAttribute(llvm::Attribute::InReg);
-
- llvm::Attribute A =llvm::Attribute::get(getLLVMContext(), PadAttrs);
- PAL.push_back(llvm::AttributeWithIndex::get(Index, A));
- }
+ if (AI.getPaddingInReg())
+ PAL.push_back(llvm::AttributeSet::get(getLLVMContext(), Index,
+ llvm::Attribute::InReg));
// Increment Index if there is padding.
++Index;
}
@@ -1097,9 +1091,8 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
unsigned Extra = STy->getNumElements()-1; // 1 will be added below.
if (Attrs.hasAttributes())
for (unsigned I = 0; I < Extra; ++I)
- PAL.push_back(llvm::AttributeWithIndex::get(Index + I,
- llvm::Attribute::get(getLLVMContext(),
- Attrs)));
+ PAL.push_back(llvm::AttributeSet::get(getLLVMContext(), Index + I,
+ Attrs));
Index += Extra;
}
break;
@@ -1134,16 +1127,14 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI,
}
if (Attrs.hasAttributes())
- PAL.push_back(llvm::AttributeWithIndex::get(Index,
- llvm::Attribute::get(getLLVMContext(),
- Attrs)));
+ PAL.push_back(llvm::AttributeSet::get(getLLVMContext(), Index, Attrs));
++Index;
}
if (FuncAttrs.hasAttributes())
PAL.push_back(llvm::
- AttributeWithIndex::get(llvm::AttributeSet::FunctionIndex,
- llvm::Attribute::get(getLLVMContext(),
- FuncAttrs)));
+ AttributeSet::get(getLLVMContext(),
+ llvm::AttributeSet::FunctionIndex,
+ FuncAttrs));
}
/// An argument came in as a promoted argument; demote it back to its
OpenPOWER on IntegriCloud