LLVM  mainline
Attributes.h
Go to the documentation of this file.
00001 //===-- llvm/Attributes.h - Container for Attributes ------------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 ///
00010 /// \file
00011 /// \brief This file contains the simple types necessary to represent the
00012 /// attributes associated with functions and their calls.
00013 ///
00014 //===----------------------------------------------------------------------===//
00015 
00016 #ifndef LLVM_IR_ATTRIBUTES_H
00017 #define LLVM_IR_ATTRIBUTES_H
00018 
00019 #include "llvm/ADT/ArrayRef.h"
00020 #include "llvm/ADT/FoldingSet.h"
00021 #include "llvm/Support/Compiler.h"
00022 #include "llvm/Support/PointerLikeTypeTraits.h"
00023 #include <bitset>
00024 #include <cassert>
00025 #include <map>
00026 #include <string>
00027 
00028 namespace llvm {
00029 
00030 class AttrBuilder;
00031 class AttributeImpl;
00032 class AttributeSetImpl;
00033 class AttributeSetNode;
00034 class Constant;
00035 template<typename T> struct DenseMapInfo;
00036 class LLVMContext;
00037 class Type;
00038 
00039 //===----------------------------------------------------------------------===//
00040 /// \class
00041 /// \brief Functions, function parameters, and return types can have attributes
00042 /// to indicate how they should be treated by optimizations and code
00043 /// generation. This class represents one of those attributes. It's light-weight
00044 /// and should be passed around by-value.
00045 class Attribute {
00046 public:
00047   /// This enumeration lists the attributes that can be associated with
00048   /// parameters, function results, or the function itself.
00049   ///
00050   /// Note: The `uwtable' attribute is about the ABI or the user mandating an
00051   /// entry in the unwind table. The `nounwind' attribute is about an exception
00052   /// passing by the function.
00053   ///
00054   /// In a theoretical system that uses tables for profiling and SjLj for
00055   /// exceptions, they would be fully independent. In a normal system that uses
00056   /// tables for both, the semantics are:
00057   ///
00058   /// nil                = Needs an entry because an exception might pass by.
00059   /// nounwind           = No need for an entry
00060   /// uwtable            = Needs an entry because the ABI says so and because
00061   ///                      an exception might pass by.
00062   /// uwtable + nounwind = Needs an entry because the ABI says so.
00063 
00064   enum AttrKind {
00065     // IR-Level Attributes
00066     None,                  ///< No attributes have been set
00067     Alignment,             ///< Alignment of parameter (5 bits)
00068                            ///< stored as log2 of alignment with +1 bias
00069                            ///< 0 means unaligned (different from align(1))
00070     AlwaysInline,          ///< inline=always
00071     Builtin,               ///< Callee is recognized as a builtin, despite
00072                            ///< nobuiltin attribute on its declaration.
00073     ByVal,                 ///< Pass structure by value
00074     InAlloca,              ///< Pass structure in an alloca
00075     Cold,                  ///< Marks function as being in a cold path.
00076     InlineHint,            ///< Source said inlining was desirable
00077     InReg,                 ///< Force argument to be passed in register
00078     JumpTable,             ///< Build jump-instruction tables and replace refs.
00079     MinSize,               ///< Function must be optimized for size first
00080     Naked,                 ///< Naked function
00081     Nest,                  ///< Nested function static chain
00082     NoAlias,               ///< Considered to not alias after call
00083     NoBuiltin,             ///< Callee isn't recognized as a builtin
00084     NoCapture,             ///< Function creates no aliases of pointer
00085     NoDuplicate,           ///< Call cannot be duplicated
00086     NoImplicitFloat,       ///< Disable implicit floating point insts
00087     NoInline,              ///< inline=never
00088     NonLazyBind,           ///< Function is called early and/or
00089                            ///< often, so lazy binding isn't worthwhile
00090     NonNull,               ///< Pointer is known to be not null
00091     Dereferenceable,       ///< Pointer is known to be dereferenceable
00092     DereferenceableOrNull, ///< Pointer is either null or dereferenceable
00093     NoRedZone,             ///< Disable redzone
00094     NoReturn,              ///< Mark the function as not returning
00095     NoUnwind,              ///< Function doesn't unwind stack
00096     OptimizeForSize,       ///< opt_size
00097     OptimizeNone,          ///< Function must not be optimized.
00098     ReadNone,              ///< Function does not access memory
00099     ReadOnly,              ///< Function only reads from memory
00100     Returned,              ///< Return value is always equal to this argument
00101     ReturnsTwice,          ///< Function can return twice
00102     SExt,                  ///< Sign extended before/after call
00103     StackAlignment,        ///< Alignment of stack for function (3 bits)
00104                            ///< stored as log2 of alignment with +1 bias 0
00105                            ///< means unaligned (different from
00106                            ///< alignstack=(1))
00107     StackProtect,          ///< Stack protection.
00108     StackProtectReq,       ///< Stack protection required.
00109     StackProtectStrong,    ///< Strong Stack protection.
00110     StructRet,             ///< Hidden pointer to structure to return
00111     SanitizeAddress,       ///< AddressSanitizer is on.
00112     SanitizeThread,        ///< ThreadSanitizer is on.
00113     SanitizeMemory,        ///< MemorySanitizer is on.
00114     UWTable,               ///< Function must be in a unwind table
00115     ZExt,                  ///< Zero extended before/after call
00116 
00117     EndAttrKinds           ///< Sentinal value useful for loops
00118   };
00119 private:
00120   AttributeImpl *pImpl;
00121   Attribute(AttributeImpl *A) : pImpl(A) {}
00122 public:
00123   Attribute() : pImpl(nullptr) {}
00124 
00125   //===--------------------------------------------------------------------===//
00126   // Attribute Construction
00127   //===--------------------------------------------------------------------===//
00128 
00129   /// \brief Return a uniquified Attribute object.
00130   static Attribute get(LLVMContext &Context, AttrKind Kind, uint64_t Val = 0);
00131   static Attribute get(LLVMContext &Context, StringRef Kind,
00132                        StringRef Val = StringRef());
00133 
00134   /// \brief Return a uniquified Attribute object that has the specific
00135   /// alignment set.
00136   static Attribute getWithAlignment(LLVMContext &Context, uint64_t Align);
00137   static Attribute getWithStackAlignment(LLVMContext &Context, uint64_t Align);
00138   static Attribute getWithDereferenceableBytes(LLVMContext &Context,
00139                                               uint64_t Bytes);
00140   static Attribute getWithDereferenceableOrNullBytes(LLVMContext &Context,
00141                                                      uint64_t Bytes);
00142 
00143   //===--------------------------------------------------------------------===//
00144   // Attribute Accessors
00145   //===--------------------------------------------------------------------===//
00146 
00147   /// \brief Return true if the attribute is an Attribute::AttrKind type.
00148   bool isEnumAttribute() const;
00149 
00150   /// \brief Return true if the attribute is an integer attribute.
00151   bool isIntAttribute() const;
00152 
00153   /// \brief Return true if the attribute is a string (target-dependent)
00154   /// attribute.
00155   bool isStringAttribute() const;
00156 
00157   /// \brief Return true if the attribute is present.
00158   bool hasAttribute(AttrKind Val) const;
00159 
00160   /// \brief Return true if the target-dependent attribute is present.
00161   bool hasAttribute(StringRef Val) const;
00162 
00163   /// \brief Return the attribute's kind as an enum (Attribute::AttrKind). This
00164   /// requires the attribute to be an enum or alignment attribute.
00165   Attribute::AttrKind getKindAsEnum() const;
00166 
00167   /// \brief Return the attribute's value as an integer. This requires that the
00168   /// attribute be an alignment attribute.
00169   uint64_t getValueAsInt() const;
00170 
00171   /// \brief Return the attribute's kind as a string. This requires the
00172   /// attribute to be a string attribute.
00173   StringRef getKindAsString() const;
00174 
00175   /// \brief Return the attribute's value as a string. This requires the
00176   /// attribute to be a string attribute.
00177   StringRef getValueAsString() const;
00178 
00179   /// \brief Returns the alignment field of an attribute as a byte alignment
00180   /// value.
00181   unsigned getAlignment() const;
00182 
00183   /// \brief Returns the stack alignment field of an attribute as a byte
00184   /// alignment value.
00185   unsigned getStackAlignment() const;
00186 
00187   /// \brief Returns the number of dereferenceable bytes from the
00188   /// dereferenceable attribute (or zero if unknown).
00189   uint64_t getDereferenceableBytes() const;
00190 
00191   /// \brief Returns the number of dereferenceable_or_null bytes from the
00192   /// dereferenceable_or_null attribute (or zero if unknown).
00193   uint64_t getDereferenceableOrNullBytes() const;
00194 
00195   /// \brief The Attribute is converted to a string of equivalent mnemonic. This
00196   /// is, presumably, for writing out the mnemonics for the assembly writer.
00197   std::string getAsString(bool InAttrGrp = false) const;
00198 
00199   /// \brief Equality and non-equality operators.
00200   bool operator==(Attribute A) const { return pImpl == A.pImpl; }
00201   bool operator!=(Attribute A) const { return pImpl != A.pImpl; }
00202 
00203   /// \brief Less-than operator. Useful for sorting the attributes list.
00204   bool operator<(Attribute A) const;
00205 
00206   void Profile(FoldingSetNodeID &ID) const {
00207     ID.AddPointer(pImpl);
00208   }
00209 };
00210 
00211 //===----------------------------------------------------------------------===//
00212 /// \class
00213 /// \brief This class holds the attributes for a function, its return value, and
00214 /// its parameters. You access the attributes for each of them via an index into
00215 /// the AttributeSet object. The function attributes are at index
00216 /// `AttributeSet::FunctionIndex', the return value is at index
00217 /// `AttributeSet::ReturnIndex', and the attributes for the parameters start at
00218 /// index `1'.
00219 class AttributeSet {
00220 public:
00221   enum AttrIndex : unsigned {
00222     ReturnIndex = 0U,
00223     FunctionIndex = ~0U
00224   };
00225 private:
00226   friend class AttrBuilder;
00227   friend class AttributeSetImpl;
00228   template <typename Ty> friend struct DenseMapInfo;
00229 
00230   /// \brief The attributes that we are managing. This can be null to represent
00231   /// the empty attributes list.
00232   AttributeSetImpl *pImpl;
00233 
00234   /// \brief The attributes for the specified index are returned.
00235   AttributeSetNode *getAttributes(unsigned Index) const;
00236 
00237   /// \brief Create an AttributeSet with the specified parameters in it.
00238   static AttributeSet get(LLVMContext &C,
00239                           ArrayRef<std::pair<unsigned, Attribute> > Attrs);
00240   static AttributeSet get(LLVMContext &C,
00241                           ArrayRef<std::pair<unsigned,
00242                                              AttributeSetNode*> > Attrs);
00243 
00244   static AttributeSet getImpl(LLVMContext &C,
00245                               ArrayRef<std::pair<unsigned,
00246                                                  AttributeSetNode*> > Attrs);
00247 
00248 
00249   explicit AttributeSet(AttributeSetImpl *LI) : pImpl(LI) {}
00250 public:
00251   AttributeSet() : pImpl(nullptr) {}
00252 
00253   //===--------------------------------------------------------------------===//
00254   // AttributeSet Construction and Mutation
00255   //===--------------------------------------------------------------------===//
00256 
00257   /// \brief Return an AttributeSet with the specified parameters in it.
00258   static AttributeSet get(LLVMContext &C, ArrayRef<AttributeSet> Attrs);
00259   static AttributeSet get(LLVMContext &C, unsigned Index,
00260                           ArrayRef<Attribute::AttrKind> Kind);
00261   static AttributeSet get(LLVMContext &C, unsigned Index, const AttrBuilder &B);
00262 
00263   /// \brief Add an attribute to the attribute set at the given index. Since
00264   /// attribute sets are immutable, this returns a new set.
00265   AttributeSet addAttribute(LLVMContext &C, unsigned Index,
00266                             Attribute::AttrKind Attr) const;
00267 
00268   /// \brief Add an attribute to the attribute set at the given index. Since
00269   /// attribute sets are immutable, this returns a new set.
00270   AttributeSet addAttribute(LLVMContext &C, unsigned Index,
00271                             StringRef Kind) const;
00272   AttributeSet addAttribute(LLVMContext &C, unsigned Index,
00273                             StringRef Kind, StringRef Value) const;
00274 
00275   /// \brief Add attributes to the attribute set at the given index. Since
00276   /// attribute sets are immutable, this returns a new set.
00277   AttributeSet addAttributes(LLVMContext &C, unsigned Index,
00278                              AttributeSet Attrs) const;
00279 
00280   /// \brief Remove the specified attribute at the specified index from this
00281   /// attribute list. Since attribute lists are immutable, this returns the new
00282   /// list.
00283   AttributeSet removeAttribute(LLVMContext &C, unsigned Index, 
00284                                Attribute::AttrKind Attr) const;
00285 
00286   /// \brief Remove the specified attributes at the specified index from this
00287   /// attribute list. Since attribute lists are immutable, this returns the new
00288   /// list.
00289   AttributeSet removeAttributes(LLVMContext &C, unsigned Index, 
00290                                 AttributeSet Attrs) const;
00291 
00292   /// \brief Add the dereferenceable attribute to the attribute set at the given
00293   /// index. Since attribute sets are immutable, this returns a new set.
00294   AttributeSet addDereferenceableAttr(LLVMContext &C, unsigned Index,
00295                                       uint64_t Bytes) const;
00296 
00297   /// \brief Add the dereferenceable_or_null attribute to the attribute set at
00298   /// the given index. Since attribute sets are immutable, this returns a new
00299   /// set.
00300   AttributeSet addDereferenceableOrNullAttr(LLVMContext &C, unsigned Index,
00301                                             uint64_t Bytes) const;
00302 
00303   //===--------------------------------------------------------------------===//
00304   // AttributeSet Accessors
00305   //===--------------------------------------------------------------------===//
00306 
00307   /// \brief Retrieve the LLVM context.
00308   LLVMContext &getContext() const;
00309 
00310   /// \brief The attributes for the specified index are returned.
00311   AttributeSet getParamAttributes(unsigned Index) const;
00312 
00313   /// \brief The attributes for the ret value are returned.
00314   AttributeSet getRetAttributes() const;
00315 
00316   /// \brief The function attributes are returned.
00317   AttributeSet getFnAttributes() const;
00318 
00319   /// \brief Return true if the attribute exists at the given index.
00320   bool hasAttribute(unsigned Index, Attribute::AttrKind Kind) const;
00321 
00322   /// \brief Return true if the attribute exists at the given index.
00323   bool hasAttribute(unsigned Index, StringRef Kind) const;
00324 
00325   /// \brief Return true if attribute exists at the given index.
00326   bool hasAttributes(unsigned Index) const;
00327 
00328   /// \brief Return true if the specified attribute is set for at least one
00329   /// parameter or for the return value.
00330   bool hasAttrSomewhere(Attribute::AttrKind Attr) const;
00331 
00332   /// \brief Return the attribute object that exists at the given index.
00333   Attribute getAttribute(unsigned Index, Attribute::AttrKind Kind) const;
00334 
00335   /// \brief Return the attribute object that exists at the given index.
00336   Attribute getAttribute(unsigned Index, StringRef Kind) const;
00337 
00338   /// \brief Return the alignment for the specified function parameter.
00339   unsigned getParamAlignment(unsigned Index) const;
00340 
00341   /// \brief Get the stack alignment.
00342   unsigned getStackAlignment(unsigned Index) const;
00343 
00344   /// \brief Get the number of dereferenceable bytes (or zero if unknown).
00345   uint64_t getDereferenceableBytes(unsigned Index) const;
00346 
00347   /// \brief Get the number of dereferenceable_or_null bytes (or zero if
00348   /// unknown).
00349   uint64_t getDereferenceableOrNullBytes(unsigned Index) const;
00350 
00351   /// \brief Return the attributes at the index as a string.
00352   std::string getAsString(unsigned Index, bool InAttrGrp = false) const;
00353 
00354   typedef ArrayRef<Attribute>::iterator iterator;
00355 
00356   iterator begin(unsigned Slot) const;
00357   iterator end(unsigned Slot) const;
00358 
00359   /// operator==/!= - Provide equality predicates.
00360   bool operator==(const AttributeSet &RHS) const {
00361     return pImpl == RHS.pImpl;
00362   }
00363   bool operator!=(const AttributeSet &RHS) const {
00364     return pImpl != RHS.pImpl;
00365   }
00366 
00367   //===--------------------------------------------------------------------===//
00368   // AttributeSet Introspection
00369   //===--------------------------------------------------------------------===//
00370 
00371   // FIXME: Remove this.
00372   uint64_t Raw(unsigned Index) const;
00373 
00374   /// \brief Return a raw pointer that uniquely identifies this attribute list.
00375   void *getRawPointer() const {
00376     return pImpl;
00377   }
00378 
00379   /// \brief Return true if there are no attributes.
00380   bool isEmpty() const {
00381     return getNumSlots() == 0;
00382   }
00383 
00384   /// \brief Return the number of slots used in this attribute list.  This is
00385   /// the number of arguments that have an attribute set on them (including the
00386   /// function itself).
00387   unsigned getNumSlots() const;
00388 
00389   /// \brief Return the index for the given slot.
00390   unsigned getSlotIndex(unsigned Slot) const;
00391 
00392   /// \brief Return the attributes at the given slot.
00393   AttributeSet getSlotAttributes(unsigned Slot) const;
00394 
00395   void dump() const;
00396 };
00397 
00398 //===----------------------------------------------------------------------===//
00399 /// \class
00400 /// \brief Provide DenseMapInfo for AttributeSet.
00401 template<> struct DenseMapInfo<AttributeSet> {
00402   static inline AttributeSet getEmptyKey() {
00403     uintptr_t Val = static_cast<uintptr_t>(-1);
00404     Val <<= PointerLikeTypeTraits<void*>::NumLowBitsAvailable;
00405     return AttributeSet(reinterpret_cast<AttributeSetImpl*>(Val));
00406   }
00407   static inline AttributeSet getTombstoneKey() {
00408     uintptr_t Val = static_cast<uintptr_t>(-2);
00409     Val <<= PointerLikeTypeTraits<void*>::NumLowBitsAvailable;
00410     return AttributeSet(reinterpret_cast<AttributeSetImpl*>(Val));
00411   }
00412   static unsigned getHashValue(AttributeSet AS) {
00413     return (unsigned((uintptr_t)AS.pImpl) >> 4) ^
00414            (unsigned((uintptr_t)AS.pImpl) >> 9);
00415   }
00416   static bool isEqual(AttributeSet LHS, AttributeSet RHS) { return LHS == RHS; }
00417 };
00418 
00419 //===----------------------------------------------------------------------===//
00420 /// \class
00421 /// \brief This class is used in conjunction with the Attribute::get method to
00422 /// create an Attribute object. The object itself is uniquified. The Builder's
00423 /// value, however, is not. So this can be used as a quick way to test for
00424 /// equality, presence of attributes, etc.
00425 class AttrBuilder {
00426   std::bitset<Attribute::EndAttrKinds> Attrs;
00427   std::map<std::string, std::string> TargetDepAttrs;
00428   uint64_t Alignment;
00429   uint64_t StackAlignment;
00430   uint64_t DerefBytes;
00431   uint64_t DerefOrNullBytes;
00432 public:
00433   AttrBuilder() : Attrs(0), Alignment(0), StackAlignment(0), DerefBytes(0) {}
00434   explicit AttrBuilder(uint64_t Val)
00435     : Attrs(0), Alignment(0), StackAlignment(0), DerefBytes(0) {
00436     addRawValue(Val);
00437   }
00438   AttrBuilder(const Attribute &A)
00439     : Attrs(0), Alignment(0), StackAlignment(0), DerefBytes(0) {
00440     addAttribute(A);
00441   }
00442   AttrBuilder(AttributeSet AS, unsigned Idx);
00443 
00444   void clear();
00445 
00446   /// \brief Add an attribute to the builder.
00447   AttrBuilder &addAttribute(Attribute::AttrKind Val);
00448 
00449   /// \brief Add the Attribute object to the builder.
00450   AttrBuilder &addAttribute(Attribute A);
00451 
00452   /// \brief Add the target-dependent attribute to the builder.
00453   AttrBuilder &addAttribute(StringRef A, StringRef V = StringRef());
00454 
00455   /// \brief Remove an attribute from the builder.
00456   AttrBuilder &removeAttribute(Attribute::AttrKind Val);
00457 
00458   /// \brief Remove the attributes from the builder.
00459   AttrBuilder &removeAttributes(AttributeSet A, uint64_t Index);
00460 
00461   /// \brief Remove the target-dependent attribute to the builder.
00462   AttrBuilder &removeAttribute(StringRef A);
00463 
00464   /// \brief Add the attributes from the builder.
00465   AttrBuilder &merge(const AttrBuilder &B);
00466 
00467   /// \brief Return true if the builder has the specified attribute.
00468   bool contains(Attribute::AttrKind A) const {
00469     assert((unsigned)A < Attribute::EndAttrKinds && "Attribute out of range!");
00470     return Attrs[A];
00471   }
00472 
00473   /// \brief Return true if the builder has the specified target-dependent
00474   /// attribute.
00475   bool contains(StringRef A) const;
00476 
00477   /// \brief Return true if the builder has IR-level attributes.
00478   bool hasAttributes() const;
00479 
00480   /// \brief Return true if the builder has any attribute that's in the
00481   /// specified attribute.
00482   bool hasAttributes(AttributeSet A, uint64_t Index) const;
00483 
00484   /// \brief Return true if the builder has an alignment attribute.
00485   bool hasAlignmentAttr() const;
00486 
00487   /// \brief Retrieve the alignment attribute, if it exists.
00488   uint64_t getAlignment() const { return Alignment; }
00489 
00490   /// \brief Retrieve the stack alignment attribute, if it exists.
00491   uint64_t getStackAlignment() const { return StackAlignment; }
00492 
00493   /// \brief Retrieve the number of dereferenceable bytes, if the dereferenceable
00494   /// attribute exists (zero is returned otherwise).
00495   uint64_t getDereferenceableBytes() const { return DerefBytes; }
00496 
00497   /// \brief Retrieve the number of dereferenceable_or_null bytes, if the
00498   /// dereferenceable_or_null attribute exists (zero is returned otherwise).
00499   uint64_t getDereferenceableOrNullBytes() const { return DerefOrNullBytes; }
00500 
00501   /// \brief This turns an int alignment (which must be a power of 2) into the
00502   /// form used internally in Attribute.
00503   AttrBuilder &addAlignmentAttr(unsigned Align);
00504 
00505   /// \brief This turns an int stack alignment (which must be a power of 2) into
00506   /// the form used internally in Attribute.
00507   AttrBuilder &addStackAlignmentAttr(unsigned Align);
00508 
00509   /// \brief This turns the number of dereferenceable bytes into the form used
00510   /// internally in Attribute.
00511   AttrBuilder &addDereferenceableAttr(uint64_t Bytes);
00512 
00513   /// \brief This turns the number of dereferenceable_or_null bytes into the
00514   /// form used internally in Attribute.
00515   AttrBuilder &addDereferenceableOrNullAttr(uint64_t Bytes);
00516 
00517   /// \brief Return true if the builder contains no target-independent
00518   /// attributes.
00519   bool empty() const { return Attrs.none(); }
00520 
00521   // Iterators for target-dependent attributes.
00522   typedef std::pair<std::string, std::string>                td_type;
00523   typedef std::map<std::string, std::string>::iterator       td_iterator;
00524   typedef std::map<std::string, std::string>::const_iterator td_const_iterator;
00525   typedef llvm::iterator_range<td_iterator>                  td_range;
00526   typedef llvm::iterator_range<td_const_iterator>            td_const_range;
00527 
00528   td_iterator td_begin()             { return TargetDepAttrs.begin(); }
00529   td_iterator td_end()               { return TargetDepAttrs.end(); }
00530 
00531   td_const_iterator td_begin() const { return TargetDepAttrs.begin(); }
00532   td_const_iterator td_end() const   { return TargetDepAttrs.end(); }
00533 
00534   td_range td_attrs() { return td_range(td_begin(), td_end()); }
00535   td_const_range td_attrs() const {
00536     return td_const_range(td_begin(), td_end());
00537   }
00538 
00539   bool td_empty() const              { return TargetDepAttrs.empty(); }
00540 
00541   bool operator==(const AttrBuilder &B);
00542   bool operator!=(const AttrBuilder &B) {
00543     return !(*this == B);
00544   }
00545 
00546   // FIXME: Remove this in 4.0.
00547 
00548   /// \brief Add the raw value to the internal representation.
00549   AttrBuilder &addRawValue(uint64_t Val);
00550 };
00551 
00552 namespace AttributeFuncs {
00553 
00554 /// \brief Which attributes cannot be applied to a type.
00555 AttributeSet typeIncompatible(Type *Ty, uint64_t Index);
00556 
00557 } // end AttributeFuncs namespace
00558 
00559 } // end llvm namespace
00560 
00561 #endif