[llvm-commits] [dragonegg] r155121 - in /dragonegg/trunk/src: Constants.cpp Convert.cpp Types.cpp

Duncan Sands baldrick at free.fr
Thu Apr 19 04:57:08 PDT 2012


Author: baldrick
Date: Thu Apr 19 06:57:07 2012
New Revision: 155121

URL: http://llvm.org/viewvc/llvm-project?rev=155121&view=rev
Log:
A few more places that were hit by non-FIELD_DECL nodes amongst the
fields in gcc-4.7.  Shows with 2005-02-13-BadDynamicInit.cpp.

Modified:
    dragonegg/trunk/src/Constants.cpp
    dragonegg/trunk/src/Convert.cpp
    dragonegg/trunk/src/Types.cpp

Modified: dragonegg/trunk/src/Constants.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Constants.cpp?rev=155121&r1=155120&r2=155121&view=diff
==============================================================================
--- dragonegg/trunk/src/Constants.cpp (original)
+++ dragonegg/trunk/src/Constants.cpp Thu Apr 19 06:57:07 2012
@@ -1147,7 +1147,7 @@
     // Record all interesting fields so they can easily be visited backwards.
     SmallVector<tree, 16> Fields;
     for (tree field = TYPE_FIELDS(type); field; field = TREE_CHAIN(field)) {
-      assert(isa<FIELD_DECL>(field) && "Lang data not freed?");
+      if (!isa<FIELD_DECL>(field)) continue;
       // Ignore fields with variable or unknown position since they cannot be
       // default initialized.
       if (!OffsetIsLLVMCompatible(field))

Modified: dragonegg/trunk/src/Convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Convert.cpp?rev=155121&r1=155120&r2=155121&view=diff
==============================================================================
--- dragonegg/trunk/src/Convert.cpp (original)
+++ dragonegg/trunk/src/Convert.cpp Thu Apr 19 06:57:07 2012
@@ -1894,7 +1894,7 @@
     Type *Ty = ConvertType(type);
     unsigned TotalCost = 0;
     for (tree Field = TYPE_FIELDS(type); Field; Field = TREE_CHAIN(Field)) {
-      assert(isa<FIELD_DECL>(Field) && "Lang data not freed?");
+      if (!isa<FIELD_DECL>(Field)) continue;
       // If the field has no size, for example because it is a C-style variable
       // length array, then just give up.
       if (!DECL_SIZE(Field))
@@ -1956,6 +1956,7 @@
 
     // Copy each field in turn.
     for (tree Field = TYPE_FIELDS(type); Field; Field = TREE_CHAIN(Field)) {
+      if (!isa<FIELD_DECL>(Field)) continue;
       // Ignore fields of size zero.
       if (integer_zerop(DECL_SIZE(Field)))
         continue;
@@ -2053,6 +2054,7 @@
 
     // Zero each field in turn.
     for (tree Field = TYPE_FIELDS(type); Field; Field = TREE_CHAIN(Field)) {
+      if (!isa<FIELD_DECL>(Field)) continue;
       // Ignore fields of size zero.
       if (integer_zerop(DECL_SIZE(Field)))
         continue;

Modified: dragonegg/trunk/src/Types.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Types.cpp?rev=155121&r1=155120&r2=155121&view=diff
==============================================================================
--- dragonegg/trunk/src/Types.cpp (original)
+++ dragonegg/trunk/src/Types.cpp Thu Apr 19 06:57:07 2012
@@ -1098,8 +1098,7 @@
   // Record all interesting fields so they can easily be visited backwards.
   SmallVector<tree, 16> Fields;
   for (tree field = TYPE_FIELDS(type); field; field = TREE_CHAIN(field)) {
-    if (!isa<FIELD_DECL>(field))
-      continue;
+    if (!isa<FIELD_DECL>(field)) continue;
     // Ignore fields with variable or unknown position since they cannot be
     // represented by the LLVM type system.
     if (!OffsetIsLLVMCompatible(field))





More information about the llvm-commits mailing list