aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/IR/Attributes.h
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-01-25 23:09:36 +0000
committerBill Wendling <isanbard@gmail.com>2013-01-25 23:09:36 +0000
commit8e47daf2858e980210f3e1f007036b24da342c29 (patch)
treec29ac046d2219e5f62bd06e74078de858fcb40a5 /include/llvm/IR/Attributes.h
parenta8b289b70d5ef416608bb71a874b8b4fe80158e1 (diff)
downloadexternal_llvm-8e47daf2858e980210f3e1f007036b24da342c29.zip
external_llvm-8e47daf2858e980210f3e1f007036b24da342c29.tar.gz
external_llvm-8e47daf2858e980210f3e1f007036b24da342c29.tar.bz2
Remove some introspection functions.
The 'getSlot' function and its ilk allow introspection into the AttributeSet class. However, that class should be opaque. Allow access through accessor methods instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173522 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/IR/Attributes.h')
-rw-r--r--include/llvm/IR/Attributes.h40
1 files changed, 26 insertions, 14 deletions
diff --git a/include/llvm/IR/Attributes.h b/include/llvm/IR/Attributes.h
index 29246f3..37d487f 100644
--- a/include/llvm/IR/Attributes.h
+++ b/include/llvm/IR/Attributes.h
@@ -146,20 +146,6 @@ public:
uint64_t Raw() const;
- /// \brief Which attributes cannot be applied to a type.
- static Attribute typeIncompatible(Type *Ty);
-
- /// \brief This returns an integer containing an encoding of all the LLVM
- /// attributes found in the given attribute bitset. Any change to this
- /// encoding is a breaking change to bitcode compatibility.
- static uint64_t encodeLLVMAttributesForBitcode(Attribute Attrs);
-
- /// \brief This returns an attribute bitset containing the LLVM attributes
- /// that have been decoded from the given integer. This function must stay in
- /// sync with 'encodeLLVMAttributesForBitcode'.
- static Attribute decodeLLVMAttributesForBitcode(LLVMContext &C,
- uint64_t EncodedAttrs);
-
/// \brief The Attribute is converted to a string of equivalent mnemonic. This
/// is, presumably, for writing out the mnemonics for the assembly writer.
std::string getAsString() const;
@@ -236,6 +222,7 @@ public:
/// \brief Return an AttributeSet with the specified parameters in it.
static AttributeSet get(LLVMContext &C, ArrayRef<AttributeWithIndex> Attrs);
+ static AttributeSet get(LLVMContext &C, ArrayRef<AttributeSet> Attrs);
static AttributeSet get(LLVMContext &C, unsigned Idx,
Attribute::AttrKind Kind);
static AttributeSet get(LLVMContext &C, unsigned Idx, AttrBuilder &B);
@@ -296,6 +283,10 @@ public:
/// \brief Return true if attribute exists at the given index.
bool hasAttributes(unsigned Index) const;
+ /// \brief Returns the alignment field of an attribute as a byte alignment
+ /// value.
+ unsigned getAlignment(unsigned Index) const;
+
/// \brief Get the stack alignment.
unsigned getStackAlignment(unsigned Index) const;
@@ -342,6 +333,9 @@ public:
/// \brief Return the index for the given slot.
unsigned getSlotIndex(unsigned Slot) const;
+ /// \brief Return the attributes at the given slot.
+ AttributeSet getSlotAttributes(unsigned Slot) const;
+
/// \brief Return the AttributeWithIndex at the specified slot. This holds a
/// index number plus a set of attributes.
const AttributeWithIndex &getSlot(unsigned Slot) const;
@@ -479,6 +473,24 @@ public:
}
};
+namespace AttributeFuncs {
+
+/// \brief Which attributes cannot be applied to a type.
+Attribute typeIncompatible(Type *Ty);
+
+/// \brief This returns an integer containing an encoding of all the LLVM
+/// attributes found in the given attribute bitset. Any change to this encoding
+/// is a breaking change to bitcode compatibility.
+uint64_t encodeLLVMAttributesForBitcode(AttributeSet Attrs, unsigned Index);
+
+/// \brief This returns an attribute bitset containing the LLVM attributes that
+/// have been decoded from the given integer. This function must stay in sync
+/// with 'encodeLLVMAttributesForBitcode'.
+Attribute decodeLLVMAttributesForBitcode(LLVMContext &C,
+ uint64_t EncodedAttrs);
+
+} // end AttributeFuncs namespace
+
} // end llvm namespace
#endif