[llvm-commits] [llvm] r133409 - /llvm/trunk/include/llvm/DerivedTypes.h

Chris Lattner sabre at nondot.org
Sun Jun 19 20:51:04 PDT 2011


Author: lattner
Date: Sun Jun 19 22:51:04 2011
New Revision: 133409

URL: http://llvm.org/viewvc/llvm-project?rev=133409&view=rev
Log:
introduce an isLayoutIdentical() method, which is currently just a pointer
equality check.

Modified:
    llvm/trunk/include/llvm/DerivedTypes.h

Modified: llvm/trunk/include/llvm/DerivedTypes.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DerivedTypes.h?rev=133409&r1=133408&r2=133409&view=diff
==============================================================================
--- llvm/trunk/include/llvm/DerivedTypes.h (original)
+++ llvm/trunk/include/llvm/DerivedTypes.h Sun Jun 19 22:51:04 2011
@@ -232,7 +232,7 @@
   /// StructType::get - This static method is the primary way to create a
   /// StructType.
   ///
-  static StructType *get(LLVMContext &Context, ArrayRef<const Type*> Params,
+  static StructType *get(LLVMContext &Context, ArrayRef<const Type*> Elements,
                          bool isPacked = false);
 
   /// StructType::get - Create an empty structure type.
@@ -256,6 +256,13 @@
   element_iterator element_begin() const { return ContainedTys; }
   element_iterator element_end() const { return &ContainedTys[NumContainedTys];}
 
+  /// isLayoutIdentical - Return true if this is layout identical to the
+  /// specified struct.
+  bool isLayoutIdentical(const StructType *Other) const {
+    return this == Other;
+  }
+  
+  
   // Random access to the elements
   unsigned getNumElements() const { return NumContainedTys; }
   const Type *getElementType(unsigned N) const {





More information about the llvm-commits mailing list