diff options
author | Bill Wendling <isanbard@gmail.com> | 2012-12-19 07:18:57 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2012-12-19 07:18:57 +0000 |
commit | 034b94b17006f51722886b0f2283fb6fb19aca1f (patch) | |
tree | e42e091c12137e9599d0e58bfa4336c4af7333b3 /include/llvm | |
parent | 85022561f9c78446bbc5f745cd9b58f4e5dc92ec (diff) | |
download | external_llvm-034b94b17006f51722886b0f2283fb6fb19aca1f.tar.gz external_llvm-034b94b17006f51722886b0f2283fb6fb19aca1f.tar.bz2 external_llvm-034b94b17006f51722886b0f2283fb6fb19aca1f.zip |
Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170502 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Argument.h | 4 | ||||
-rw-r--r-- | include/llvm/Attributes.h | 176 | ||||
-rw-r--r-- | include/llvm/CodeGen/Analysis.h | 2 | ||||
-rw-r--r-- | include/llvm/Function.h | 50 | ||||
-rw-r--r-- | include/llvm/Instructions.h | 68 | ||||
-rw-r--r-- | include/llvm/Support/CallSite.h | 8 | ||||
-rw-r--r-- | include/llvm/Target/TargetLowering.h | 8 |
7 files changed, 158 insertions, 158 deletions
diff --git a/include/llvm/Argument.h b/include/llvm/Argument.h index dc9df34c60..e457595f8b 100644 --- a/include/llvm/Argument.h +++ b/include/llvm/Argument.h @@ -73,10 +73,10 @@ public: bool hasStructRetAttr() const; /// addAttr - Add a Attribute to an argument - void addAttr(Attributes); + void addAttr(Attribute); /// removeAttr - Remove a Attribute from an argument - void removeAttr(Attributes); + void removeAttr(Attribute); /// classof - Methods for support type inquiry through isa, cast, and /// dyn_cast: diff --git a/include/llvm/Attributes.h b/include/llvm/Attributes.h index ed18ca4c40..7c90a415d9 100644 --- a/include/llvm/Attributes.h +++ b/include/llvm/Attributes.h @@ -27,8 +27,8 @@ class AttributesImpl; class LLVMContext; class Type; -/// Attributes - A bitset of attributes. -class Attributes { +/// Attribute - A bitset of attributes. +class Attribute { public: /// Function parameters and results can have attributes to indicate how they /// should be treated by optimizations and code generation. This enumeration @@ -89,14 +89,14 @@ public: }; private: AttributesImpl *Attrs; - Attributes(AttributesImpl *A) : Attrs(A) {} + Attribute(AttributesImpl *A) : Attrs(A) {} public: - Attributes() : Attrs(0) {} + Attribute() : Attrs(0) {} - /// get - Return a uniquified Attributes object. This takes the uniquified - /// value from the Builder and wraps it in the Attributes class. - static Attributes get(LLVMContext &Context, ArrayRef<AttrVal> Vals); - static Attributes get(LLVMContext &Context, AttrBuilder &B); + /// get - Return a uniquified Attribute object. This takes the uniquified + /// value from the Builder and wraps it in the Attribute class. + static Attribute get(LLVMContext &Context, ArrayRef<AttrVal> Vals); + static Attribute get(LLVMContext &Context, AttrBuilder &B); /// @brief Return true if the attribute is present. bool hasAttribute(AttrVal Val) const; @@ -105,7 +105,7 @@ public: bool hasAttributes() const; /// @brief Return true if the attributes are a non-null intersection. - bool hasAttributes(const Attributes &A) const; + bool hasAttributes(const Attribute &A) const; /// @brief Returns the alignment field of an attribute as a byte alignment /// value. @@ -117,66 +117,66 @@ public: /// @brief Parameter attributes that do not apply to vararg call arguments. bool hasIncompatibleWithVarArgsAttrs() const { - return hasAttribute(Attributes::StructRet); + return hasAttribute(Attribute::StructRet); } - /// @brief Attributes that only apply to function parameters. + /// @brief Attribute that only apply to function parameters. bool hasParameterOnlyAttrs() const { - return hasAttribute(Attributes::ByVal) || - hasAttribute(Attributes::Nest) || - hasAttribute(Attributes::StructRet) || - hasAttribute(Attributes::NoCapture); + return hasAttribute(Attribute::ByVal) || + hasAttribute(Attribute::Nest) || + hasAttribute(Attribute::StructRet) || + hasAttribute(Attribute::NoCapture); } - /// @brief Attributes that may be applied to the function itself. These cannot + /// @brief Attribute that may be applied to the function itself. These cannot /// be used on return values or function parameters. bool hasFunctionOnlyAttrs() const { - return hasAttribute(Attributes::NoReturn) || - hasAttribute(Attributes::NoUnwind) || - hasAttribute(Attributes::ReadNone) || - hasAttribute(Attributes::ReadOnly) || - hasAttribute(Attributes::NoInline) || - hasAttribute(Attributes::AlwaysInline) || - hasAttribute(Attributes::OptimizeForSize) || - hasAttribute(Attributes::StackProtect) || - hasAttribute(Attributes::StackProtectReq) || - hasAttribute(Attributes::NoRedZone) || - hasAttribute(Attributes::NoImplicitFloat) || - hasAttribute(Attributes::Naked) || - hasAttribute(Attributes::InlineHint) || - hasAttribute(Attributes::StackAlignment) || - hasAttribute(Attributes::UWTable) || - hasAttribute(Attributes::NonLazyBind) || - hasAttribute(Attributes::ReturnsTwice) || - hasAttribute(Attributes::AddressSafety) || - hasAttribute(Attributes::MinSize); + return hasAttribute(Attribute::NoReturn) || + hasAttribute(Attribute::NoUnwind) || + hasAttribute(Attribute::ReadNone) || + hasAttribute(Attribute::ReadOnly) || + hasAttribute(Attribute::NoInline) || + hasAttribute(Attribute::AlwaysInline) || + hasAttribute(Attribute::OptimizeForSize) || + hasAttribute(Attribute::StackProtect) || + hasAttribute(Attribute::StackProtectReq) || + hasAttribute(Attribute::NoRedZone) || + hasAttribute(Attribute::NoImplicitFloat) || + hasAttribute(Attribute::Naked) || + hasAttribute(Attribute::InlineHint) || + hasAttribute(Attribute::StackAlignment) || + hasAttribute(Attribute::UWTable) || + hasAttribute(Attribute::NonLazyBind) || + hasAttribute(Attribute::ReturnsTwice) || + hasAttribute(Attribute::AddressSafety) || + hasAttribute(Attribute::MinSize); } - bool operator==(const Attributes &A) const { + bool operator==(const Attribute &A) const { return Attrs == A.Attrs; } - bool operator!=(const Attributes &A) const { + bool operator!=(const Attribute &A) const { return Attrs != A.Attrs; } uint64_t Raw() const; /// @brief Which attributes cannot be applied to a type. - static Attributes typeIncompatible(Type *Ty); + static Attribute typeIncompatible(Type *Ty); /// encodeLLVMAttributesForBitcode - 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(Attributes Attrs); + static uint64_t encodeLLVMAttributesForBitcode(Attribute Attrs); /// decodeLLVMAttributesForBitcode - 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 Attributes decodeLLVMAttributesForBitcode(LLVMContext &C, + static Attribute decodeLLVMAttributesForBitcode(LLVMContext &C, uint64_t EncodedAttrs); - /// getAsString - The set of Attributes set in Attributes is converted to a + /// getAsString - The set of attributes set in Attribute is converted to a /// string of equivalent mnemonics. This is, presumably, for writing out the /// mnemonics for the assembly writer. /// @brief Convert attribute bits to text @@ -184,8 +184,8 @@ public: }; //===----------------------------------------------------------------------===// -/// AttrBuilder - This class is used in conjunction with the Attributes::get -/// method to create an Attributes object. The object itself is uniquified. The +/// AttrBuilder - This class is used in conjunction with the Attribute::get +/// method to create an Attribute object. The object itself is uniquified. The /// Builder's value, however, is not. So this can be used as a quick way to test /// for equality, presence of attributes, etc. class AttrBuilder { @@ -193,31 +193,31 @@ class AttrBuilder { public: AttrBuilder() : Bits(0) {} explicit AttrBuilder(uint64_t B) : Bits(B) {} - AttrBuilder(const Attributes &A) : Bits(A.Raw()) {} + AttrBuilder(const Attribute &A) : Bits(A.Raw()) {} void clear() { Bits = 0; } /// addAttribute - Add an attribute to the builder. - AttrBuilder &addAttribute(Attributes::AttrVal Val); + AttrBuilder &addAttribute(Attribute::AttrVal Val); /// removeAttribute - Remove an attribute from the builder. - AttrBuilder &removeAttribute(Attributes::AttrVal Val); + AttrBuilder &removeAttribute(Attribute::AttrVal Val); /// addAttribute - Add the attributes from A to the builder. - AttrBuilder &addAttributes(const Attributes &A); + AttrBuilder &addAttributes(const Attribute &A); /// removeAttribute - Remove the attributes from A from the builder. - AttrBuilder &removeAttributes(const Attributes &A); + AttrBuilder &removeAttributes(const Attribute &A); /// hasAttribute - Return true if the builder has the specified attribute. - bool hasAttribute(Attributes::AttrVal A) const; + bool hasAttribute(Attribute::AttrVal A) const; /// hasAttributes - Return true if the builder has IR-level attributes. bool hasAttributes() const; /// hasAttributes - Return true if the builder has any attribute that's in the /// specified attribute. - bool hasAttributes(const Attributes &A) const; + bool hasAttributes(const Attribute &A) const; /// hasAlignmentAttr - Return true if the builder has an alignment attribute. bool hasAlignmentAttr() const; @@ -229,11 +229,11 @@ public: uint64_t getStackAlignment() const; /// addAlignmentAttr - This turns an int alignment (which must be a power of - /// 2) into the form used internally in Attributes. + /// 2) into the form used internally in Attribute. AttrBuilder &addAlignmentAttr(unsigned Align); /// addStackAlignmentAttr - This turns an int stack alignment (which must be a - /// power of 2) into the form used internally in Attributes. + /// power of 2) into the form used internally in Attribute. AttrBuilder &addStackAlignmentAttr(unsigned Align); /// addRawValue - Add the raw value to the internal representation. @@ -242,25 +242,25 @@ public: /// @brief Remove attributes that are used on functions only. void removeFunctionOnlyAttrs() { - removeAttribute(Attributes::NoReturn) - .removeAttribute(Attributes::NoUnwind) - .removeAttribute(Attributes::ReadNone) - .removeAttribute(Attributes::ReadOnly) - .removeAttribute(Attributes::NoInline) - .removeAttribute(Attributes::AlwaysInline) - .removeAttribute(Attributes::OptimizeForSize) - .removeAttribute(Attributes::StackProtect) - .removeAttribute(Attributes::StackProtectReq) - .removeAttribute(Attributes::NoRedZone) - .removeAttribute(Attributes::NoImplicitFloat) - .removeAttribute(Attributes::Naked) - .removeAttribute(Attributes::InlineHint) - .removeAttribute(Attributes::StackAlignment) - .removeAttribute(Attributes::UWTable) - .removeAttribute(Attributes::NonLazyBind) - .removeAttribute(Attributes::ReturnsTwice) - .removeAttribute(Attributes::AddressSafety) - .removeAttribute(Attributes::MinSize); + removeAttribute(Attribute::NoReturn) + .removeAttribute(Attribute::NoUnwind) + .removeAttribute(Attribute::ReadNone) + .removeAttribute(Attribute::ReadOnly) + .removeAttribute(Attribute::NoInline) + .removeAttribute(Attribute::AlwaysInline) + .removeAttribute(Attribute::OptimizeForSize) + .removeAttribute(Attribute::StackProtect) + .removeAttribute(Attribute::StackProtectReq) + .removeAttribute(Attribute::NoRedZone) + .removeAttribute(Attribute::NoImplicitFloat) + .removeAttribute(Attribute::Naked) + .removeAttribute(Attribute::InlineHint) + .removeAttribute(Attribute::StackAlignment) + .removeAttribute(Attribute::UWTable) + .removeAttribute(Attribute::NonLazyBind) + .removeAttribute(Attribute::ReturnsTwice) + .removeAttribute(Attribute::AddressSafety) + .removeAttribute(Attribute::MinSize); } uint64_t Raw() const { return Bits; } @@ -280,16 +280,16 @@ public: /// AttributeWithIndex - This is just a pair of values to associate a set of /// attributes with an index. struct AttributeWithIndex { - Attributes Attrs; ///< The attributes that are set, or'd together. + Attribute Attrs; ///< The attributes that are set, or'd together. unsigned Index; ///< Index of the parameter for which the attributes apply. ///< Index 0 is used for return value attributes. ///< Index ~0U is used for function attributes. static AttributeWithIndex get(LLVMContext &C, unsigned Idx, - ArrayRef<Attributes::AttrVal> Attrs) { - return get(Idx, Attributes::get(C, Attrs)); + ArrayRef<Attribute::AttrVal> Attrs) { + return get(Idx, Attribute::get(C, Attrs)); } - static AttributeWithIndex get(unsigned Idx, Attributes Attrs) { + static AttributeWithIndex get(unsigned Idx, Attribute Attrs) { AttributeWithIndex P; P.Index = Idx; P.Attrs = Attrs; @@ -318,7 +318,7 @@ private: /// @brief The attributes for the specified index are returned. Attributes /// for the result are denoted with Idx = 0. - Attributes getAttributes(unsigned Idx) const; + Attribute getAttributes(unsigned Idx) const; explicit AttributeSet(AttributeListImpl *LI) : AttrList(LI) {} public: @@ -330,42 +330,42 @@ public: // Attribute List Construction and Mutation //===--------------------------------------------------------------------===// - /// get - Return a Attributes list with the specified parameters in it. + /// get - Return an AttributeSet with the specified parameters in it. static AttributeSet get(LLVMContext &C, ArrayRef<AttributeWithIndex> Attrs); /// addAttr - Add the specified attribute at the specified index to this /// attribute list. Since attribute lists are immutable, this /// returns the new list. - AttributeSet addAttr(LLVMContext &C, unsigned Idx, Attributes Attrs) const; + AttributeSet addAttr(LLVMContext &C, unsigned Idx, Attribute Attrs) const; /// removeAttr - Remove the specified attribute at the specified index from /// this attribute list. Since attribute lists are immutable, this /// returns the new list. - AttributeSet removeAttr(LLVMContext &C, unsigned Idx, Attributes Attrs) const; + AttributeSet removeAttr(LLVMContext &C, unsigned Idx, Attribute Attrs) const; //===--------------------------------------------------------------------===// // Attribute List Accessors //===--------------------------------------------------------------------===// /// getParamAttributes - The attributes for the specified index are /// returned. - Attributes getParamAttributes(unsigned Idx) const { + Attribute getParamAttributes(unsigned Idx) const { return getAttributes(Idx); } /// getRetAttributes - The attributes for the ret value are /// returned. - Attributes getRetAttributes() const { + Attribute getRetAttributes() const { return getAttributes(ReturnIndex); } /// getFnAttributes - The function attributes are returned. - Attributes getFnAttributes() const { + Attribute getFnAttributes() const { return getAttributes(FunctionIndex); } /// paramHasAttr - Return true if the specified parameter index has the /// specified attribute set. - bool paramHasAttr(unsigned Idx, Attributes Attr) const { + bool paramHasAttr(unsigned Idx, Attribute Attr) const { return getAttributes(Idx).hasAttributes(Attr); } @@ -377,10 +377,10 @@ public: /// hasAttrSomewhere - Return true if the specified attribute is set for at /// least one parameter or for the return value. - bool hasAttrSomewhere(Attributes::AttrVal Attr) const; + bool hasAttrSomewhere(Attribute::AttrVal Attr) const; unsigned getNumAttrs() const; - Attributes &getAttributesAtIndex(unsigned i) const; + Attribute &getAttributesAtIndex(unsigned i) const; /// operator==/!= - Provide equality predicates. bool operator==(const AttributeSet &RHS) const @@ -398,9 +398,9 @@ public: return AttrList; } - // Attributes are stored as a dense set of slots, where there is one - // slot for each argument that has an attribute. This allows walking over the - // dense set instead of walking the sparse list of attributes. + // Attributes are stored as a dense set of slots, where there is one slot for + // each argument that has an attribute. This allows walking over the dense + // set instead of walking the sparse list of attributes. /// isEmpty - Return true if there are no attributes. /// diff --git a/include/llvm/CodeGen/Analysis.h b/include/llvm/CodeGen/Analysis.h index 4ff0be758a..e8e991c051 100644 --- a/include/llvm/CodeGen/Analysis.h +++ b/include/llvm/CodeGen/Analysis.h @@ -86,7 +86,7 @@ ISD::CondCode getICmpCondCode(ICmpInst::Predicate Pred); /// between it and the return. /// /// This function only tests target-independent requirements. -bool isInTailCallPosition(ImmutableCallSite CS, Attributes CalleeRetAttr, +bool isInTailCallPosition(ImmutableCallSite CS, Attribute CalleeRetAttr, const TargetLowering &TLI); bool isInTailCallPosition(SelectionDAG &DAG, SDNode *Node, diff --git a/include/llvm/Function.h b/include/llvm/Function.h index 6edc660c9c..ce7ae2646b 100644 --- a/include/llvm/Function.h +++ b/include/llvm/Function.h @@ -170,21 +170,21 @@ public: /// getFnAttributes - Return the function attributes for querying. /// - Attributes getFnAttributes() const { + Attribute getFnAttributes() const { return AttributeList.getFnAttributes(); } /// addFnAttr - Add function attributes to this function. /// - void addFnAttr(Attributes::AttrVal N) { - // Function Attributes are stored at ~0 index - addAttribute(AttributeSet::FunctionIndex, Attributes::get(getContext(), N)); + void addFnAttr(Attribute::AttrVal N) { + // Function Attribute are stored at ~0 index + addAttribute(AttributeSet::FunctionIndex, Attribute::get(getContext(), N)); } /// removeFnAttr - Remove function attributes from this function. /// - void removeFnAttr(Attributes N) { - // Function Attributes are stored at ~0 index + void removeFnAttr(Attribute N) { + // Function Attribute are stored at ~0 index removeAttribute(~0U, N); } @@ -197,20 +197,20 @@ public: /// getRetAttributes - Return the return attributes for querying. - Attributes getRetAttributes() const { + Attribute getRetAttributes() const { return AttributeList.getRetAttributes(); } /// getParamAttributes - Return the parameter attributes for querying. - Attributes getParamAttributes(unsigned Idx) const { + Attribute getParamAttributes(unsigned Idx) const { return AttributeList.getParamAttributes(Idx); } /// addAttribute - adds the attribute to the list of attributes. - void addAttribute(unsigned i, Attributes attr); + void addAttribute(unsigned i, Attribute attr); /// removeAttribute - removes the attribute from the list of attributes. - void removeAttribute(unsigned i, Attributes attr); + void removeAttribute(unsigned i, Attribute attr); /// @brief Extract the alignment for a call or parameter (0=unknown). unsigned getParamAlignment(unsigned i) const { @@ -219,44 +219,44 @@ public: /// @brief Determine if the function does not access memory. bool doesNotAccessMemory() const { - return getFnAttributes().hasAttribute(Attributes::ReadNone); + return getFnAttributes().hasAttribute(Attribute::ReadNone); } void setDoesNotAccessMemory() { - addFnAttr(Attributes::ReadNone); + addFnAttr(Attribute::ReadNone); } /// @brief Determine if the function does not access or only reads memory. bool onlyReadsMemory() const { return doesNotAccessMemory() || - getFnAttributes().hasAttribute(Attributes::ReadOnly); + getFnAttributes().hasAttribute(Attribute::ReadOnly); } void setOnlyReadsMemory() { - addFnAttr(Attributes::ReadOnly); + addFnAttr(Attribute::ReadOnly); } /// @brief Determine if the function cannot return. bool doesNotReturn() const { - return getFnAttributes().hasAttribute(Attributes::NoReturn); + return getFnAttributes().hasAttribute(Attribute::NoReturn); } void setDoesNotReturn() { - addFnAttr(Attributes::NoReturn); + addFnAttr(Attribute::NoReturn); } /// @brief Determine if the function cannot unwind. bool doesNotThrow() const { - return getFnAttributes().hasAttribute(Attributes::NoUnwind); + return getFnAttributes().hasAttribute(Attribute::NoUnwind); } void setDoesNotThrow() { - addFnAttr(Attributes::NoUnwind); + addFnAttr(Attribute::NoUnwind); } /// @brief True if the ABI mandates (or the user requested) that this /// function be in a unwind table. bool hasUWTable() const { - return getFnAttributes().hasAttribute(Attributes::UWTable); + return getFnAttributes().hasAttribute(Attribute::UWTable); } void setHasUWTable() { - addFnAttr(Attributes::UWTable); + addFnAttr(Attribute::UWTable); } /// @brief True if this function needs an unwind table. @@ -267,25 +267,25 @@ public: /// @brief Determine if the function returns a structure through first /// pointer argument. bool hasStructRetAttr() const { - return getParamAttributes(1).hasAttribute(Attributes::StructRet); + return getParamAttributes(1).hasAttribute(Attribute::StructRet); } /// @brief Determine if the parameter does not alias other parameters. /// @param n The parameter to check. 1 is the first parameter, 0 is the return bool doesNotAlias(unsigned n) const { - return getParamAttributes(n).hasAttribute(Attributes::NoAlias); + return getParamAttributes(n).hasAttribute(Attribute::NoAlias); } void setDoesNotAlias(unsigned n) { - addAttribute(n, Attributes::get(getContext(), Attributes::NoAlias)); + addAttribute(n, Attribute::get(getContext(), Attribute::NoAlias)); } /// @brief Determine if the parameter can be captured. /// @param n The parameter to check. 1 is the first parameter, 0 is the return bool doesNotCapture(unsigned n) const { - return getParamAttributes(n).hasAttribute(Attributes::NoCapture); + return getParamAttributes(n).hasAttribute(Attribute::NoCapture); } void setDoesNotCapture(unsigned n) { - addAttribute(n, Attributes::get(getContext(), Attributes::NoCapture)); + addAttribute(n, Attribute::get(getContext(), Attribute::NoCapture)); } /// copyAttributesFrom - copy all additional attributes (those not needed to diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index b5c75e3782..be865a1047 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -1272,16 +1272,16 @@ public: void setAttributes(const AttributeSet &Attrs) { AttributeList = Attrs; } /// addAttribute - adds the attribute to the list of attributes. - void addAttribute(unsigned i, Attributes attr); + void addAttribute(unsigned i, Attribute attr); /// removeAttribute - removes the attribute from the list of attributes. - void removeAttribute(unsigned i, Attributes attr); + void removeAttribute(unsigned i, Attribute attr); /// \brief Determine whether this call has the given attribute. - bool hasFnAttr(Attributes::AttrVal A) const; + bool hasFnAttr(Attribute::AttrVal A) const; /// \brief Determine whether the call or the callee has the given attributes. - bool paramHasAttr(unsigned i, Attributes::AttrVal A) const; + bool paramHasAttr(unsigned i, Attribute::AttrVal A) const; /// \brief Extract the alignment for a call or parameter (0=unknown). unsigned getParamAlignment(unsigned i) const { @@ -1289,64 +1289,64 @@ public: } /// \brief Return true if the call should not be inlined. - bool isNoInline() const { return hasFnAttr(Attributes::NoInline); } + bool isNoInline() const { return hasFnAttr(Attribute::NoInline); } void setIsNoInline() { addAttribute(AttributeSet::FunctionIndex, - Attributes::get(getContext(), Attributes::NoInline)); + Attribute::get(getContext(), Attribute::NoInline)); } /// \brief Return true if the call can return twice bool canReturnTwice() const { - return hasFnAttr(Attributes::ReturnsTwice); + return hasFnAttr(Attribute::ReturnsTwice); } void setCanReturnTwice() { addAttribute(AttributeSet::FunctionIndex, - Attributes::get(getContext(), Attributes::ReturnsTwice)); + Attribute::get(getContext(), Attribute::ReturnsTwice)); } /// \brief Determine if the call does not access memory. bool doesNotAccessMemory() const { - return hasFnAttr(Attributes::ReadNone); + return hasFnAttr(Attribute::ReadNone); } void setDoesNotAccessMemory() { addAttribute(AttributeSet::FunctionIndex, - Attributes::get(getContext(), Attributes::ReadNone)); + Attribute::get(getContext(), Attribute::ReadNone)); } /// \brief Determine if the call does not access or only reads memory. bool onlyReadsMemory() const { - return doesNotAccessMemory() || hasFnAttr(Attributes::ReadOnly); + return doesNotAccessMemory() || hasFnAttr(Attribute::ReadOnly); } void setOnlyReadsMemory() { addAttribute(AttributeSet::FunctionIndex, - Attributes::get(getContext(), Attributes::ReadOnly)); + Attribute::get(getContext(), Attribute::ReadOnly)); } /// \brief Determine if the call cannot return. - bool doesNotReturn() const { return hasFnAttr(Attributes::NoReturn); } + bool doesNotReturn() const { return hasFnAttr(Attribute::NoReturn); } void setDoesNotReturn() { addAttribute(AttributeSet::FunctionIndex, - Attributes::get(getContext(), Attributes::NoReturn)); + Attribute::get(getContext(), Attribute::NoReturn)); } /// \brief Determine if the call cannot unwind. - bool doesNotThrow() const { return hasFnAttr(Attributes::NoUnwind); } + bool doesNotThrow() const { return hasFnAttr(Attribute::NoUnwind); } void setDoesNotThrow() { addAttribute(AttributeSet::FunctionIndex, - Attributes::get(getContext(), Attributes::NoUnwind)); + Attribute::get(getContext(), Attribute::NoUnwind)); } /// \brief Determine if the call returns a structure through first /// pointer argument. bool hasStructRetAttr() const { // Be friendly and also check the callee. - return paramHasAttr(1, Attributes::StructRet); + return paramHasAttr(1, Attribute::StructRet); } /// \brief Determine if any call argument is an aggregate passed by value. bool hasByValArgument() const { for (unsigned I = 0, E = AttributeList.getNumAttrs(); I != E; ++I) - if (AttributeList.getAttributesAtIndex(I).hasAttribute(Attributes::ByVal)) + if (AttributeList.getAttributesAtIndex(I).hasAttribute(Attribute::ByVal)) return true; return false; } @@ -3021,16 +3021,16 @@ public: void setAttributes(const AttributeSet &Attrs) { AttributeList = Attrs; } /// addAttribute - adds the attribute to the list of attributes. - void addAttribute(unsigned i, Attributes attr); + void addAttribute(unsigned i, Attribute attr); /// removeAttribute - removes the attribute from the list of attributes. - void removeAttribute(unsigned i, Attributes attr); + void removeAttribute(unsigned i, Attribute attr); /// \brief Determine whether this call has the NoAlias attribute. - bool hasFnAttr(Attributes::AttrVal A) const; + bool hasFnAttr(Attribute::AttrVal A) const; /// \brief Determine whether the call or the callee has the given attributes. - bool paramHasAttr(unsigned i, Attributes::AttrVal A) const; + bool paramHasAttr(unsigned i, Attribute::AttrVal A) const; /// \brief Extract the alignment for a call or parameter (0=unknown). unsigned getParamAlignment(unsigned i) const { @@ -3038,55 +3038,55 @@ public: } /// \brief Return true if the call should not be inlined. - bool isNoInline() const { return hasFnAttr(Attributes::NoInline); } + bool isNoInline() const { return hasFnAttr(Attribute::NoInline); } void setIsNoInline() { addAttribute(AttributeSet::FunctionIndex, - Attributes::get(getContext(), Attributes::NoInline)); + Attribute::get(getContext(), Attribute::NoInline)); } /// \brief Determine if the call does not access memory. bool doesNotAccessMemory() const { - return hasFnAttr(Attributes::ReadNone); + return hasFnAttr(Attribute::ReadNone); } void setDoesNotAccessMemory() { addAttribute(AttributeSet::FunctionIndex, - Attributes::get(getContext(), Attributes::ReadNone)); + Attribute::get(getContext(), Attribute::ReadNone)); } /// \brief Determine if the call does not access or only reads memory. bool onlyReadsMemory() const { - return doesNotAccessMemory() || hasFnAttr(Attributes::ReadOnly); + return doesNotAccessMemory() || hasFnAttr(Attribute::ReadOnly); } void setOnlyReadsMemory() { addAttribute(AttributeSet::FunctionIndex, - Attributes::get(getContext(), Attributes::ReadOnly)); + Attribute::get(getContext(), Attribute::ReadOnly)); } /// \brief Determine if the call cannot return. - bool doesNotReturn() const { return hasFnAttr(Attributes::NoReturn); } + bool doesNotReturn() const { return hasFnAttr(Attribute::NoReturn); } void setDoesNotReturn() { addAttribute(AttributeSet::FunctionIndex, - Attributes::get(getContext(), Attributes::NoReturn)); + Attribute::get(getContext(), Attribute::NoReturn)); } /// \brief Determine if the call cannot unwind. - bool doesNotThrow() const { return hasFnAttr(Attributes::NoUnwind); } + bool doesNotThrow() const { return hasFnAttr(Attribute::NoUnwind); } void setDoesNotThrow() { addAttribute(AttributeSet::FunctionIndex, - Attributes::get(getContext(), Attributes::NoUnwind)); + Attribute::get(getContext(), Attribute::NoUnwind)); } /// \brief Determine if the call returns a structure through first /// pointer argument. bool hasStructRetAttr() const { // Be friendly and also check the callee. - return paramHasAttr(1, Attributes::StructRet); + return paramHasAttr(1, Attribute::StructRet); } /// \brief Determine if any call argument is an aggregate passed by value. bool hasByValArgument() const { for (unsigned I = 0, E = AttributeList.getNumAttrs(); I != E; ++I) - if (AttributeList.getAttributesAtIndex(I).hasAttribute(Attributes::ByVal)) + if (AttributeList.getAttributesAtIndex(I).hasAttribute(Attribute::ByVal)) return true; return false; } diff --git a/include/llvm/Support/CallSite.h b/include/llvm/Support/CallSite.h index 7a0b8db9bb..f05cee05a9 100644 --- a/include/llvm/Support/CallSite.h +++ b/include/llvm/Support/CallSite.h @@ -185,12 +185,12 @@ public: } /// \brief Return true if this function has the given attribute. - bool hasFnAttr(Attributes::AttrVal A) const { + bool hasFnAttr(Attribute::AttrVal A) const { CALLSITE_DELEGATE_GETTER(hasFnAttr(A)); } /// \brief Return true if the call or the callee has the given attribute. - bool paramHasAttr(unsigned i, Attributes::AttrVal A) const { + bool paramHasAttr(unsigned i, Attribute::AttrVal A) const { CALLSITE_DELEGATE_GETTER(paramHasAttr(i, A)); } @@ -244,12 +244,12 @@ public: /// @brief Determine whether this argument is not captured. bool doesNotCapture(unsigned ArgNo) const { - return paramHasAttr(ArgNo + 1, Attributes::NoCapture); + return paramHasAttr(ArgNo + 1, Attribute::NoCapture); } /// @brief Determine whether this argument is passed by value. bool isByValArgument(unsigned ArgNo) const { - return paramHasAttr(ArgNo + 1, Attributes::ByVal); + return paramHasAttr(ArgNo + 1, Attribute::ByVal); } /// hasArgument - Returns true if this CallSite passes the given Value* as an diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index debf296e3b..92bb33a292 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -1353,9 +1353,9 @@ public: FunctionType *FTy, bool isTailCall, SDValue callee, ArgListTy &args, SelectionDAG &dag, DebugLoc dl, ImmutableCallSite &cs) - : Chain(chain), RetTy(retTy), RetSExt(cs.paramHasAttr(0, Attributes::SExt)), - RetZExt(cs.paramHasAttr(0, Attributes::ZExt)), IsVarArg(FTy->isVarArg()), - IsInReg(cs.paramHasAttr(0, Attributes::InReg)), + : Chain(chain), RetTy(retTy), RetSExt(cs.paramHasAttr(0, Attribute::SExt)), + RetZExt(cs.paramHasAttr(0, Attribute::ZExt)), IsVarArg(FTy->isVarArg()), + IsInReg(cs.paramHasAttr(0, Attribute::InReg)), DoesNotReturn(cs.doesNotReturn()), IsReturnValueUsed(!cs.getInstruction()->use_empty()), IsTailCall(isTailCall), NumFixedArgs(FTy->getNumParams()), @@ -2205,7 +2205,7 @@ private: /// GetReturnInfo - Given an LLVM IR type and return type attributes, /// compute the return value EVTs and flags, and optionally also /// the offsets, if the return value is being lowered to memory. -void GetReturnInfo(Type* ReturnType, Attributes attr, +void GetReturnInfo(Type* ReturnType, Attribute attr, SmallVectorImpl<ISD::OutputArg> &Outs, const TargetLowering &TLI); |