Attributes.h revision 0e9d5d059c4aa959e9ef4dff011dbd38d45a1016
15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//===-- llvm/Attributes.h - Container for Attributes ------------*- C++ -*-===// 25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// 35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// The LLVM Compiler Infrastructure 45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// 52a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// This file is distributed under the University of Illinois Open Source 62a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)// License. See LICENSE.TXT for details. 7a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// 85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)//===----------------------------------------------------------------------===// 95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/// 105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/// \file 115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/// \brief This file contains the simple types necessary to represent the 12a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)/// attributes associated with functions and their calls. 13a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)/// 14a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)//===----------------------------------------------------------------------===// 152a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef LLVM_IR_ATTRIBUTES_H 175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define LLVM_IR_ATTRIBUTES_H 185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "llvm/ADT/ArrayRef.h" 20a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#include "llvm/ADT/DenseSet.h" 215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "llvm/ADT/FoldingSet.h" 225d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include <cassert> 235d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include <map> 245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <string> 255d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace llvm { 275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 282a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class AttrBuilder; 295d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class AttributeImpl; 305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class AttributeSetImpl; 315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class AttributeSetNode; 32class Constant; 33class LLVMContext; 34class Type; 35 36//===----------------------------------------------------------------------===// 37/// \class 38/// \brief Functions, function parameters, and return types can have attributes 39/// to indicate how they should be treated by optimizations and code 40/// generation. This class represents one of those attributes. It's light-weight 41/// and should be passed around by-value. 42class Attribute { 43public: 44 /// This enumeration lists the attributes that can be associated with 45 /// parameters, function results, or the function itself. 46 /// 47 /// Note: The `uwtable' attribute is about the ABI or the user mandating an 48 /// entry in the unwind table. The `nounwind' attribute is about an exception 49 /// passing by the function. 50 /// 51 /// In a theoretical system that uses tables for profiling and SjLj for 52 /// exceptions, they would be fully independent. In a normal system that uses 53 /// tables for both, the semantics are: 54 /// 55 /// nil = Needs an entry because an exception might pass by. 56 /// nounwind = No need for an entry 57 /// uwtable = Needs an entry because the ABI says so and because 58 /// an exception might pass by. 59 /// uwtable + nounwind = Needs an entry because the ABI says so. 60 61 enum AttrKind { 62 // IR-Level Attributes 63 None, ///< No attributes have been set 64 AddressSafety, ///< Address safety checking is on. 65 Alignment, ///< Alignment of parameter (5 bits) 66 ///< stored as log2 of alignment with +1 bias 67 ///< 0 means unaligned (different from align(1)) 68 AlwaysInline, ///< inline=always 69 ByVal, ///< Pass structure by value 70 InlineHint, ///< Source said inlining was desirable 71 InReg, ///< Force argument to be passed in register 72 MinSize, ///< Function must be optimized for size first 73 Naked, ///< Naked function 74 Nest, ///< Nested function static chain 75 NoAlias, ///< Considered to not alias after call 76 NoCapture, ///< Function creates no aliases of pointer 77 NoDuplicate, ///< Call cannot be duplicated 78 NoImplicitFloat, ///< Disable implicit floating point insts 79 NoInline, ///< inline=never 80 NonLazyBind, ///< Function is called early and/or 81 ///< often, so lazy binding isn't worthwhile 82 NoRedZone, ///< Disable redzone 83 NoReturn, ///< Mark the function as not returning 84 NoUnwind, ///< Function doesn't unwind stack 85 OptimizeForSize, ///< opt_size 86 ReadNone, ///< Function does not access memory 87 ReadOnly, ///< Function only reads from memory 88 ReturnsTwice, ///< Function can return twice 89 SExt, ///< Sign extended before/after call 90 StackAlignment, ///< Alignment of stack for function (3 bits) 91 ///< stored as log2 of alignment with +1 bias 0 92 ///< means unaligned (different from 93 ///< alignstack=(1)) 94 StackProtect, ///< Stack protection. 95 StackProtectReq, ///< Stack protection required. 96 StackProtectStrong, ///< Strong Stack protection. 97 StructRet, ///< Hidden pointer to structure to return 98 ThreadSafety, ///< Thread safety checking is on. 99 UninitializedChecks, ///< Checking for uses of uninitialized memory is on. 100 UWTable, ///< Function must be in a unwind table 101 ZExt, ///< Zero extended before/after call 102 103 EndAttrKinds, ///< Sentinal value useful for loops 104 105 AttrKindEmptyKey, ///< Empty key value for DenseMapInfo 106 AttrKindTombstoneKey ///< Tombstone key value for DenseMapInfo 107 }; 108private: 109 AttributeImpl *pImpl; 110 Attribute(AttributeImpl *A) : pImpl(A) {} 111public: 112 Attribute() : pImpl(0) {} 113 114 //===--------------------------------------------------------------------===// 115 // Attribute Construction 116 //===--------------------------------------------------------------------===// 117 118 /// \brief Return a uniquified Attribute object. 119 static Attribute get(LLVMContext &Context, AttrKind Kind, uint64_t Val = 0); 120 static Attribute get(LLVMContext &Context, StringRef Kind, 121 StringRef Val = StringRef()); 122 123 /// \brief Return a uniquified Attribute object that has the specific 124 /// alignment set. 125 static Attribute getWithAlignment(LLVMContext &Context, uint64_t Align); 126 static Attribute getWithStackAlignment(LLVMContext &Context, uint64_t Align); 127 128 //===--------------------------------------------------------------------===// 129 // Attribute Accessors 130 //===--------------------------------------------------------------------===// 131 132 /// \brief Return true if the attribute is an Attribute::AttrKind type. 133 bool isEnumAttribute() const; 134 135 /// \brief Return true if the attribute is an alignment attribute. 136 bool isAlignAttribute() const; 137 138 /// \brief Return true if the attribute is a string (target-dependent) 139 /// attribute. 140 bool isStringAttribute() const; 141 142 /// \brief Return true if the attribute is present. 143 bool hasAttribute(AttrKind Val) const; 144 145 /// \brief Return true if the target-dependent attribute is present. 146 bool hasAttribute(StringRef Val) const; 147 148 /// \brief Return the attribute's kind as an enum (Attribute::AttrKind). This 149 /// requires the attribute to be an enum or alignment attribute. 150 Attribute::AttrKind getKindAsEnum() const; 151 152 /// \brief Return the attribute's value as an integer. This requires that the 153 /// attribute be an alignment attribute. 154 uint64_t getValueAsInt() const; 155 156 /// \brief Return the attribute's kind as a string. This requires the 157 /// attribute to be a string attribute. 158 StringRef getKindAsString() const; 159 160 /// \brief Return the attribute's value as a string. This requires the 161 /// attribute to be a string attribute. 162 StringRef getValueAsString() const; 163 164 /// \brief Returns the alignment field of an attribute as a byte alignment 165 /// value. 166 unsigned getAlignment() const; 167 168 /// \brief Returns the stack alignment field of an attribute as a byte 169 /// alignment value. 170 unsigned getStackAlignment() const; 171 172 /// \brief The Attribute is converted to a string of equivalent mnemonic. This 173 /// is, presumably, for writing out the mnemonics for the assembly writer. 174 std::string getAsString(bool InAttrGrp = false) const; 175 176 /// \brief Equality and non-equality operators. 177 bool operator==(Attribute A) const { return pImpl == A.pImpl; } 178 bool operator!=(Attribute A) const { return pImpl != A.pImpl; } 179 180 /// \brief Less-than operator. Useful for sorting the attributes list. 181 bool operator<(Attribute A) const; 182 183 void Profile(FoldingSetNodeID &ID) const { 184 ID.AddPointer(pImpl); 185 } 186}; 187 188//===----------------------------------------------------------------------===// 189/// \class 190/// \brief Provide DenseMapInfo for Attribute::AttrKinds. This is used by 191/// AttrBuilder. 192template<> struct DenseMapInfo<Attribute::AttrKind> { 193 static inline Attribute::AttrKind getEmptyKey() { 194 return Attribute::AttrKindEmptyKey; 195 } 196 static inline Attribute::AttrKind getTombstoneKey() { 197 return Attribute::AttrKindTombstoneKey; 198 } 199 static unsigned getHashValue(const Attribute::AttrKind &Val) { 200 return Val * 37U; 201 } 202 static bool isEqual(const Attribute::AttrKind &LHS, 203 const Attribute::AttrKind &RHS) { 204 return LHS == RHS; 205 } 206}; 207 208//===----------------------------------------------------------------------===// 209/// \class 210/// \brief This class holds the attributes for a function, its return value, and 211/// its parameters. You access the attributes for each of them via an index into 212/// the AttributeSet object. The function attributes are at index 213/// `AttributeSet::FunctionIndex', the return value is at index 214/// `AttributeSet::ReturnIndex', and the attributes for the parameters start at 215/// index `1'. 216class AttributeSet { 217public: 218 enum AttrIndex { 219 ReturnIndex = 0U, 220 FunctionIndex = ~0U 221 }; 222private: 223 friend class AttrBuilder; 224 friend class AttributeSetImpl; 225 template <typename Ty> friend struct DenseMapInfo; 226 227 /// \brief The attributes that we are managing. This can be null to represent 228 /// the empty attributes list. 229 AttributeSetImpl *pImpl; 230 231 /// \brief The attributes for the specified index are returned. 232 AttributeSetNode *getAttributes(unsigned Idx) const; 233 234 /// \brief Create an AttributeSet with the specified parameters in it. 235 static AttributeSet get(LLVMContext &C, 236 ArrayRef<std::pair<unsigned, Attribute> > Attrs); 237 static AttributeSet get(LLVMContext &C, 238 ArrayRef<std::pair<unsigned, 239 AttributeSetNode*> > Attrs); 240 241 static AttributeSet getImpl(LLVMContext &C, 242 ArrayRef<std::pair<unsigned, 243 AttributeSetNode*> > Attrs); 244 245 246 explicit AttributeSet(AttributeSetImpl *LI) : pImpl(LI) {} 247public: 248 AttributeSet() : pImpl(0) {} 249 AttributeSet(const AttributeSet &P) : pImpl(P.pImpl) {} 250 const AttributeSet &operator=(const AttributeSet &RHS) { 251 pImpl = RHS.pImpl; 252 return *this; 253 } 254 255 //===--------------------------------------------------------------------===// 256 // AttributeSet Construction and Mutation 257 //===--------------------------------------------------------------------===// 258 259 /// \brief Return an AttributeSet with the specified parameters in it. 260 static AttributeSet get(LLVMContext &C, ArrayRef<AttributeSet> Attrs); 261 static AttributeSet get(LLVMContext &C, unsigned Idx, 262 ArrayRef<Attribute::AttrKind> Kind); 263 static AttributeSet get(LLVMContext &C, unsigned Idx, AttrBuilder &B); 264 265 /// \brief Add an attribute to the attribute set at the given index. Since 266 /// attribute sets are immutable, this returns a new set. 267 AttributeSet addAttribute(LLVMContext &C, unsigned Idx, 268 Attribute::AttrKind Attr) const; 269 270 /// \brief Add attributes to the attribute set at the given index. Since 271 /// attribute sets are immutable, this returns a new set. 272 AttributeSet addAttributes(LLVMContext &C, unsigned Idx, 273 AttributeSet Attrs) const; 274 275 /// \brief Remove the specified attribute at the specified index from this 276 /// attribute list. Since attribute lists are immutable, this returns the new 277 /// list. 278 AttributeSet removeAttribute(LLVMContext &C, unsigned Idx, 279 Attribute::AttrKind Attr) const; 280 281 /// \brief Remove the specified attributes at the specified index from this 282 /// attribute list. Since attribute lists are immutable, this returns the new 283 /// list. 284 AttributeSet removeAttributes(LLVMContext &C, unsigned Idx, 285 AttributeSet Attrs) const; 286 287 //===--------------------------------------------------------------------===// 288 // AttributeSet Accessors 289 //===--------------------------------------------------------------------===// 290 291 /// \brief Retrieve the LLVM context. 292 LLVMContext &getContext() const; 293 294 /// \brief The attributes for the specified index are returned. 295 AttributeSet getParamAttributes(unsigned Idx) const; 296 297 /// \brief The attributes for the ret value are returned. 298 AttributeSet getRetAttributes() const; 299 300 /// \brief The function attributes are returned. 301 AttributeSet getFnAttributes() const; 302 303 /// \brief Return true if the attribute exists at the given index. 304 bool hasAttribute(unsigned Index, Attribute::AttrKind Kind) const; 305 306 /// \brief Return true if the attribute exists at the given index. 307 bool hasAttribute(unsigned Index, StringRef Kind) const; 308 309 /// \brief Return true if attribute exists at the given index. 310 bool hasAttributes(unsigned Index) const; 311 312 /// \brief Return true if the specified attribute is set for at least one 313 /// parameter or for the return value. 314 bool hasAttrSomewhere(Attribute::AttrKind Attr) const; 315 316 /// \brief Return the attribute object that exists at the given index. 317 Attribute getAttribute(unsigned Index, Attribute::AttrKind Kind) const; 318 319 /// \brief Return the attribute object that exists at the given index. 320 Attribute getAttribute(unsigned Index, StringRef Kind) const; 321 322 /// \brief Return the alignment for the specified function parameter. 323 unsigned getParamAlignment(unsigned Idx) const; 324 325 /// \brief Get the stack alignment. 326 unsigned getStackAlignment(unsigned Index) const; 327 328 /// \brief Return the attributes at the index as a string. 329 std::string getAsString(unsigned Index, bool InAttrGrp = false) const; 330 331 typedef ArrayRef<Attribute>::iterator iterator; 332 333 iterator begin(unsigned Idx) const; 334 iterator end(unsigned Idx) const; 335 336 /// operator==/!= - Provide equality predicates. 337 bool operator==(const AttributeSet &RHS) const { 338 return pImpl == RHS.pImpl; 339 } 340 bool operator!=(const AttributeSet &RHS) const { 341 return pImpl != RHS.pImpl; 342 } 343 344 //===--------------------------------------------------------------------===// 345 // AttributeSet Introspection 346 //===--------------------------------------------------------------------===// 347 348 // FIXME: Remove this. 349 uint64_t Raw(unsigned Index) const; 350 351 /// \brief Return a raw pointer that uniquely identifies this attribute list. 352 void *getRawPointer() const { 353 return pImpl; 354 } 355 356 /// \brief Return true if there are no attributes. 357 bool isEmpty() const { 358 return getNumSlots() == 0; 359 } 360 361 /// \brief Return the number of slots used in this attribute list. This is 362 /// the number of arguments that have an attribute set on them (including the 363 /// function itself). 364 unsigned getNumSlots() const; 365 366 /// \brief Return the index for the given slot. 367 uint64_t getSlotIndex(unsigned Slot) const; 368 369 /// \brief Return the attributes at the given slot. 370 AttributeSet getSlotAttributes(unsigned Slot) const; 371 372 void dump() const; 373}; 374 375//===----------------------------------------------------------------------===// 376/// \class 377/// \brief Provide DenseMapInfo for AttributeSet. 378template<> struct DenseMapInfo<AttributeSet> { 379 static inline AttributeSet getEmptyKey() { 380 uintptr_t Val = static_cast<uintptr_t>(-1); 381 Val <<= PointerLikeTypeTraits<void*>::NumLowBitsAvailable; 382 return AttributeSet(reinterpret_cast<AttributeSetImpl*>(Val)); 383 } 384 static inline AttributeSet getTombstoneKey() { 385 uintptr_t Val = static_cast<uintptr_t>(-2); 386 Val <<= PointerLikeTypeTraits<void*>::NumLowBitsAvailable; 387 return AttributeSet(reinterpret_cast<AttributeSetImpl*>(Val)); 388 } 389 static unsigned getHashValue(AttributeSet AS) { 390 return (unsigned((uintptr_t)AS.pImpl) >> 4) ^ 391 (unsigned((uintptr_t)AS.pImpl) >> 9); 392 } 393 static bool isEqual(AttributeSet LHS, AttributeSet RHS) { return LHS == RHS; } 394}; 395 396//===----------------------------------------------------------------------===// 397/// \class 398/// \brief This class is used in conjunction with the Attribute::get method to 399/// create an Attribute object. The object itself is uniquified. The Builder's 400/// value, however, is not. So this can be used as a quick way to test for 401/// equality, presence of attributes, etc. 402class AttrBuilder { 403 DenseSet<Attribute::AttrKind> Attrs; 404 std::map<std::string, std::string> TargetDepAttrs; 405 uint64_t Alignment; 406 uint64_t StackAlignment; 407public: 408 AttrBuilder() : Alignment(0), StackAlignment(0) {} 409 explicit AttrBuilder(uint64_t Val) : Alignment(0), StackAlignment(0) { 410 addRawValue(Val); 411 } 412 AttrBuilder(const Attribute &A) : Alignment(0), StackAlignment(0) { 413 addAttribute(A); 414 } 415 AttrBuilder(AttributeSet AS, unsigned Idx); 416 AttrBuilder(const AttrBuilder &B) 417 : Attrs(B.Attrs), 418 TargetDepAttrs(B.TargetDepAttrs.begin(), B.TargetDepAttrs.end()), 419 Alignment(B.Alignment), StackAlignment(B.StackAlignment) {} 420 421 void clear(); 422 423 /// \brief Add an attribute to the builder. 424 AttrBuilder &addAttribute(Attribute::AttrKind Val); 425 426 /// \brief Add the Attribute object to the builder. 427 AttrBuilder &addAttribute(Attribute A); 428 429 /// \brief Add the target-dependent attribute to the builder. 430 AttrBuilder &addAttribute(StringRef A, StringRef V = StringRef()); 431 432 /// \brief Remove an attribute from the builder. 433 AttrBuilder &removeAttribute(Attribute::AttrKind Val); 434 435 /// \brief Remove the attributes from the builder. 436 AttrBuilder &removeAttributes(AttributeSet A, uint64_t Index); 437 438 /// \brief Remove the target-dependent attribute to the builder. 439 AttrBuilder &removeAttribute(StringRef A); 440 441 /// \brief Add the attributes from the builder. 442 AttrBuilder &merge(const AttrBuilder &B); 443 444 /// \brief Return true if the builder has the specified attribute. 445 bool contains(Attribute::AttrKind A) const; 446 447 /// \brief Return true if the builder has the specified target-dependent 448 /// attribute. 449 bool contains(StringRef A) const; 450 451 /// \brief Return true if the builder has IR-level attributes. 452 bool hasAttributes() const; 453 454 /// \brief Return true if the builder has any attribute that's in the 455 /// specified attribute. 456 bool hasAttributes(AttributeSet A, uint64_t Index) const; 457 458 /// \brief Return true if the builder has an alignment attribute. 459 bool hasAlignmentAttr() const; 460 461 /// \brief Retrieve the alignment attribute, if it exists. 462 uint64_t getAlignment() const { return Alignment; } 463 464 /// \brief Retrieve the stack alignment attribute, if it exists. 465 uint64_t getStackAlignment() const { return StackAlignment; } 466 467 /// \brief This turns an int alignment (which must be a power of 2) into the 468 /// form used internally in Attribute. 469 AttrBuilder &addAlignmentAttr(unsigned Align); 470 471 /// \brief This turns an int stack alignment (which must be a power of 2) into 472 /// the form used internally in Attribute. 473 AttrBuilder &addStackAlignmentAttr(unsigned Align); 474 475 // Iterators for target-independent attributes. 476 typedef DenseSet<Attribute::AttrKind>::iterator iterator; 477 typedef DenseSet<Attribute::AttrKind>::const_iterator const_iterator; 478 479 iterator begin() { return Attrs.begin(); } 480 iterator end() { return Attrs.end(); } 481 482 const_iterator begin() const { return Attrs.begin(); } 483 const_iterator end() const { return Attrs.end(); } 484 485 bool empty() const { return Attrs.empty(); } 486 487 // Iterators for target-dependent attributes. 488 typedef std::pair<std::string, std::string> td_type; 489 typedef std::map<std::string, std::string>::iterator td_iterator; 490 typedef std::map<std::string, std::string>::const_iterator td_const_iterator; 491 492 td_iterator td_begin() { return TargetDepAttrs.begin(); } 493 td_iterator td_end() { return TargetDepAttrs.end(); } 494 495 td_const_iterator td_begin() const { return TargetDepAttrs.begin(); } 496 td_const_iterator td_end() const { return TargetDepAttrs.end(); } 497 498 bool td_empty() const { return TargetDepAttrs.empty(); } 499 500 /// \brief Remove attributes that are used on functions only. 501 void removeFunctionOnlyAttrs() { 502 removeAttribute(Attribute::NoReturn) 503 .removeAttribute(Attribute::NoUnwind) 504 .removeAttribute(Attribute::ReadNone) 505 .removeAttribute(Attribute::ReadOnly) 506 .removeAttribute(Attribute::NoInline) 507 .removeAttribute(Attribute::AlwaysInline) 508 .removeAttribute(Attribute::OptimizeForSize) 509 .removeAttribute(Attribute::StackProtect) 510 .removeAttribute(Attribute::StackProtectReq) 511 .removeAttribute(Attribute::StackProtectStrong) 512 .removeAttribute(Attribute::NoRedZone) 513 .removeAttribute(Attribute::NoImplicitFloat) 514 .removeAttribute(Attribute::Naked) 515 .removeAttribute(Attribute::InlineHint) 516 .removeAttribute(Attribute::StackAlignment) 517 .removeAttribute(Attribute::UWTable) 518 .removeAttribute(Attribute::NonLazyBind) 519 .removeAttribute(Attribute::ReturnsTwice) 520 .removeAttribute(Attribute::AddressSafety) 521 .removeAttribute(Attribute::ThreadSafety) 522 .removeAttribute(Attribute::UninitializedChecks) 523 .removeAttribute(Attribute::MinSize) 524 .removeAttribute(Attribute::NoDuplicate); 525 } 526 527 bool operator==(const AttrBuilder &B); 528 bool operator!=(const AttrBuilder &B) { 529 return !(*this == B); 530 } 531 532 // FIXME: Remove this in 4.0. 533 534 /// \brief Add the raw value to the internal representation. 535 AttrBuilder &addRawValue(uint64_t Val); 536}; 537 538namespace AttributeFuncs { 539 540/// \brief Which attributes cannot be applied to a type. 541AttributeSet typeIncompatible(Type *Ty, uint64_t Index); 542 543} // end AttributeFuncs namespace 544 545} // end llvm namespace 546 547#endif 548