summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-08-12 17:43:05 +0000
committerChris Lattner <sabre@nondot.org>2011-08-12 17:43:05 +0000
commit8a2f747546c303cfec8bb4b013c45c915ea7e27f (patch)
tree10daf7a23e816e4423ab58bf46c3aee857577e7e /llvm/lib
parent26a9d23657ace855c0f8f67d33f7c0e4f56a47be (diff)
downloadbcm5719-llvm-8a2f747546c303cfec8bb4b013c45c915ea7e27f.tar.gz
bcm5719-llvm-8a2f747546c303cfec8bb4b013c45c915ea7e27f.zip
add two missing function impls
llvm-svn: 137470
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/VMCore/Type.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/VMCore/Type.cpp b/llvm/lib/VMCore/Type.cpp
index f7ba59606ab..51e6006eee4 100644
--- a/llvm/lib/VMCore/Type.cpp
+++ b/llvm/lib/VMCore/Type.cpp
@@ -461,6 +461,13 @@ void StructType::setName(StringRef Name) {
//===----------------------------------------------------------------------===//
// StructType Helper functions.
+StructType *StructType::create(LLVMContext &Context, StringRef Name) {
+ StructType *ST = new (Context.pImpl->TypeAllocator) StructType(Context);
+ if (!Name.empty())
+ ST->setName(Name);
+ return ST;
+}
+
StructType *StructType::get(LLVMContext &Context, bool isPacked) {
return get(Context, llvm::ArrayRef<Type*>(), isPacked);
}
@@ -489,6 +496,10 @@ StructType *StructType::create(LLVMContext &Context, ArrayRef<Type*> Elements) {
return create(Context, Elements, StringRef());
}
+StructType *StructType::create(LLVMContext &Context) {
+ return create(Context, ArrayRef<Type*>(), StringRef());
+}
+
StructType *StructType::create(ArrayRef<Type*> Elements, StringRef Name,
bool isPacked) {
OpenPOWER on IntegriCloud