[PATCH] Abstract out the emission of vtables, add basic support for vtable emission when using -cxx-abi microsoft

Reid Kleckner rnk at google.com
Tue Sep 3 11:39:30 PDT 2013


  LGTM, John can take a look.

  BTW, I don't think CGExprConstant.cpp affects the C++11 constexpr stuff we were talking about earlier today.  It's optimizing dynamic initialization to static initialization.


================
Comment at: include/clang/AST/Mangle.h:109
@@ -108,1 +108,3 @@
                                         raw_ostream &) = 0;
+  // FIXME: Some of these objects only exist in select ABIs. We should probably
+  // only declare them in ABI-specific manglers?
----------------
Timur Iskhodzhanov wrote:
> Reid Kleckner wrote:
> > A MicrosoftMangle.h which only exposes MicrosoftMangleContext and is only included by MicrosoftCXXABI.cpp (ditto for Itanium)?  Sounds like a good separate patch.
> > 
> Would you mind if I do this after landing this?
> Also, it'd be a good time to rename VTable{Context,Builder} -> ItaniumVTable{Context,Builder} then.
Sure.

================
Comment at: lib/AST/VTableBuilder.cpp:3109
@@ +3108,3 @@
+CalculatePathToMangle(const CXXRecordDecl *RD, VFPtrInfo &VFPtr) {
+  // FIXME: In some rare cases this code produces a bit incorrect mangling.
+  // It's very likely that the vbtable mangling code can be adjusted to mangle
----------------
s/a bit/a slightly/

================
Comment at: lib/AST/VTableBuilder.cpp:3106
@@ +3105,3 @@
+/// to mangle the vftable for the given vfptr.
+/// Should only be called if a class has more than one vftables.
+static void
----------------
"one vftable" or "multiple vftables"

================
Comment at: lib/CodeGen/CGDebugInfo.cpp:1074
@@ +1073,3 @@
+    // FIXME: Add proper support for virtual calls in the Microsoft ABI,
+    // where we may use various vptrs to make a vftable lookup.
+    if (!isa<CXXDestructorDecl>(Method) &&
----------------
The Microsoft ABI doesn't use "various" vptrs, does it?  It just uses a different one?


http://llvm-reviews.chandlerc.com/D1532



More information about the cfe-commits mailing list