diff options
author | Chris Lattner <sabre@nondot.org> | 2011-08-12 17:43:05 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-08-12 17:43:05 +0000 |
commit | f4bbcaabebe19840de27bd414ff79da9219b4bd1 (patch) | |
tree | 5cc707305d4aa1cd1120e313ffbff36c785d3776 /lib/VMCore | |
parent | 2c38d65fd9340b745aeec55acb04819892ed4cb9 (diff) | |
download | llvm-f4bbcaabebe19840de27bd414ff79da9219b4bd1.tar.gz llvm-f4bbcaabebe19840de27bd414ff79da9219b4bd1.tar.bz2 llvm-f4bbcaabebe19840de27bd414ff79da9219b4bd1.tar.xz |
add two missing function impls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137470 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/Type.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/VMCore/Type.cpp b/lib/VMCore/Type.cpp index f7ba59606a..51e6006eee 100644 --- a/lib/VMCore/Type.cpp +++ b/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) { |