/// isLiteral - Return true if this type is uniqued by structural
/// equivalence, false if it is a struct definition.
- bool isLiteral() const {return (getSubclassData() & SCDB_IsLiteral) != 0;}
+ bool isLiteral() const { return (getSubclassData() & SCDB_IsLiteral) != 0; }
/// isOpaque - Return true if this is a type with an identity that has no body
/// specified yet. These prints as 'opaque' in .ll files.
//===----------------------------------------------------------------------===//
// 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);
}
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) {