[PATCH] Fix ARM HVA classification of classes with non-virtual bases

Reid Kleckner rnk at google.com
Thu Oct 30 17:40:40 PDT 2014


================
Comment at: lib/CodeGen/CGCall.cpp:592-596
@@ +591,7 @@
+
+  for (const auto *FD : RD->fields()) {
+    assert(!FD->isBitField() &&
+           "Cannot expand structure with bit-field members.");
+    Fields.push_back(FD);
+  }
+}
----------------
Crud, this is incorrect. We need to know which base class has the field so we can do the adjustment for non-primary bases. This code ends up passing the `x` field twice and losing the `y` field:

  struct B1 { double x; };
  struct B2 { double y; };
  struct D : B1, B2 { double z; };
  void f(D d) {}

http://reviews.llvm.org/D6045






More information about the cfe-commits mailing list