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

Reid Spencer reid at x10sys.com
Mon Dec 11 16:50:00 PST 2006



Changes in directory llvm/include/llvm:

InstrTypes.h updated: 1.53 -> 1.54
---
Log message:

Implement createIntegerCast and createFPCast factory methods for handling
integer and floating point cast creation. createIntegerCast generates
ZExt/SExt, BitCast or Trunc. createFPCast generates FPExt, Bitcast, or 
FPTrunc.


---
Diffs of the changes:  (+34 -0)

 InstrTypes.h |   34 ++++++++++++++++++++++++++++++++++
 1 files changed, 34 insertions(+)


Index: llvm/include/llvm/InstrTypes.h
diff -u llvm/include/llvm/InstrTypes.h:1.53 llvm/include/llvm/InstrTypes.h:1.54
--- llvm/include/llvm/InstrTypes.h:1.53	Wed Dec  6 22:18:31 2006
+++ llvm/include/llvm/InstrTypes.h	Mon Dec 11 18:49:44 2006
@@ -339,6 +339,40 @@
     Instruction *InsertBefore = 0 ///< Place to insert the instruction
   );
 
+  /// @brief Create a ZExt, BitCast, or Trunc for int -> int casts.
+  static CastInst *createIntegerCast(
+    Value *S,                ///< The pointer value to be casted (operand 0)
+    const Type *Ty,          ///< The type to which cast should be made
+    bool isSigned,           ///< Whether to regard S as signed or not
+    const std::string &Name = "", ///< Name for the instruction
+    Instruction *InsertBefore = 0 ///< Place to insert the instruction
+  );
+
+  /// @brief Create a ZExt, BitCast, or Trunc for int -> int casts.
+  static CastInst *createIntegerCast(
+    Value *S,                ///< The integer value to be casted (operand 0)
+    const Type *Ty,          ///< The integer type to which operand is casted
+    bool isSigned,           ///< Whether to regard S as signed or not
+    const std::string &Name, ///< The name for the instruction
+    BasicBlock *InsertAtEnd  ///< The block to insert the instruction into
+  );
+
+  /// @brief Create an FPExt, BitCast, or FPTrunc for fp -> fp casts
+  static CastInst *createFPCast(
+    Value *S,                ///< The floating point value to be casted 
+    const Type *Ty,          ///< The floating point type to cast to
+    const std::string &Name = "", ///< Name for the instruction
+    Instruction *InsertBefore = 0 ///< Place to insert the instruction
+  );
+
+  /// @brief Create an FPExt, BitCast, or FPTrunc for fp -> fp casts
+  static CastInst *createFPCast(
+    Value *S,                ///< The floating point value to be casted 
+    const Type *Ty,          ///< The floating point type to cast to
+    const std::string &Name, ///< The name for the instruction
+    BasicBlock *InsertAtEnd  ///< The block to insert the instruction into
+  );
+
   /// @brief Create a SExt or BitCast cast instruction
   static CastInst *createSExtOrBitCast(
     Value *S,                ///< The value to be casted (operand 0)






More information about the llvm-commits mailing list