summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-04-13 01:39:07 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-04-13 01:39:07 +0000
commitd33749b4a91c36c71fc493b4b5072cea2dea7433 (patch)
tree463f9e877d390892388ab927d95c23dd6a95aee6
parente0a355af5dd9a04fa019d8fc4cb607748d318d39 (diff)
downloadbcm5719-llvm-d33749b4a91c36c71fc493b4b5072cea2dea7433.tar.gz
bcm5719-llvm-d33749b4a91c36c71fc493b4b5072cea2dea7433.zip
VMCore: Add Type::getIntN[Ptr]Ty, which are the obvious generic forms of
Type::getInt{1,8,...}[Ptr]Ty, so code can consistently use the methods on Type without occasionally needed to call IntegerType::get. llvm-svn: 101111
-rw-r--r--llvm/include/llvm/Type.h3
-rw-r--r--llvm/lib/VMCore/Type.cpp8
2 files changed, 11 insertions, 0 deletions
diff --git a/llvm/include/llvm/Type.h b/llvm/include/llvm/Type.h
index df3a16c5926..52229acb323 100644
--- a/llvm/include/llvm/Type.h
+++ b/llvm/include/llvm/Type.h
@@ -406,6 +406,7 @@ public:
static const Type *getX86_FP80Ty(LLVMContext &C);
static const Type *getFP128Ty(LLVMContext &C);
static const Type *getPPC_FP128Ty(LLVMContext &C);
+ static const IntegerType *getIntNTy(LLVMContext &C, unsigned N);
static const IntegerType *getInt1Ty(LLVMContext &C);
static const IntegerType *getInt8Ty(LLVMContext &C);
static const IntegerType *getInt16Ty(LLVMContext &C);
@@ -421,6 +422,8 @@ public:
static const PointerType *getX86_FP80PtrTy(LLVMContext &C, unsigned AS = 0);
static const PointerType *getFP128PtrTy(LLVMContext &C, unsigned AS = 0);
static const PointerType *getPPC_FP128PtrTy(LLVMContext &C, unsigned AS = 0);
+ static const PointerType *getIntNPtrTy(LLVMContext &C, unsigned N,
+ unsigned AS = 0);
static const PointerType *getInt1PtrTy(LLVMContext &C, unsigned AS = 0);
static const PointerType *getInt8PtrTy(LLVMContext &C, unsigned AS = 0);
static const PointerType *getInt16PtrTy(LLVMContext &C, unsigned AS = 0);
diff --git a/llvm/lib/VMCore/Type.cpp b/llvm/lib/VMCore/Type.cpp
index 5f9c11fc0ed..845b523c242 100644
--- a/llvm/lib/VMCore/Type.cpp
+++ b/llvm/lib/VMCore/Type.cpp
@@ -380,6 +380,10 @@ const Type *Type::getPPC_FP128Ty(LLVMContext &C) {
return &C.pImpl->PPC_FP128Ty;
}
+const IntegerType *Type::getIntNTy(LLVMContext &C, unsigned N) {
+ return IntegerType::get(C, N);
+}
+
const IntegerType *Type::getInt1Ty(LLVMContext &C) {
return &C.pImpl->Int1Ty;
}
@@ -420,6 +424,10 @@ const PointerType *Type::getPPC_FP128PtrTy(LLVMContext &C, unsigned AS) {
return getPPC_FP128Ty(C)->getPointerTo(AS);
}
+const PointerType *Type::getIntNPtrTy(LLVMContext &C, unsigned N, unsigned AS) {
+ return getIntNTy(C, N)->getPointerTo(AS);
+}
+
const PointerType *Type::getInt1PtrTy(LLVMContext &C, unsigned AS) {
return getInt1Ty(C)->getPointerTo(AS);
}
OpenPOWER on IntegriCloud