aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/llvm-c/Core.h34
-rw-r--r--include/llvm/Argument.h4
-rw-r--r--include/llvm/Attributes.h127
-rw-r--r--include/llvm/Bitcode/LLVMBitCodes.h2
-rw-r--r--include/llvm/Function.h50
-rw-r--r--include/llvm/Instructions.h94
-rw-r--r--include/llvm/Intrinsics.h6
-rw-r--r--include/llvm/Support/CallSite.h6
8 files changed, 161 insertions, 162 deletions
diff --git a/include/llvm-c/Core.h b/include/llvm-c/Core.h
index 3094431..e00f0fb 100644
--- a/include/llvm-c/Core.h
+++ b/include/llvm-c/Core.h
@@ -83,18 +83,18 @@ typedef struct LLVMOpaqueMemoryBuffer *LLVMMemoryBufferRef;
typedef struct LLVMOpaquePassManager *LLVMPassManagerRef;
typedef enum {
- LLVMZExtParamAttr = 1<<0,
- LLVMSExtParamAttr = 1<<1,
- LLVMNoReturnParamAttr = 1<<2,
- LLVMInRegParamAttr = 1<<3,
- LLVMStructRetParamAttr = 1<<4,
- LLVMNoUnwindParamAttr = 1<<5,
- LLVMNoAliasParamAttr = 1<<6,
- LLVMByValParamAttr = 1<<7,
- LLVMNestParamAttr = 1<<8,
- LLVMReadNoneParamAttr = 1<<9,
- LLVMReadOnlyParamAttr = 1<<10
-} LLVMParamAttr;
+ LLVMZExtAttribute = 1<<0,
+ LLVMSExtAttribute = 1<<1,
+ LLVMNoReturnAttribute = 1<<2,
+ LLVMInRegAttribute = 1<<3,
+ LLVMStructRetAttribute = 1<<4,
+ LLVMNoUnwindAttribute = 1<<5,
+ LLVMNoAliasAttribute = 1<<6,
+ LLVMByValAttribute = 1<<7,
+ LLVMNestAttribute = 1<<8,
+ LLVMReadNoneAttribute = 1<<9,
+ LLVMReadOnlyAttribute = 1<<10
+} LLVMAttribute;
typedef enum {
LLVMVoidTypeKind, /**< type with no size */
@@ -423,8 +423,8 @@ LLVMValueRef LLVMGetFirstParam(LLVMValueRef Fn);
LLVMValueRef LLVMGetLastParam(LLVMValueRef Fn);
LLVMValueRef LLVMGetNextParam(LLVMValueRef Arg);
LLVMValueRef LLVMGetPreviousParam(LLVMValueRef Arg);
-void LLVMAddParamAttr(LLVMValueRef Arg, LLVMParamAttr PA);
-void LLVMRemoveParamAttr(LLVMValueRef Arg, LLVMParamAttr PA);
+void LLVMAddAttribute(LLVMValueRef Arg, LLVMAttribute PA);
+void LLVMRemoveAttribute(LLVMValueRef Arg, LLVMAttribute PA);
void LLVMSetParamAlignment(LLVMValueRef Arg, unsigned align);
/* Operations on basic blocks */
@@ -454,9 +454,9 @@ LLVMValueRef LLVMGetPreviousInstruction(LLVMValueRef Inst);
/* Operations on call sites */
void LLVMSetInstructionCallConv(LLVMValueRef Instr, unsigned CC);
unsigned LLVMGetInstructionCallConv(LLVMValueRef Instr);
-void LLVMAddInstrParamAttr(LLVMValueRef Instr, unsigned index, LLVMParamAttr);
-void LLVMRemoveInstrParamAttr(LLVMValueRef Instr, unsigned index,
- LLVMParamAttr);
+void LLVMAddInstrAttribute(LLVMValueRef Instr, unsigned index, LLVMAttribute);
+void LLVMRemoveInstrAttribute(LLVMValueRef Instr, unsigned index,
+ LLVMAttribute);
void LLVMSetInstrParamAlignment(LLVMValueRef Instr, unsigned index,
unsigned align);
diff --git a/include/llvm/Argument.h b/include/llvm/Argument.h
index 0ad5431..9faff54 100644
--- a/include/llvm/Argument.h
+++ b/include/llvm/Argument.h
@@ -60,10 +60,10 @@ public:
/// its containing function.
bool hasStructRetAttr() const;
- /// addAttr - Add a ParamAttr to an argument
+ /// addAttr - Add a Attribute to an argument
void addAttr(Attributes);
- /// removeAttr - Remove a ParamAttr from an argument
+ /// removeAttr - Remove a Attribute from an argument
void removeAttr(Attributes);
/// classof - Methods for support type inquiry through isa, cast, and
diff --git a/include/llvm/Attributes.h b/include/llvm/Attributes.h
index 92cdc95..3adbf25 100644
--- a/include/llvm/Attributes.h
+++ b/include/llvm/Attributes.h
@@ -1,4 +1,4 @@
-//===-- llvm/Attributes.h - Container for ParamAttrs ---*---------- C++ -*-===//
+//===-- llvm/Attributes.h - Container for Attributes ---*---------- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -7,29 +7,29 @@
//
//===----------------------------------------------------------------------===//
//
-// This file contains the simple types necessary to represent the parameter
+// This file contains the simple types necessary to represent the
// attributes associated with functions and their calls.
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_PARAMETER_ATTRIBUTES_H
-#define LLVM_PARAMETER_ATTRIBUTES_H
+#ifndef LLVM_ATTRIBUTES_H
+#define LLVM_ATTRIBUTES_H
#include <string>
namespace llvm {
class Type;
-/// Attributes - A bitset of attributes for a parameter.
+/// Attributes - A bitset of attributes.
typedef unsigned Attributes;
-namespace ParamAttr {
+namespace Attribute {
/// Function parameters and results can have attributes to indicate how they
/// should be treated by optimizations and code generation. This enumeration
-/// lists the attributes that can be associated with parameters or function
-/// results.
-/// @brief Function parameter attributes.
+/// lists the attributes that can be associated with parameters, function
+/// results or the function itself.
+/// @brief Function attributes.
const Attributes None = 0; ///< No attributes have been set
const Attributes ZExt = 1<<0; ///< Zero extended before/after call
@@ -43,6 +43,9 @@ const Attributes ByVal = 1<<7; ///< Pass structure by value
const Attributes Nest = 1<<8; ///< Nested function static chain
const Attributes ReadNone = 1<<9; ///< Function does not access memory
const Attributes ReadOnly = 1<<10; ///< Function only reads from memory
+const Attributes NoInline = 1<<11; // inline=never
+const Attributes AlwaysInline = 1<<12; // inline=always
+const Attributes OptimizeForSize = 1<<13; // opt_size
const Attributes Alignment = 0xffff<<16; ///< Alignment of parameter (16 bits)
// 0 = unknown, else in clear (not log)
@@ -74,27 +77,23 @@ inline Attributes constructAlignmentFromInt(unsigned i) {
/// The set of Attributes set in Attributes is converted to a
/// string of equivalent mnemonics. This is, presumably, for writing out
/// the mnemonics for the assembly writer.
-/// @brief Convert parameter attribute bits to text
+/// @brief Convert attribute bits to text
std::string getAsString(Attributes Attrs);
-} // end namespace ParamAttr
-
-namespace FnAttr {
-/// Function notes are implemented as attributes stored at index ~0 in
-/// parameter attribute list.
-const Attributes None = 0;
-const Attributes NoInline = 1<<0; // inline=never
-const Attributes AlwaysInline = 1<<1; // inline=always
-const Attributes OptimizeForSize = 1<<2; // opt_size
-} // end namespace FnAttr
-
-/// This is just a pair of values to associate a set of parameter attributes
-/// with a parameter index.
-struct FnAttributeWithIndex {
+} // end namespace Attribute
+
+namespace Attribute {
+} // end namespace Attribute
+
+/// 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.
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 FnAttributeWithIndex get(unsigned Idx, Attributes Attrs) {
- FnAttributeWithIndex P;
+ static AttributeWithIndex get(unsigned Idx, Attributes Attrs) {
+ AttributeWithIndex P;
P.Index = Idx;
P.Attrs = Attrs;
return P;
@@ -102,66 +101,66 @@ struct FnAttributeWithIndex {
};
//===----------------------------------------------------------------------===//
-// PAListPtr Smart Pointer
+// AttrListPtr Smart Pointer
//===----------------------------------------------------------------------===//
class AttributeListImpl;
-/// PAListPtr - This class manages the ref count for the opaque
+/// AttrListPtr - This class manages the ref count for the opaque
/// AttributeListImpl object and provides accessors for it.
-class PAListPtr {
- /// PAList - The parameter attributes that we are managing. This can be null
- /// to represent the empty parameter attributes list.
- AttributeListImpl *PAList;
+class AttrListPtr {
+ /// AttrList - The attributes that we are managing. This can be null
+ /// to represent the empty attributes list.
+ AttributeListImpl *AttrList;
public:
- PAListPtr() : PAList(0) {}
- PAListPtr(const PAListPtr &P);
- const PAListPtr &operator=(const PAListPtr &RHS);
- ~PAListPtr();
+ AttrListPtr() : AttrList(0) {}
+ AttrListPtr(const AttrListPtr &P);
+ const AttrListPtr &operator=(const AttrListPtr &RHS);
+ ~AttrListPtr();
//===--------------------------------------------------------------------===//
- // Parameter Attribute List Construction and Mutation
+ // Attribute List Construction and Mutation
//===--------------------------------------------------------------------===//
- /// get - Return a ParamAttrs list with the specified parameter in it.
- static PAListPtr get(const FnAttributeWithIndex *Attr, unsigned NumAttrs);
+ /// get - Return a Attributes list with the specified parameter in it.
+ static AttrListPtr get(const AttributeWithIndex *Attr, unsigned NumAttrs);
- /// get - Return a ParamAttr list with the parameters specified by the
+ /// get - Return a Attribute list with the parameters specified by the
/// consecutive random access iterator range.
template <typename Iter>
- static PAListPtr get(const Iter &I, const Iter &E) {
- if (I == E) return PAListPtr(); // Empty list.
+ static AttrListPtr get(const Iter &I, const Iter &E) {
+ if (I == E) return AttrListPtr(); // Empty list.
return get(&*I, static_cast<unsigned>(E-I));
}
/// addAttr - Add the specified attribute at the specified index to this
- /// attribute list. Since parameter attribute lists are immutable, this
+ /// attribute list. Since attribute lists are immutable, this
/// returns the new list.
- PAListPtr addAttr(unsigned Idx, Attributes Attrs) const;
+ AttrListPtr addAttr(unsigned Idx, Attributes Attrs) const;
/// removeAttr - Remove the specified attribute at the specified index from
- /// this attribute list. Since parameter attribute lists are immutable, this
+ /// this attribute list. Since attribute lists are immutable, this
/// returns the new list.
- PAListPtr removeAttr(unsigned Idx, Attributes Attrs) const;
+ AttrListPtr removeAttr(unsigned Idx, Attributes Attrs) const;
//===--------------------------------------------------------------------===//
- // Parameter Attribute List Accessors
+ // Attribute List Accessors
//===--------------------------------------------------------------------===//
- /// getParamAttrs - The parameter attributes for the specified parameter are
- /// returned. Parameters for the result are denoted with Idx = 0.
- Attributes getParamAttrs(unsigned Idx) const;
+ /// getAttributes - The attributes for the specified index are
+ /// returned. Attributes for the result are denoted with Idx = 0.
+ Attributes getAttributes(unsigned Idx) const;
/// paramHasAttr - Return true if the specified parameter index has the
/// specified attribute set.
bool paramHasAttr(unsigned Idx, Attributes Attr) const {
- return getParamAttrs(Idx) & Attr;
+ return getAttributes(Idx) & Attr;
}
/// getParamAlignment - Return the alignment for the specified function
/// parameter.
unsigned getParamAlignment(unsigned Idx) const {
- return (getParamAttrs(Idx) & ParamAttr::Alignment) >> 16;
+ return (getAttributes(Idx) & Attribute::Alignment) >> 16;
}
/// hasAttrSomewhere - Return true if the specified attribute is set for at
@@ -169,29 +168,29 @@ public:
bool hasAttrSomewhere(Attributes Attr) const;
/// operator==/!= - Provide equality predicates.
- bool operator==(const PAListPtr &RHS) const { return PAList == RHS.PAList; }
- bool operator!=(const PAListPtr &RHS) const { return PAList != RHS.PAList; }
+ bool operator==(const AttrListPtr &RHS) const { return AttrList == RHS.AttrList; }
+ bool operator!=(const AttrListPtr &RHS) const { return AttrList != RHS.AttrList; }
void dump() const;
//===--------------------------------------------------------------------===//
- // Parameter Attribute List Introspection
+ // Attribute List Introspection
//===--------------------------------------------------------------------===//
/// getRawPointer - Return a raw pointer that uniquely identifies this
- /// parameter attribute list.
+ /// attribute list.
void *getRawPointer() const {
- return PAList;
+ return AttrList;
}
- // Parameter attributes are stored as a dense set of slots, where there is one
+ // 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 no parameters have an attribute.
+ /// isEmpty - Return true if there are no attributes.
///
bool isEmpty() const {
- return PAList == 0;
+ return AttrList == 0;
}
/// getNumSlots - Return the number of slots used in this attribute list.
@@ -199,12 +198,12 @@ public:
/// (including the function itself).
unsigned getNumSlots() const;
- /// getSlot - Return the FnAttributeWithIndex at the specified slot. This
- /// holds a parameter number plus a set of attributes.
- const FnAttributeWithIndex &getSlot(unsigned Slot) const;
+ /// getSlot - Return the AttributeWithIndex at the specified slot. This
+ /// holds a index number plus a set of attributes.
+ const AttributeWithIndex &getSlot(unsigned Slot) const;
private:
- explicit PAListPtr(AttributeListImpl *L);
+ explicit AttrListPtr(AttributeListImpl *L);
};
} // End llvm namespace
diff --git a/include/llvm/Bitcode/LLVMBitCodes.h b/include/llvm/Bitcode/LLVMBitCodes.h
index 50a9738..b0cdb17 100644
--- a/include/llvm/Bitcode/LLVMBitCodes.h
+++ b/include/llvm/Bitcode/LLVMBitCodes.h
@@ -64,7 +64,7 @@ namespace bitc {
};
/// PARAMATTR blocks have code for defining a parameter attribute set.
- enum ParamAttrCodes {
+ enum AttributeCodes {
PARAMATTR_CODE_ENTRY = 1 // ENTRY: [paramidx0, attr0, paramidx1, attr1...]
};
diff --git a/include/llvm/Function.h b/include/llvm/Function.h
index 7a39f92..82871bb 100644
--- a/include/llvm/Function.h
+++ b/include/llvm/Function.h
@@ -69,7 +69,7 @@ private:
BasicBlockListType BasicBlocks; ///< The basic blocks
mutable ArgumentListType ArgumentList; ///< The formal arguments
ValueSymbolTable *SymTab; ///< Symbol table of args/instructions
- PAListPtr ParamAttrs; ///< Parameter attributes
+ AttrListPtr AttributeList; ///< Parameter attributes
// The Calling Convention is stored in Value::SubclassData.
/*unsigned CallingConvention;*/
@@ -140,13 +140,13 @@ public:
SubclassData = (SubclassData & 1) | (CC << 1);
}
- /// getParamAttrs - Return the parameter attributes for this Function.
+ /// getAttributes - Return the parameter attributes for this Function.
///
- const PAListPtr &getParamAttrs() const { return ParamAttrs; }
+ const AttrListPtr &getAttributes() const { return AttributeList; }
- /// setParamAttrs - Set the parameter attributes for this Function.
+ /// setAttributes - Set the parameter attributes for this Function.
///
- void setParamAttrs(const PAListPtr &attrs) { ParamAttrs = attrs; }
+ void setAttributes(const AttrListPtr &attrs) { AttributeList = attrs; }
/// hasNote - Return true if this function has given note.
@@ -159,7 +159,7 @@ public:
///
void setNotes(const Attributes N) {
// Notes are stored at ~0 index in parameter attribute list
- addParamAttr(~0, N);
+ addAttribute(~0, N);
}
/// hasGC/getGC/setGC/clearGC - The name of the garbage collection algorithm
@@ -171,60 +171,60 @@ public:
/// @brief Determine whether the function has the given attribute.
bool paramHasAttr(unsigned i, Attributes attr) const {
- return ParamAttrs.paramHasAttr(i, attr);
+ return AttributeList.paramHasAttr(i, attr);
}
- /// addParamAttr - adds the attribute to the list of attributes.
- void addParamAttr(unsigned i, Attributes attr);
+ /// addAttribute - adds the attribute to the list of attributes.
+ void addAttribute(unsigned i, Attributes attr);
- /// removeParamAttr - removes the attribute from the list of attributes.
- void removeParamAttr(unsigned i, Attributes attr);
+ /// removeAttribute - removes the attribute from the list of attributes.
+ void removeAttribute(unsigned i, Attributes attr);
/// @brief Extract the alignment for a call or parameter (0=unknown).
unsigned getParamAlignment(unsigned i) const {
- return ParamAttrs.getParamAlignment(i);
+ return AttributeList.getParamAlignment(i);
}
/// @brief Determine if the function does not access memory.
bool doesNotAccessMemory() const {
- return paramHasAttr(0, ParamAttr::ReadNone);
+ return paramHasAttr(0, Attribute::ReadNone);
}
void setDoesNotAccessMemory(bool DoesNotAccessMemory = true) {
- if (DoesNotAccessMemory) addParamAttr(0, ParamAttr::ReadNone);
- else removeParamAttr(0, ParamAttr::ReadNone);
+ if (DoesNotAccessMemory) addAttribute(0, Attribute::ReadNone);
+ else removeAttribute(0, Attribute::ReadNone);
}
/// @brief Determine if the function does not access or only reads memory.
bool onlyReadsMemory() const {
- return doesNotAccessMemory() || paramHasAttr(0, ParamAttr::ReadOnly);
+ return doesNotAccessMemory() || paramHasAttr(0, Attribute::ReadOnly);
}
void setOnlyReadsMemory(bool OnlyReadsMemory = true) {
- if (OnlyReadsMemory) addParamAttr(0, ParamAttr::ReadOnly);
- else removeParamAttr(0, ParamAttr::ReadOnly | ParamAttr::ReadNone);
+ if (OnlyReadsMemory) addAttribute(0, Attribute::ReadOnly);
+ else removeAttribute(0, Attribute::ReadOnly | Attribute::ReadNone);
}
/// @brief Determine if the function cannot return.
bool doesNotReturn() const {
- return paramHasAttr(0, ParamAttr::NoReturn);
+ return paramHasAttr(0, Attribute::NoReturn);
}
void setDoesNotReturn(bool DoesNotReturn = true) {
- if (DoesNotReturn) addParamAttr(0, ParamAttr::NoReturn);
- else removeParamAttr(0, ParamAttr::NoReturn);
+ if (DoesNotReturn) addAttribute(0, Attribute::NoReturn);
+ else removeAttribute(0, Attribute::NoReturn);
}
/// @brief Determine if the function cannot unwind.
bool doesNotThrow() const {
- return paramHasAttr(0, ParamAttr::NoUnwind);
+ return paramHasAttr(0, Attribute::NoUnwind);
}
void setDoesNotThrow(bool DoesNotThrow = true) {
- if (DoesNotThrow) addParamAttr(0, ParamAttr::NoUnwind);
- else removeParamAttr(0, ParamAttr::NoUnwind);
+ if (DoesNotThrow) addAttribute(0, Attribute::NoUnwind);
+ else removeAttribute(0, Attribute::NoUnwind);
}
/// @brief Determine if the function returns a structure through first
/// pointer argument.
bool hasStructRetAttr() const {
- return paramHasAttr(1, ParamAttr::StructRet);
+ return paramHasAttr(1, Attribute::StructRet);
}
/// copyAttributesFrom - copy all additional attributes (those not needed to
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h
index b897a39..1406b93 100644
--- a/include/llvm/Instructions.h
+++ b/include/llvm/Instructions.h
@@ -973,7 +973,7 @@ public:
///
class CallInst : public Instruction {
- PAListPtr ParamAttrs; ///< parameter attributes for call
+ AttrListPtr AttributeList; ///< parameter attributes for call
CallInst(const CallInst &CI);
void init(Value *Func, Value* const *Params, unsigned NumParams);
void init(Value *Func, Value *Actual1, Value *Actual2);
@@ -1073,73 +1073,73 @@ public:
SubclassData = (SubclassData & 1) | (CC << 1);
}
- /// getParamAttrs - Return the parameter attributes for this call.
+ /// getAttributes - Return the parameter attributes for this call.
///
- const PAListPtr &getParamAttrs() const { return ParamAttrs; }
+ const AttrListPtr &getAttributes() const { return AttributeList; }
- /// setParamAttrs - Sets the parameter attributes for this call.
- void setParamAttrs(const PAListPtr &Attrs) { ParamAttrs = Attrs; }
+ /// setAttributes - Sets the parameter attributes for this call.
+ void setAttributes(const AttrListPtr &Attrs) { AttributeList = Attrs; }
- /// addParamAttr - adds the attribute to the list of attributes.
- void addParamAttr(unsigned i, Attributes attr);
+ /// addAttribute - adds the attribute to the list of attributes.
+ void addAttribute(unsigned i, Attributes attr);
- /// removeParamAttr - removes the attribute from the list of attributes.
- void removeParamAttr(unsigned i, Attributes attr);
+ /// removeAttribute - removes the attribute from the list of attributes.
+ void removeAttribute(unsigned i, Attributes attr);
/// @brief Determine whether the call or the callee has the given attribute.
bool paramHasAttr(unsigned i, unsigned attr) const;
/// @brief Extract the alignment for a call or parameter (0=unknown).
unsigned getParamAlignment(unsigned i) const {
- return ParamAttrs.getParamAlignment(i);
+ return AttributeList.getParamAlignment(i);
}
/// @brief Determine if the call does not access memory.
bool doesNotAccessMemory() const {
- return paramHasAttr(0, ParamAttr::ReadNone);
+ return paramHasAttr(0, Attribute::ReadNone);
}
void setDoesNotAccessMemory(bool NotAccessMemory = true) {
- if (NotAccessMemory) addParamAttr(0, ParamAttr::ReadNone);
- else removeParamAttr(0, ParamAttr::ReadNone);
+ if (NotAccessMemory) addAttribute(0, Attribute::ReadNone);
+ else removeAttribute(0, Attribute::ReadNone);
}
/// @brief Determine if the call does not access or only reads memory.
bool onlyReadsMemory() const {
- return doesNotAccessMemory() || paramHasAttr(0, ParamAttr::ReadOnly);
+ return doesNotAccessMemory() || paramHasAttr(0, Attribute::ReadOnly);
}
void setOnlyReadsMemory(bool OnlyReadsMemory = true) {
- if (OnlyReadsMemory) addParamAttr(0, ParamAttr::ReadOnly);
- else removeParamAttr(0, ParamAttr::ReadOnly | ParamAttr::ReadNone);
+ if (OnlyReadsMemory) addAttribute(0, Attribute::ReadOnly);
+ else removeAttribute(0, Attribute::ReadOnly | Attribute::ReadNone);
}
/// @brief Determine if the call cannot return.
bool doesNotReturn() const {
- return paramHasAttr(0, ParamAttr::NoReturn);
+ return paramHasAttr(0, Attribute::NoReturn);
}
void setDoesNotReturn(bool DoesNotReturn = true) {
- if (DoesNotReturn) addParamAttr(0, ParamAttr::NoReturn);
- else removeParamAttr(0, ParamAttr::NoReturn);
+ if (DoesNotReturn) addAttribute(0, Attribute::NoReturn);
+ else removeAttribute(0, Attribute::NoReturn);
}
/// @brief Determine if the call cannot unwind.
bool doesNotThrow() const {
- return paramHasAttr(0, ParamAttr::NoUnwind);
+ return paramHasAttr(0, Attribute::NoUnwind);
}
void setDoesNotThrow(bool DoesNotThrow = true) {
- if (DoesNotThrow) addParamAttr(0, ParamAttr::NoUnwind);
- else removeParamAttr(0, ParamAttr::NoUnwind);
+ if (DoesNotThrow) addAttribute(0, Attribute::NoUnwind);
+ else removeAttribute(0, 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, ParamAttr::StructRet);
+ return paramHasAttr(1, Attribute::StructRet);
}
/// @brief Determine if any call argument is an aggregate passed by value.
bool hasByValArgument() const {
- return ParamAttrs.hasAttrSomewhere(ParamAttr::ByVal);
+ return AttributeList.hasAttrSomewhere(Attribute::ByVal);
}
/// getCalledFunction - Return the function being called by this instruction
@@ -2353,7 +2353,7 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(SwitchInst, Value)
/// calling convention of the call.
///
class InvokeInst : public TerminatorInst {
- PAListPtr ParamAttrs;
+ AttrListPtr AttributeList;
InvokeInst(const InvokeInst &BI);
void init(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException,
Value* const *Args, unsigned NumArgs);
@@ -2431,69 +2431,69 @@ public:
SubclassData = CC;
}
- /// getParamAttrs - Return the parameter attributes for this invoke.
+ /// getAttributes - Return the parameter attributes for this invoke.
///
- const PAListPtr &getParamAttrs() const { return ParamAttrs; }
+ const AttrListPtr &getAttributes() const { return AttributeList; }
- /// setParamAttrs - Set the parameter attributes for this invoke.
+ /// setAttributes - Set the parameter attributes for this invoke.
///
- void setParamAttrs(const PAListPtr &Attrs) { ParamAttrs = Attrs; }
+ void setAttributes(const AttrListPtr &Attrs) { AttributeList = Attrs; }
/// @brief Determine whether the call or the callee has the given attribute.
bool paramHasAttr(unsigned i, Attributes attr) const;
- /// addParamAttr - adds the attribute to the list of attributes.
- void addParamAttr(unsigned i, Attributes attr);
+ /// addAttribute - adds the attribute to the list of attributes.
+ void addAttribute(unsigned i, Attributes attr);
- /// removeParamAttr - removes the attribute from the list of attributes.
- void removeParamAttr(unsigned i, Attributes attr);
+ /// removeAttribute - removes the attribute from the list of attributes.
+ void removeAttribute(unsigned i, Attributes attr);
/// @brief Extract the alignment for a call or parameter (0=unknown).
unsigned getParamAlignment(unsigned i) const {
- return ParamAttrs.getParamAlignment(i);
+ return AttributeList.getParamAlignment(i);
}
/// @brief Determine if the call does not access memory.
bool doesNotAccessMemory() const {
- return paramHasAttr(0, ParamAttr::ReadNone);
+ return paramHasAttr(0, Attribute::ReadNone);
}
void setDoesNotAccessMemory(bool NotAccessMemory = true) {
- if (NotAccessMemory) addParamAttr(0, ParamAttr::ReadNone);
- else removeParamAttr(0, ParamAttr::ReadNone);
+ if (NotAccessMemory) addAttribute(0, Attribute::ReadNone);
+ else removeAttribute(0, Attribute::ReadNone);
}
/// @brief Determine if the call does not access or only reads memory.
bool onlyReadsMemory() const {
- return doesNotAccessMemory() || paramHasAttr(0, ParamAttr::ReadOnly);
+ return doesNotAccessMemory() || paramHasAttr(0, Attribute::ReadOnly);
}
void setOnlyReadsMemory(bool OnlyReadsMemory = true) {
- if (OnlyReadsMemory) addParamAttr(0, ParamAttr::ReadOnly);
- else removeParamAttr(0, ParamAttr::ReadOnly | ParamAttr::ReadNone);
+ if (OnlyReadsMemory) addAttribute(0, Attribute::ReadOnly);
+ else removeAttribute(0, Attribute::ReadOnly | Attribute::ReadNone);
}
/// @brief Determine if the call cannot return.
bool doesNotReturn() const {
- return paramHasAttr(0, ParamAttr::NoReturn);
+ return paramHasAttr(0, Attribute::NoReturn);
}
void setDoesNotReturn(bool DoesNotReturn = true) {
- if (DoesNotReturn) addParamAttr(0, ParamAttr::NoReturn);
- else removeParamAttr(0, ParamAttr::NoReturn);
+ if (DoesNotReturn) addAttribute(0, Attribute::NoReturn);
+ else removeAttribute(0, Attribute::NoReturn);
}
/// @brief Determine if the call cannot unwind.
bool doesNotThrow() const {
- return paramHasAttr(0, ParamAttr::NoUnwind);
+ return paramHasAttr(0, Attribute::NoUnwind);
}
void setDoesNotThrow(bool DoesNotThrow = true) {
- if (DoesNotThrow) addParamAttr(0, ParamAttr::NoUnwind);
- else removeParamAttr(0, ParamAttr::NoUnwind);
+ if (DoesNotThrow) addAttribute(0, Attribute::NoUnwind);
+ else removeAttribute(0, 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, ParamAttr::StructRet);
+ return paramHasAttr(1, Attribute::StructRet);
}
/// getCalledFunction - Return the function called, or null if this is an
diff --git a/include/llvm/Intrinsics.h b/include/llvm/Intrinsics.h
index 1874d1a..b15b021 100644
--- a/include/llvm/Intrinsics.h
+++ b/include/llvm/Intrinsics.h
@@ -24,7 +24,7 @@ class Type;
class FunctionType;
class Function;
class Module;
-class PAListPtr;
+class AttrListPtr;
/// Intrinsic Namespace - This namespace contains an enum with a value for
/// every intrinsic/builtin function known by LLVM. These enum values are
@@ -49,9 +49,9 @@ namespace Intrinsic {
///
const FunctionType *getType(ID id, const Type **Tys = 0, unsigned numTys = 0);
- /// Intrinsic::getParamAttrs(ID) - Return the attributes for an intrinsic.
+ /// Intrinsic::getAttributes(ID) - Return the attributes for an intrinsic.
///
- PAListPtr getParamAttrs(ID id);
+ AttrListPtr getAttributes(ID id);
/// Intrinsic::getDeclaration(M, ID) - Create or insert an LLVM Function
/// declaration for an intrinsic, and return it.
diff --git a/include/llvm/Support/CallSite.h b/include/llvm/Support/CallSite.h
index 2e258a5..025f9da 100644
--- a/include/llvm/Support/CallSite.h
+++ b/include/llvm/Support/CallSite.h
@@ -62,10 +62,10 @@ public:
unsigned getCallingConv() const;
void setCallingConv(unsigned CC);
- /// getParamAttrs/setParamAttrs - get or set the parameter attributes of
+ /// getAttributes/setAttributes - get or set the parameter attributes of
/// the call.
- const PAListPtr &getParamAttrs() const;
- void setParamAttrs(const PAListPtr &PAL);
+ const AttrListPtr &getAttributes() const;
+ void setAttributes(const AttrListPtr &PAL);
/// paramHasAttr - whether the call or the callee has the given attribute.
bool paramHasAttr(uint16_t i, Attributes attr) const;