[llvm-commits] [dragonegg] r129244 - in /dragonegg/trunk: Types.cpp include/dragonegg/Internals.h

Duncan Sands baldrick at free.fr
Sun Apr 10 07:03:14 PDT 2011


Author: baldrick
Date: Sun Apr 10 09:03:14 2011
New Revision: 129244

URL: http://llvm.org/viewvc/llvm-project?rev=129244&view=rev
Log:
Allow isSequentialCompatible to be applied to vector types.

Modified:
    dragonegg/trunk/Types.cpp
    dragonegg/trunk/include/dragonegg/Internals.h

Modified: dragonegg/trunk/Types.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/Types.cpp?rev=129244&r1=129243&r2=129244&view=diff
==============================================================================
--- dragonegg/trunk/Types.cpp (original)
+++ dragonegg/trunk/Types.cpp Sun Apr 10 09:03:14 2011
@@ -253,13 +253,14 @@
          TREE_CODE(TYPE_SIZE(Type)) != INTEGER_CST;
 }
 
-/// isSequentialCompatible - Return true if the specified gcc array or pointer
-/// type and the corresponding LLVM SequentialType lay out their components
+/// isSequentialCompatible - Return true if the specified gcc array, pointer or
+/// vector type and the corresponding LLVM SequentialType lay out their elements
 /// identically in memory, so doing a GEP accesses the right memory location.
 /// We assume that objects without a known size do not.
 bool isSequentialCompatible(tree type) {
   assert((TREE_CODE(type) == ARRAY_TYPE ||
           TREE_CODE(type) == POINTER_TYPE ||
+          TREE_CODE(type) == VECTOR_TYPE ||
           TREE_CODE(type) == REFERENCE_TYPE) && "not a sequential type!");
   // This relies on gcc types with constant size mapping to LLVM types with the
   // same size.  It is possible for the component type not to have a size:

Modified: dragonegg/trunk/include/dragonegg/Internals.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/include/dragonegg/Internals.h?rev=129244&r1=129243&r2=129244&view=diff
==============================================================================
--- dragonegg/trunk/include/dragonegg/Internals.h (original)
+++ dragonegg/trunk/include/dragonegg/Internals.h Sun Apr 10 09:03:14 2011
@@ -287,8 +287,8 @@
 /// thing by value, pass the address of a temporary.
 bool isPassedByInvisibleReference(tree_node *type);
 
-/// isSequentialCompatible - Return true if the specified gcc array or pointer
-/// type and the corresponding LLVM SequentialType lay out their components
+/// isSequentialCompatible - Return true if the specified gcc array, pointer or
+/// vector type and the corresponding LLVM SequentialType lay out their elements
 /// identically in memory, so doing a GEP accesses the right memory location.
 /// We assume that objects without a known size do not.
 extern bool isSequentialCompatible(tree_node *type);





More information about the llvm-commits mailing list