]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/include/llvm/IR/Attributes.h
Update llvm to release_39 branch r276489, and resolve conflicts.
[FreeBSD/FreeBSD.git] / contrib / llvm / include / llvm / IR / Attributes.h
1 //===-- llvm/Attributes.h - Container for Attributes ------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 ///
10 /// \file
11 /// \brief This file contains the simple types necessary to represent the
12 /// attributes associated with functions and their calls.
13 ///
14 //===----------------------------------------------------------------------===//
15
16 #ifndef LLVM_IR_ATTRIBUTES_H
17 #define LLVM_IR_ATTRIBUTES_H
18
19 #include "llvm/ADT/ArrayRef.h"
20 #include "llvm/ADT/FoldingSet.h"
21 #include "llvm/ADT/Optional.h"
22 #include "llvm/Support/Compiler.h"
23 #include "llvm/Support/PointerLikeTypeTraits.h"
24 #include "llvm-c/Types.h"
25 #include <bitset>
26 #include <cassert>
27 #include <map>
28 #include <string>
29
30 namespace llvm {
31
32 class AttrBuilder;
33 class AttributeImpl;
34 class AttributeSetImpl;
35 class AttributeSetNode;
36 class Constant;
37 template<typename T> struct DenseMapInfo;
38 class Function;
39 class LLVMContext;
40 class Type;
41
42 //===----------------------------------------------------------------------===//
43 /// \class
44 /// \brief Functions, function parameters, and return types can have attributes
45 /// to indicate how they should be treated by optimizations and code
46 /// generation. This class represents one of those attributes. It's light-weight
47 /// and should be passed around by-value.
48 class Attribute {
49 public:
50   /// This enumeration lists the attributes that can be associated with
51   /// parameters, function results, or the function itself.
52   ///
53   /// Note: The `uwtable' attribute is about the ABI or the user mandating an
54   /// entry in the unwind table. The `nounwind' attribute is about an exception
55   /// passing by the function.
56   ///
57   /// In a theoretical system that uses tables for profiling and SjLj for
58   /// exceptions, they would be fully independent. In a normal system that uses
59   /// tables for both, the semantics are:
60   ///
61   /// nil                = Needs an entry because an exception might pass by.
62   /// nounwind           = No need for an entry
63   /// uwtable            = Needs an entry because the ABI says so and because
64   ///                      an exception might pass by.
65   /// uwtable + nounwind = Needs an entry because the ABI says so.
66
67   enum AttrKind {
68     // IR-Level Attributes
69     None,                  ///< No attributes have been set
70     #define GET_ATTR_ENUM
71     #include "llvm/IR/Attributes.inc"
72     EndAttrKinds           ///< Sentinal value useful for loops
73   };
74
75 private:
76   AttributeImpl *pImpl;
77   Attribute(AttributeImpl *A) : pImpl(A) {}
78
79 public:
80   Attribute() : pImpl(nullptr) {}
81
82   //===--------------------------------------------------------------------===//
83   // Attribute Construction
84   //===--------------------------------------------------------------------===//
85
86   /// \brief Return a uniquified Attribute object.
87   static Attribute get(LLVMContext &Context, AttrKind Kind, uint64_t Val = 0);
88   static Attribute get(LLVMContext &Context, StringRef Kind,
89                        StringRef Val = StringRef());
90
91   /// \brief Return a uniquified Attribute object that has the specific
92   /// alignment set.
93   static Attribute getWithAlignment(LLVMContext &Context, uint64_t Align);
94   static Attribute getWithStackAlignment(LLVMContext &Context, uint64_t Align);
95   static Attribute getWithDereferenceableBytes(LLVMContext &Context,
96                                               uint64_t Bytes);
97   static Attribute getWithDereferenceableOrNullBytes(LLVMContext &Context,
98                                                      uint64_t Bytes);
99   static Attribute getWithAllocSizeArgs(LLVMContext &Context,
100                                         unsigned ElemSizeArg,
101                                         const Optional<unsigned> &NumElemsArg);
102
103   //===--------------------------------------------------------------------===//
104   // Attribute Accessors
105   //===--------------------------------------------------------------------===//
106
107   /// \brief Return true if the attribute is an Attribute::AttrKind type.
108   bool isEnumAttribute() const;
109
110   /// \brief Return true if the attribute is an integer attribute.
111   bool isIntAttribute() const;
112
113   /// \brief Return true if the attribute is a string (target-dependent)
114   /// attribute.
115   bool isStringAttribute() const;
116
117   /// \brief Return true if the attribute is present.
118   bool hasAttribute(AttrKind Val) const;
119
120   /// \brief Return true if the target-dependent attribute is present.
121   bool hasAttribute(StringRef Val) const;
122
123   /// \brief Return the attribute's kind as an enum (Attribute::AttrKind). This
124   /// requires the attribute to be an enum or integer attribute.
125   Attribute::AttrKind getKindAsEnum() const;
126
127   /// \brief Return the attribute's value as an integer. This requires that the
128   /// attribute be an integer attribute.
129   uint64_t getValueAsInt() const;
130
131   /// \brief Return the attribute's kind as a string. This requires the
132   /// attribute to be a string attribute.
133   StringRef getKindAsString() const;
134
135   /// \brief Return the attribute's value as a string. This requires the
136   /// attribute to be a string attribute.
137   StringRef getValueAsString() const;
138
139   /// \brief Returns the alignment field of an attribute as a byte alignment
140   /// value.
141   unsigned getAlignment() const;
142
143   /// \brief Returns the stack alignment field of an attribute as a byte
144   /// alignment value.
145   unsigned getStackAlignment() const;
146
147   /// \brief Returns the number of dereferenceable bytes from the
148   /// dereferenceable attribute.
149   uint64_t getDereferenceableBytes() const;
150
151   /// \brief Returns the number of dereferenceable_or_null bytes from the
152   /// dereferenceable_or_null attribute.
153   uint64_t getDereferenceableOrNullBytes() const;
154
155   /// Returns the argument numbers for the allocsize attribute (or pair(0, 0)
156   /// if not known).
157   std::pair<unsigned, Optional<unsigned>> getAllocSizeArgs() const;
158
159   /// \brief The Attribute is converted to a string of equivalent mnemonic. This
160   /// is, presumably, for writing out the mnemonics for the assembly writer.
161   std::string getAsString(bool InAttrGrp = false) const;
162
163   /// \brief Equality and non-equality operators.
164   bool operator==(Attribute A) const { return pImpl == A.pImpl; }
165   bool operator!=(Attribute A) const { return pImpl != A.pImpl; }
166
167   /// \brief Less-than operator. Useful for sorting the attributes list.
168   bool operator<(Attribute A) const;
169
170   void Profile(FoldingSetNodeID &ID) const {
171     ID.AddPointer(pImpl);
172   }
173
174   /// \brief Return a raw pointer that uniquely identifies this attribute.
175   void *getRawPointer() const {
176     return pImpl;
177   }
178
179   /// \brief Get an attribute from a raw pointer created by getRawPointer.
180   static Attribute fromRawPointer(void *RawPtr) {
181     return Attribute(reinterpret_cast<AttributeImpl*>(RawPtr));
182   }
183 };
184
185 // Specialized opaque value conversions.
186 inline LLVMAttributeRef wrap(Attribute Attr) {
187   return reinterpret_cast<LLVMAttributeRef>(Attr.getRawPointer());
188 }
189
190 // Specialized opaque value conversions.
191 inline Attribute unwrap(LLVMAttributeRef Attr) {
192   return Attribute::fromRawPointer(Attr);
193 }
194
195 //===----------------------------------------------------------------------===//
196 /// \class
197 /// \brief This class holds the attributes for a function, its return value, and
198 /// its parameters. You access the attributes for each of them via an index into
199 /// the AttributeSet object. The function attributes are at index
200 /// `AttributeSet::FunctionIndex', the return value is at index
201 /// `AttributeSet::ReturnIndex', and the attributes for the parameters start at
202 /// index `1'.
203 class AttributeSet {
204 public:
205   enum AttrIndex : unsigned {
206     ReturnIndex = 0U,
207     FunctionIndex = ~0U
208   };
209
210 private:
211   friend class AttrBuilder;
212   friend class AttributeSetImpl;
213   template <typename Ty> friend struct DenseMapInfo;
214
215   /// \brief The attributes that we are managing. This can be null to represent
216   /// the empty attributes list.
217   AttributeSetImpl *pImpl;
218
219   /// \brief The attributes for the specified index are returned.
220   AttributeSetNode *getAttributes(unsigned Index) const;
221
222   /// \brief Create an AttributeSet with the specified parameters in it.
223   static AttributeSet get(LLVMContext &C,
224                           ArrayRef<std::pair<unsigned, Attribute> > Attrs);
225   static AttributeSet get(LLVMContext &C,
226                           ArrayRef<std::pair<unsigned,
227                                              AttributeSetNode*> > Attrs);
228
229   static AttributeSet getImpl(LLVMContext &C,
230                               ArrayRef<std::pair<unsigned,
231                                                  AttributeSetNode*> > Attrs);
232
233   explicit AttributeSet(AttributeSetImpl *LI) : pImpl(LI) {}
234
235 public:
236   AttributeSet() : pImpl(nullptr) {}
237
238   //===--------------------------------------------------------------------===//
239   // AttributeSet Construction and Mutation
240   //===--------------------------------------------------------------------===//
241
242   /// \brief Return an AttributeSet with the specified parameters in it.
243   static AttributeSet get(LLVMContext &C, ArrayRef<AttributeSet> Attrs);
244   static AttributeSet get(LLVMContext &C, unsigned Index,
245                           ArrayRef<Attribute::AttrKind> Kinds);
246   static AttributeSet get(LLVMContext &C, unsigned Index,
247                           ArrayRef<StringRef> Kind);
248   static AttributeSet get(LLVMContext &C, unsigned Index, const AttrBuilder &B);
249
250   /// \brief Add an attribute to the attribute set at the given index. Because
251   /// attribute sets are immutable, this returns a new set.
252   AttributeSet addAttribute(LLVMContext &C, unsigned Index,
253                             Attribute::AttrKind Kind) const;
254
255   /// \brief Add an attribute to the attribute set at the given index. Because
256   /// attribute sets are immutable, this returns a new set.
257   AttributeSet addAttribute(LLVMContext &C, unsigned Index, StringRef Kind,
258                             StringRef Value = StringRef()) const;
259
260   /// Add an attribute to the attribute set at the given indices. Because
261   /// attribute sets are immutable, this returns a new set.
262   AttributeSet addAttribute(LLVMContext &C, ArrayRef<unsigned> Indices,
263                             Attribute A) const;
264
265   /// \brief Add attributes to the attribute set at the given index. Because
266   /// attribute sets are immutable, this returns a new set.
267   AttributeSet addAttributes(LLVMContext &C, unsigned Index,
268                              AttributeSet Attrs) const;
269
270   /// \brief Remove the specified attribute at the specified index from this
271   /// attribute list. Because attribute lists are immutable, this returns the
272   /// new list.
273   AttributeSet removeAttribute(LLVMContext &C, unsigned Index,
274                                Attribute::AttrKind Kind) const;
275
276   /// \brief Remove the specified attribute at the specified index from this
277   /// attribute list. Because attribute lists are immutable, this returns the
278   /// new list.
279   AttributeSet removeAttribute(LLVMContext &C, unsigned Index,
280                                StringRef Kind) const;
281
282   /// \brief Remove the specified attributes at the specified index from this
283   /// attribute list. Because attribute lists are immutable, this returns the
284   /// new list.
285   AttributeSet removeAttributes(LLVMContext &C, unsigned Index,
286                                 AttributeSet Attrs) const;
287
288   /// \brief Remove the specified attributes at the specified index from this
289   /// attribute list. Because attribute lists are immutable, this returns the
290   /// new list.
291   AttributeSet removeAttributes(LLVMContext &C, unsigned Index,
292                                 const AttrBuilder &Attrs) const;
293
294   /// \brief Add the dereferenceable attribute to the attribute set at the given
295   /// index. Because attribute sets are immutable, this returns a new set.
296   AttributeSet addDereferenceableAttr(LLVMContext &C, unsigned Index,
297                                       uint64_t Bytes) const;
298
299   /// \brief Add the dereferenceable_or_null attribute to the attribute set at
300   /// the given index. Because attribute sets are immutable, this returns a new
301   /// set.
302   AttributeSet addDereferenceableOrNullAttr(LLVMContext &C, unsigned Index,
303                                             uint64_t Bytes) const;
304
305   /// Add the allocsize attribute to the attribute set at the given index.
306   /// Because attribute sets are immutable, this returns a new set.
307   AttributeSet addAllocSizeAttr(LLVMContext &C, unsigned Index,
308                                 unsigned ElemSizeArg,
309                                 const Optional<unsigned> &NumElemsArg);
310
311   //===--------------------------------------------------------------------===//
312   // AttributeSet Accessors
313   //===--------------------------------------------------------------------===//
314
315   /// \brief Retrieve the LLVM context.
316   LLVMContext &getContext() const;
317
318   /// \brief The attributes for the specified index are returned.
319   AttributeSet getParamAttributes(unsigned Index) const;
320
321   /// \brief The attributes for the ret value are returned.
322   AttributeSet getRetAttributes() const;
323
324   /// \brief The function attributes are returned.
325   AttributeSet getFnAttributes() const;
326
327   /// \brief Return true if the attribute exists at the given index.
328   bool hasAttribute(unsigned Index, Attribute::AttrKind Kind) const;
329
330   /// \brief Return true if the attribute exists at the given index.
331   bool hasAttribute(unsigned Index, StringRef Kind) const;
332
333   /// \brief Return true if attribute exists at the given index.
334   bool hasAttributes(unsigned Index) const;
335
336   /// \brief Equivalent to hasAttribute(AttributeSet::FunctionIndex, Kind) but
337   /// may be faster.
338   bool hasFnAttribute(Attribute::AttrKind Kind) const;
339
340   /// \brief Return true if the specified attribute is set for at least one
341   /// parameter or for the return value. If Index is not nullptr, the index
342   /// of a parameter with the specified attribute is provided.
343   bool hasAttrSomewhere(Attribute::AttrKind Kind,
344                         unsigned *Index = nullptr) const;
345
346   /// \brief Return the attribute object that exists at the given index.
347   Attribute getAttribute(unsigned Index, Attribute::AttrKind Kind) const;
348
349   /// \brief Return the attribute object that exists at the given index.
350   Attribute getAttribute(unsigned Index, StringRef Kind) const;
351
352   /// \brief Return the alignment for the specified function parameter.
353   unsigned getParamAlignment(unsigned Index) const;
354
355   /// \brief Get the stack alignment.
356   unsigned getStackAlignment(unsigned Index) const;
357
358   /// \brief Get the number of dereferenceable bytes (or zero if unknown).
359   uint64_t getDereferenceableBytes(unsigned Index) const;
360
361   /// \brief Get the number of dereferenceable_or_null bytes (or zero if
362   /// unknown).
363   uint64_t getDereferenceableOrNullBytes(unsigned Index) const;
364
365   /// Get the allocsize argument numbers (or pair(0, 0) if unknown).
366   std::pair<unsigned, Optional<unsigned>>
367   getAllocSizeArgs(unsigned Index) const;
368
369   /// \brief Return the attributes at the index as a string.
370   std::string getAsString(unsigned Index, bool InAttrGrp = false) const;
371
372   typedef ArrayRef<Attribute>::iterator iterator;
373
374   iterator begin(unsigned Slot) const;
375   iterator end(unsigned Slot) const;
376
377   /// operator==/!= - Provide equality predicates.
378   bool operator==(const AttributeSet &RHS) const {
379     return pImpl == RHS.pImpl;
380   }
381   bool operator!=(const AttributeSet &RHS) const {
382     return pImpl != RHS.pImpl;
383   }
384
385   //===--------------------------------------------------------------------===//
386   // AttributeSet Introspection
387   //===--------------------------------------------------------------------===//
388
389   // FIXME: Remove this.
390   uint64_t Raw(unsigned Index) const;
391
392   /// \brief Return a raw pointer that uniquely identifies this attribute list.
393   void *getRawPointer() const {
394     return pImpl;
395   }
396
397   /// \brief Return true if there are no attributes.
398   bool isEmpty() const {
399     return getNumSlots() == 0;
400   }
401
402   /// \brief Return the number of slots used in this attribute list.  This is
403   /// the number of arguments that have an attribute set on them (including the
404   /// function itself).
405   unsigned getNumSlots() const;
406
407   /// \brief Return the index for the given slot.
408   unsigned getSlotIndex(unsigned Slot) const;
409
410   /// \brief Return the attributes at the given slot.
411   AttributeSet getSlotAttributes(unsigned Slot) const;
412
413   void dump() const;
414 };
415
416 //===----------------------------------------------------------------------===//
417 /// \class
418 /// \brief Provide DenseMapInfo for AttributeSet.
419 template<> struct DenseMapInfo<AttributeSet> {
420   static inline AttributeSet getEmptyKey() {
421     uintptr_t Val = static_cast<uintptr_t>(-1);
422     Val <<= PointerLikeTypeTraits<void*>::NumLowBitsAvailable;
423     return AttributeSet(reinterpret_cast<AttributeSetImpl*>(Val));
424   }
425   static inline AttributeSet getTombstoneKey() {
426     uintptr_t Val = static_cast<uintptr_t>(-2);
427     Val <<= PointerLikeTypeTraits<void*>::NumLowBitsAvailable;
428     return AttributeSet(reinterpret_cast<AttributeSetImpl*>(Val));
429   }
430   static unsigned getHashValue(AttributeSet AS) {
431     return (unsigned((uintptr_t)AS.pImpl) >> 4) ^
432            (unsigned((uintptr_t)AS.pImpl) >> 9);
433   }
434   static bool isEqual(AttributeSet LHS, AttributeSet RHS) { return LHS == RHS; }
435 };
436
437 //===----------------------------------------------------------------------===//
438 /// \class
439 /// \brief This class is used in conjunction with the Attribute::get method to
440 /// create an Attribute object. The object itself is uniquified. The Builder's
441 /// value, however, is not. So this can be used as a quick way to test for
442 /// equality, presence of attributes, etc.
443 class AttrBuilder {
444   std::bitset<Attribute::EndAttrKinds> Attrs;
445   std::map<std::string, std::string> TargetDepAttrs;
446   uint64_t Alignment;
447   uint64_t StackAlignment;
448   uint64_t DerefBytes;
449   uint64_t DerefOrNullBytes;
450   uint64_t AllocSizeArgs;
451
452 public:
453   AttrBuilder()
454       : Attrs(0), Alignment(0), StackAlignment(0), DerefBytes(0),
455         DerefOrNullBytes(0), AllocSizeArgs(0) {}
456   explicit AttrBuilder(uint64_t Val)
457       : Attrs(0), Alignment(0), StackAlignment(0), DerefBytes(0),
458         DerefOrNullBytes(0), AllocSizeArgs(0) {
459     addRawValue(Val);
460   }
461   AttrBuilder(const Attribute &A)
462       : Attrs(0), Alignment(0), StackAlignment(0), DerefBytes(0),
463         DerefOrNullBytes(0), AllocSizeArgs(0) {
464     addAttribute(A);
465   }
466   AttrBuilder(AttributeSet AS, unsigned Idx);
467
468   void clear();
469
470   /// \brief Add an attribute to the builder.
471   AttrBuilder &addAttribute(Attribute::AttrKind Val);
472
473   /// \brief Add the Attribute object to the builder.
474   AttrBuilder &addAttribute(Attribute A);
475
476   /// \brief Add the target-dependent attribute to the builder.
477   AttrBuilder &addAttribute(StringRef A, StringRef V = StringRef());
478
479   /// \brief Remove an attribute from the builder.
480   AttrBuilder &removeAttribute(Attribute::AttrKind Val);
481
482   /// \brief Remove the attributes from the builder.
483   AttrBuilder &removeAttributes(AttributeSet A, uint64_t Index);
484
485   /// \brief Remove the target-dependent attribute to the builder.
486   AttrBuilder &removeAttribute(StringRef A);
487
488   /// \brief Add the attributes from the builder.
489   AttrBuilder &merge(const AttrBuilder &B);
490
491   /// \brief Remove the attributes from the builder.
492   AttrBuilder &remove(const AttrBuilder &B);
493
494   /// \brief Return true if the builder has any attribute that's in the
495   /// specified builder.
496   bool overlaps(const AttrBuilder &B) const;
497
498   /// \brief Return true if the builder has the specified attribute.
499   bool contains(Attribute::AttrKind A) const {
500     assert((unsigned)A < Attribute::EndAttrKinds && "Attribute out of range!");
501     return Attrs[A];
502   }
503
504   /// \brief Return true if the builder has the specified target-dependent
505   /// attribute.
506   bool contains(StringRef A) const;
507
508   /// \brief Return true if the builder has IR-level attributes.
509   bool hasAttributes() const;
510
511   /// \brief Return true if the builder has any attribute that's in the
512   /// specified attribute.
513   bool hasAttributes(AttributeSet A, uint64_t Index) const;
514
515   /// \brief Return true if the builder has an alignment attribute.
516   bool hasAlignmentAttr() const;
517
518   /// \brief Retrieve the alignment attribute, if it exists.
519   uint64_t getAlignment() const { return Alignment; }
520
521   /// \brief Retrieve the stack alignment attribute, if it exists.
522   uint64_t getStackAlignment() const { return StackAlignment; }
523
524   /// \brief Retrieve the number of dereferenceable bytes, if the
525   /// dereferenceable attribute exists (zero is returned otherwise).
526   uint64_t getDereferenceableBytes() const { return DerefBytes; }
527
528   /// \brief Retrieve the number of dereferenceable_or_null bytes, if the
529   /// dereferenceable_or_null attribute exists (zero is returned otherwise).
530   uint64_t getDereferenceableOrNullBytes() const { return DerefOrNullBytes; }
531
532   /// Retrieve the allocsize args, if the allocsize attribute exists.  If it
533   /// doesn't exist, pair(0, 0) is returned.
534   std::pair<unsigned, Optional<unsigned>> getAllocSizeArgs() const;
535
536   /// \brief This turns an int alignment (which must be a power of 2) into the
537   /// form used internally in Attribute.
538   AttrBuilder &addAlignmentAttr(unsigned Align);
539
540   /// \brief This turns an int stack alignment (which must be a power of 2) into
541   /// the form used internally in Attribute.
542   AttrBuilder &addStackAlignmentAttr(unsigned Align);
543
544   /// \brief This turns the number of dereferenceable bytes into the form used
545   /// internally in Attribute.
546   AttrBuilder &addDereferenceableAttr(uint64_t Bytes);
547
548   /// \brief This turns the number of dereferenceable_or_null bytes into the
549   /// form used internally in Attribute.
550   AttrBuilder &addDereferenceableOrNullAttr(uint64_t Bytes);
551
552   /// This turns one (or two) ints into the form used internally in Attribute.
553   AttrBuilder &addAllocSizeAttr(unsigned ElemSizeArg,
554                                 const Optional<unsigned> &NumElemsArg);
555
556   /// Add an allocsize attribute, using the representation returned by
557   /// Attribute.getIntValue().
558   AttrBuilder &addAllocSizeAttrFromRawRepr(uint64_t RawAllocSizeRepr);
559
560   /// \brief Return true if the builder contains no target-independent
561   /// attributes.
562   bool empty() const { return Attrs.none(); }
563
564   // Iterators for target-dependent attributes.
565   typedef std::pair<std::string, std::string>                td_type;
566   typedef std::map<std::string, std::string>::iterator       td_iterator;
567   typedef std::map<std::string, std::string>::const_iterator td_const_iterator;
568   typedef llvm::iterator_range<td_iterator>                  td_range;
569   typedef llvm::iterator_range<td_const_iterator>            td_const_range;
570
571   td_iterator td_begin()             { return TargetDepAttrs.begin(); }
572   td_iterator td_end()               { return TargetDepAttrs.end(); }
573
574   td_const_iterator td_begin() const { return TargetDepAttrs.begin(); }
575   td_const_iterator td_end() const   { return TargetDepAttrs.end(); }
576
577   td_range td_attrs() { return td_range(td_begin(), td_end()); }
578   td_const_range td_attrs() const {
579     return td_const_range(td_begin(), td_end());
580   }
581
582   bool td_empty() const              { return TargetDepAttrs.empty(); }
583
584   bool operator==(const AttrBuilder &B);
585   bool operator!=(const AttrBuilder &B) {
586     return !(*this == B);
587   }
588
589   // FIXME: Remove this in 4.0.
590
591   /// \brief Add the raw value to the internal representation.
592   AttrBuilder &addRawValue(uint64_t Val);
593 };
594
595 namespace AttributeFuncs {
596
597 /// \brief Which attributes cannot be applied to a type.
598 AttrBuilder typeIncompatible(Type *Ty);
599
600 /// \returns Return true if the two functions have compatible target-independent
601 /// attributes for inlining purposes.
602 bool areInlineCompatible(const Function &Caller, const Function &Callee);
603
604 /// \brief Merge caller's and callee's attributes.
605 void mergeAttributesForInlining(Function &Caller, const Function &Callee);
606
607 } // end AttributeFuncs namespace
608
609 } // end llvm namespace
610
611 #endif