diff options
author | Duncan Sands <baldrick@free.fr> | 2007-11-27 13:23:08 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2007-11-27 13:23:08 +0000 |
commit | dc024674ff96820d6020757b48d47f46d4c07db2 (patch) | |
tree | 843dfcaeb8f6c99de930a32020148b563005c2fd /include/llvm/Instructions.h | |
parent | f19341dec7361451f100a882a023b14583454d7e (diff) | |
download | external_llvm-dc024674ff96820d6020757b48d47f46d4c07db2.zip external_llvm-dc024674ff96820d6020757b48d47f46d4c07db2.tar.gz external_llvm-dc024674ff96820d6020757b48d47f46d4c07db2.tar.bz2 |
Fix PR1146: parameter attributes are longer part of
the function type, instead they belong to functions
and function calls. This is an updated and slightly
corrected version of Reid Spencer's original patch.
The only known problem is that auto-upgrading of
bitcode files doesn't seem to work properly (see
test/Bitcode/AutoUpgradeIntrinsics.ll). Hopefully
a bitcode guru (who might that be? :) ) will fix it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44359 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Instructions.h')
-rw-r--r-- | include/llvm/Instructions.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index ba132cf..96ca43d 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -836,7 +836,7 @@ public: /// class CallInst : public Instruction { - ParamAttrsList *ParamAttrs; ///< parameter attributes for call + const 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); @@ -916,12 +916,15 @@ public: /// parameter attributes information, if any. /// @returns 0 if no attributes have been set. /// @brief Get the parameter attributes. - ParamAttrsList *getParamAttrs() const { return ParamAttrs; } + 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); + void setParamAttrs(const ParamAttrsList *attrs); + + /// @brief Determine if the call returns a structure. + bool isStructReturn() const; /// getCalledFunction - Return the function being called by this instruction /// if it is a direct call. If it is a call through a function pointer, @@ -1620,7 +1623,7 @@ private: /// calling convention of the call. /// class InvokeInst : public TerminatorInst { - ParamAttrsList *ParamAttrs; + const ParamAttrsList *ParamAttrs; InvokeInst(const InvokeInst &BI); void init(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException, Value* const *Args, unsigned NumArgs); @@ -1691,12 +1694,15 @@ public: /// parameter attributes information, if any. /// @returns 0 if no attributes have been set. /// @brief Get the parameter attributes. - ParamAttrsList *getParamAttrs() const { return ParamAttrs; } + const ParamAttrsList *getParamAttrs() const { return ParamAttrs; } /// Sets the parameter attributes for this InvokeInst. To construct a /// ParamAttrsList, see ParameterAttributes.h /// @brief Set the parameter attributes. - void setParamAttrs(ParamAttrsList *attrs); + void setParamAttrs(const ParamAttrsList *attrs); + + /// @brief Determine if the call returns a structure. + bool isStructReturn() const; /// getCalledFunction - Return the function called, or null if this is an /// indirect function invocation. |