diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Function.h | 22 | ||||
-rw-r--r-- | include/llvm/Instructions.h | 12 |
2 files changed, 29 insertions, 5 deletions
diff --git a/include/llvm/Function.h b/include/llvm/Function.h index 4cfb676..101de8a 100644 --- a/include/llvm/Function.h +++ b/include/llvm/Function.h @@ -26,6 +26,7 @@ namespace llvm { class FunctionType; +class ParamAttrsList; // Traits for intrusive list of instructions... template<> struct ilist_traits<BasicBlock> @@ -60,11 +61,11 @@ public: private: // Important things that make up a function! - BasicBlockListType BasicBlocks; // The basic blocks - ArgumentListType ArgumentList; // The formal arguments - - ValueSymbolTable *SymTab; - unsigned CallingConvention; + BasicBlockListType BasicBlocks; ///< The basic blocks + ArgumentListType ArgumentList; ///< The formal arguments + ValueSymbolTable *SymTab; ///< Symbol table of args/instructions + ParamAttrsList *ParamAttrs; ///< Parameter attributes + unsigned CallingConvention; ///< Calling convention to use friend class SymbolTableListTraits<Function, Module, Module>; @@ -111,6 +112,17 @@ public: unsigned getCallingConv() const { return CallingConvention; } void setCallingConv(unsigned CC) { CallingConvention = CC; } + /// Obtains a constant pointer to the ParamAttrsList object which holds the + /// parameter attributes information, if any. + /// @returns 0 if no parameter attributes have been set. + /// @brief Get the parameter attributes. + const ParamAttrsList *getParamAttrs() const { return ParamAttrs; } + + /// Sets the parameter attributes for this Function. To construct a + /// ParamAttrsList, see ParameterAttributes.h + /// @brief Set the parameter attributes. + void setParamAttrs(ParamAttrsList *attrs) { ParamAttrs = attrs; } + /// deleteBody - This method deletes the body of the function, and converts /// the linkage to external. /// diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index 337ae2a..a25dd12 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -26,6 +26,7 @@ class PointerType; class VectorType; class ConstantRange; class APInt; +class ParamAttrsList; //===----------------------------------------------------------------------===// // AllocationInst Class @@ -694,6 +695,7 @@ public: /// hold the calling convention of the call. /// class CallInst : public Instruction { + ParamAttrsList *ParamAttrs; ///< 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); @@ -735,6 +737,16 @@ public: SubclassData = (SubclassData & 1) | (CC << 1); } + /// Obtains a constant pointer to the ParamAttrsList object which holds the + /// parameter attributes information, if any. + /// @brief Get the parameter attributes. + const ParamAttrsList *getParamAttrs() const { return ParamAttrs; } + + /// Sets the parameter attributes for this CallInst. To construct a + /// ParamAttrsList, see ParameterAttributes.h + /// @brief Set the parameter attributes. + void setParamAttrs(ParamAttrsList *attrs) { ParamAttrs = attrs; } + /// getCalledFunction - Return the function being called by this instruction /// if it is a direct call. If it is a call through a function pointer, /// return null. |