SubclassData = (SubclassData & 1) | (CC << 1);
}
- /// Obtains a constant pointer to the ParamAttrsList object which holds the
- /// parameter attributes information, if any.
+ /// Obtains a pointer to the ParamAttrsList object which holds the
+ /// parameter attributes information, if any.
+ /// @returns 0 if no attributes have been set.
/// @brief Get the parameter attributes.
- const ParamAttrsList *getParamAttrs() const { return ParamAttrs; }
+ ParamAttrsList *getParamAttrs() const { return ParamAttrs; }
/// Sets the parameter attributes for this CallInst. To construct a
/// ParamAttrsList, see ParameterAttributes.h
/// calling convention of the call.
///
class InvokeInst : public TerminatorInst {
+ ParamAttrsList *ParamAttrs;
InvokeInst(const InvokeInst &BI);
void init(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException,
Value* const *Args, unsigned NumArgs);
SubclassData = CC;
}
+ /// Obtains a pointer to the ParamAttrsList object which holds the
+ /// parameter attributes information, if any.
+ /// @returns 0 if no attributes have been set.
+ /// @brief Get the parameter attributes.
+ 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) { ParamAttrs = attrs; }
+
/// getCalledFunction - Return the function called, or null if this is an
/// indirect function invocation.
///
#include "llvm/DerivedTypes.h"
#include "llvm/Function.h"
#include "llvm/Instructions.h"
+#include "llvm/ParameterAttributes.h"
#include "llvm/Support/CallSite.h"
#include "llvm/Support/ConstantRange.h"
using namespace llvm;
CallInst::~CallInst() {
delete [] OperandList;
+ delete ParamAttrs; // FIXME: ParamAttrsList should be uniqued!
}
void CallInst::init(Value *Func, Value* const *Params, unsigned NumParams) {
CallInst::CallInst(const CallInst &CI)
: Instruction(CI.getType(), Instruction::Call, new Use[CI.getNumOperands()],
CI.getNumOperands()) {
+ ParamAttrs = 0;
SubclassData = CI.SubclassData;
Use *OL = OperandList;
Use *InOL = CI.OperandList;
InvokeInst::~InvokeInst() {
delete [] OperandList;
+ delete ParamAttrs; // FIXME: ParamAttrsList should be uniqued!
}
void InvokeInst::init(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException,
Value* const *Args, unsigned NumArgs) {
+ ParamAttrs = 0;
NumOperands = 3+NumArgs;
Use *OL = OperandList = new Use[3+NumArgs];
OL[0].init(Fn, this);
InvokeInst::InvokeInst(const InvokeInst &II)
: TerminatorInst(II.getType(), Instruction::Invoke,
new Use[II.getNumOperands()], II.getNumOperands()) {
+ ParamAttrs = 0;
SubclassData = II.SubclassData;
Use *OL = OperandList, *InOL = II.OperandList;
for (unsigned i = 0, e = II.getNumOperands(); i != e; ++i)