[llvm-commits] [llvm] r137470 - in /llvm/trunk: include/llvm/DerivedTypes.h lib/VMCore/Type.cpp

Chris Lattner sabre at nondot.org
Fri Aug 12 10:43:05 PDT 2011


Author: lattner
Date: Fri Aug 12 12:43:05 2011
New Revision: 137470

URL: http://llvm.org/viewvc/llvm-project?rev=137470&view=rev
Log:
add two missing function impls


Modified:
    llvm/trunk/include/llvm/DerivedTypes.h
    llvm/trunk/lib/VMCore/Type.cpp

Modified: llvm/trunk/include/llvm/DerivedTypes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DerivedTypes.h?rev=137470&r1=137469&r2=137470&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DerivedTypes.h (original)
+++ llvm/trunk/include/llvm/DerivedTypes.h Fri Aug 12 12:43:05 2011
@@ -256,7 +256,7 @@
   
   /// 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.

Modified: llvm/trunk/lib/VMCore/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Type.cpp?rev=137470&r1=137469&r2=137470&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Type.cpp (original)
+++ llvm/trunk/lib/VMCore/Type.cpp Fri Aug 12 12:43:05 2011
@@ -461,6 +461,13 @@
 //===----------------------------------------------------------------------===//
 // 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 @@
   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) {





More information about the llvm-commits mailing list