[llvm-commits] CVS: llvm/include/llvm/Intrinsics.h Intrinsics.td
Jim Laskey
jlaskey at apple.com
Wed Feb 7 12:38:49 PST 2007
Changes in directory llvm/include/llvm:
Intrinsics.h updated: 1.40 -> 1.41
Intrinsics.td updated: 1.43 -> 1.44
---
Log message:
Automatically generating intrinsic declarations from Dan Gohman. Modified
to construct FunctionType in separate function, and, have getDeclaration
return a Function instead of a Constant.
---
Diffs of the changes: (+30 -7)
Intrinsics.h | 13 +++++++++++++
Intrinsics.td | 24 +++++++++++++++++-------
2 files changed, 30 insertions(+), 7 deletions(-)
Index: llvm/include/llvm/Intrinsics.h
diff -u llvm/include/llvm/Intrinsics.h:1.40 llvm/include/llvm/Intrinsics.h:1.41
--- llvm/include/llvm/Intrinsics.h:1.40 Sat Mar 25 00:32:07 2006
+++ llvm/include/llvm/Intrinsics.h Wed Feb 7 14:38:26 2007
@@ -18,6 +18,10 @@
namespace llvm {
+class FunctionType;
+class Function;
+class Module;
+
/// Intrinsic Namespace - This namespace contains an enum with a value for
/// every intrinsic/builtin function known by LLVM. These enum values are
/// returned by Function::getIntrinsicID().
@@ -36,6 +40,15 @@
/// Intrinsic::getName(ID) - Return the LLVM name for an intrinsic, such as
/// "llvm.ppc.altivec.lvx".
const char *getName(ID id);
+
+ /// Intrinsic::getType(ID) - Return the function type for an intrinsic.
+ ///
+ const FunctionType *getType(ID id);
+
+ /// Intrinsic::getDeclaration(M, ID) - Create or insert an LLVM Function
+ /// declaration for an intrinsic, and return it.
+ Function *getDeclaration(Module *M, ID id);
+
} // End Intrinsic namespace
} // End llvm namespace
Index: llvm/include/llvm/Intrinsics.td
diff -u llvm/include/llvm/Intrinsics.td:1.43 llvm/include/llvm/Intrinsics.td:1.44
--- llvm/include/llvm/Intrinsics.td:1.43 Tue Feb 6 12:19:44 2007
+++ llvm/include/llvm/Intrinsics.td Wed Feb 7 14:38:26 2007
@@ -68,6 +68,15 @@
LLVMType ElTy = elty;
}
+class LLVMPointerType<LLVMType elty>
+ : LLVMType<iPTR, "Type::PointerTyID">{
+ LLVMType ElTy = elty;
+}
+
+class LLVMEmptyStructType
+ : LLVMType<OtherVT, "Type::StructTyID">{
+}
+
def llvm_void_ty : LLVMType<isVoid, "Type::VoidTyID">;
def llvm_bool_ty : LLVMIntegerType<i1, 1>;
def llvm_i8_ty : LLVMIntegerType<i8 , 8>;
@@ -76,9 +85,10 @@
def llvm_i64_ty : LLVMIntegerType<i64, 64>;
def llvm_float_ty : LLVMType<f32, "Type::FloatTyID">;
def llvm_double_ty : LLVMType<f64, "Type::DoubleTyID">;
-def llvm_ptr_ty : LLVMType<iPTR, "Type::PointerTyID">; // i8*
-def llvm_ptrptr_ty : LLVMType<iPTR, "Type::PointerTyID">; // i8**
-def llvm_descriptor_ty : LLVMType<iPTR, "Type::PointerTyID">; // global*
+def llvm_ptr_ty : LLVMPointerType<llvm_i8_ty>; // i8*
+def llvm_ptrptr_ty : LLVMPointerType<llvm_ptr_ty>; // i8**
+def llvm_empty_ty : LLVMEmptyStructType; // { }
+def llvm_descriptor_ty : LLVMPointerType<llvm_empty_ty>; // { }*
def llvm_v16i8_ty : LLVMPackedType<v16i8,16, llvm_i8_ty>; // 16 x i8
def llvm_v8i16_ty : LLVMPackedType<v8i16, 8, llvm_i16_ty>; // 8 x i16
@@ -123,10 +133,10 @@
//===--------------- Variable Argument Handling Intrinsics ----------------===//
//
-def int_vastart : Intrinsic<[llvm_void_ty, llvm_ptrptr_ty], [], "llvm.va_start">;
-def int_vacopy : Intrinsic<[llvm_void_ty, llvm_ptrptr_ty, llvm_ptrptr_ty], [],
+def int_vastart : Intrinsic<[llvm_void_ty, llvm_ptr_ty], [], "llvm.va_start">;
+def int_vacopy : Intrinsic<[llvm_void_ty, llvm_ptr_ty, llvm_ptr_ty], [],
"llvm.va_copy">;
-def int_vaend : Intrinsic<[llvm_void_ty, llvm_ptrptr_ty], [], "llvm.va_end">;
+def int_vaend : Intrinsic<[llvm_void_ty, llvm_ptr_ty], [], "llvm.va_end">;
//===------------------- Garbage Collection Intrinsics --------------------===//
//
@@ -216,7 +226,7 @@
def int_dbg_region_start : Intrinsic<[llvm_void_ty, llvm_descriptor_ty]>;
def int_dbg_region_end : Intrinsic<[llvm_void_ty, llvm_descriptor_ty]>;
def int_dbg_func_start : Intrinsic<[llvm_void_ty, llvm_descriptor_ty]>;
-def int_dbg_declare : Intrinsic<[llvm_void_ty, llvm_ptr_ty,
+def int_dbg_declare : Intrinsic<[llvm_void_ty, llvm_descriptor_ty,
llvm_descriptor_ty]>;
//===------------------ Exception Handling Intrinsics----------------------===//
More information about the llvm-commits
mailing list