add two missing function impls

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137470 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2011-08-12 17:43:05 +00:00
parent 2c38d65fd9
commit f4bbcaabeb
2 changed files with 12 additions and 1 deletions

View File

@@ -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) {