Add helpers for fetching basic types.
authorOwen Anderson <resistor@mac.com>
Fri, 14 Aug 2009 00:30:41 +0000 (00:30 +0000)
committerOwen Anderson <resistor@mac.com>
Fri, 14 Aug 2009 00:30:41 +0000 (00:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78969 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/IRBuilder.h

index e216d4c9566b4e373352e88831c8c42ace790dea..549b89eda5255934304106b492be04388a3d0065 100644 (file)
@@ -123,6 +123,42 @@ public:
       I->setName(Name);
   }
 
+  //===--------------------------------------------------------------------===//
+  // Type creation methods
+  //===--------------------------------------------------------------------===//
+
+  const Type *getInt1Ty() {
+    return Type::getInt1Ty(Context);
+  }
+  
+  const Type *getInt8Ty() {
+    return Type::getInt8Ty(Context);
+  }
+  
+  const Type *getInt16Ty() {
+    return Type::getInt16Ty(Context);
+  }
+  
+  const Type *getInt32Ty() {
+    return Type::getInt32Ty(Context);
+  }
+  
+  const Type *getInt64Ty() {
+    return Type::getInt64Ty(Context);
+  }
+
+  const Type *getFloatTy() {
+    return Type::getFloatTy(Context);
+  }
+  
+  const Type *getDoubleTy() {
+    return Type::getDoubleTy(Context);
+  }
+  
+  const Type *getVoidTy() {
+    return Type::getVoidTy(Context);
+  }
+
   //===--------------------------------------------------------------------===//
   // Instruction creation methods: Terminators
   //===--------------------------------------------------------------------===//