Check in the beginnings of my new vtable layout builder idea.
Right now, it's off by default but can be tested by passing -fdump-vtable-layouts to clang -cc1. This option will cause all vtables that will normally be emitted as part of codegen to also be dumped using the new layout code.
I've also added a very simple new vtable layout test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95865 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/Basic/LangOptions.h b/include/clang/Basic/LangOptions.h
index 1172206..d909f83 100644
--- a/include/clang/Basic/LangOptions.h
+++ b/include/clang/Basic/LangOptions.h
@@ -97,7 +97,9 @@
// operators
unsigned ElideConstructors : 1; // Whether C++ copy constructors should be
// elided if possible.
- unsigned CatchUndefined :1; // Generate code to check for undefined ops.
+ unsigned CatchUndefined : 1; // Generate code to check for undefined ops.
+ unsigned DumpVtableLayouts : 1; // Dump the layouts of all the emitted
+ // vtables.
private:
unsigned GC : 2; // Objective-C Garbage Collection modes. We
// declare this enum as unsigned because MSVC
@@ -168,6 +170,7 @@
CharIsSigned = 1;
ShortWChar = 0;
CatchUndefined = 0;
+ DumpVtableLayouts = 0;
}
GCMode getGCMode() const { return (GCMode) GC; }
diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td
index a235fa7..eac6e07 100644
--- a/include/clang/Driver/CC1Options.td
+++ b/include/clang/Driver/CC1Options.td
@@ -117,6 +117,8 @@
HelpText<"Disallow merging of constants.">;
def fno_threadsafe_statics : Flag<"-fno-threadsafe-statics">,
HelpText<"Do not emit code to make initialization of local statics thread safe">;
+def fdump_vtable_layouts : Flag<"-fdump-vtable-layouts">,
+ HelpText<"Dump the layouts of all vtables that will be emitted in a translation unit">;
def masm_verbose : Flag<"-masm-verbose">,
HelpText<"Generate verbose assembly output">;
def mcode_model : Separate<"-mcode-model">,