summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Attributes.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-01-07 08:24:35 +0000
committerBill Wendling <isanbard@gmail.com>2013-01-07 08:24:35 +0000
commit096f544edcda393fabc345553a358c0970c58a0b (patch)
tree412bd719c42705091800cb710a765681b65ecf3b /llvm/lib/IR/Attributes.cpp
parent8de8364753af002d97981cfd6918913d25e0118d (diff)
downloadbcm5719-llvm-096f544edcda393fabc345553a358c0970c58a0b.tar.gz
bcm5719-llvm-096f544edcda393fabc345553a358c0970c58a0b.zip
Rough out a new c'tor for the AttrBuilder class.
This c'tor takes the AttributeSet class as the parameter. It will eventually grab the attributes from the specified index and create a new attribute builder with those attributes. llvm-svn: 171712
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r--llvm/lib/IR/Attributes.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp
index 117b510288b..bef7a6c1749 100644
--- a/llvm/lib/IR/Attributes.cpp
+++ b/llvm/lib/IR/Attributes.cpp
@@ -241,6 +241,26 @@ std::string Attribute::getAsString() const {
// AttrBuilder Method Implementations
//===----------------------------------------------------------------------===//
+AttrBuilder::AttrBuilder(AttributeSet AS, unsigned Idx)
+ : Alignment(0), StackAlignment(0) {
+ AttributeSetImpl *pImpl = AS.AttrList;
+ if (!pImpl) return;
+
+ ArrayRef<AttributeWithIndex> AttrList = pImpl->getAttributes();
+ const AttributeWithIndex *AWI = 0;
+ for (unsigned I = 0, E = AttrList.size(); I != E; ++I)
+ if (AttrList[I].Index == Idx) {
+ AWI = &AttrList[I];
+ break;
+ }
+
+ assert(AWI && "Cannot find index in attribute set!");
+
+ /// FIXME: This will be modified in the future. Basically, the
+ /// AttributeWithIndex class will contain the
+
+}
+
void AttrBuilder::clear() {
Attrs.clear();
Alignment = StackAlignment = 0;
OpenPOWER on IntegriCloud