[llvm-commits] CVS: llvm/include/llvm/Instructions.h

Reid Spencer reid at x10sys.com
Mon Apr 9 11:01:17 PDT 2007



Changes in directory llvm/include/llvm:

Instructions.h updated: 1.64 -> 1.65
---
Log message:

For PR1146: http://llvm.org/PR1146 :
* Add ParamAttrs to InvokeInst class too.
* Make sure all initializes of ParamAttrs in CallInst and InvokeInst are 0
* Destruct the ParamAttrs in Call/Invoke destructors to avoid memory 
  leaks. This will change when ParamAttrsList is uniquified but needs to
  be correct until then.


---
Diffs of the changes:  (+16 -3)

 Instructions.h |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)


Index: llvm/include/llvm/Instructions.h
diff -u llvm/include/llvm/Instructions.h:1.64 llvm/include/llvm/Instructions.h:1.65
--- llvm/include/llvm/Instructions.h:1.64	Mon Apr  9 10:01:12 2007
+++ llvm/include/llvm/Instructions.h	Mon Apr  9 13:00:57 2007
@@ -737,10 +737,11 @@
     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
@@ -1445,6 +1446,7 @@
 /// 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);
@@ -1466,6 +1468,17 @@
     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.
   ///






More information about the llvm-commits mailing list