Re-introduce the ctor/dtor alias optimization, this time hidden behind a
command-line option which defaults off.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96649 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/CodeGen/CodeGenOptions.h b/include/clang/CodeGen/CodeGenOptions.h
index e1d4ad1..e0e0f77 100644
--- a/include/clang/CodeGen/CodeGenOptions.h
+++ b/include/clang/CodeGen/CodeGenOptions.h
@@ -53,6 +53,8 @@
unsigned UnwindTables : 1; /// Emit unwind tables.
unsigned VerifyModule : 1; /// Control whether the module should be run
/// through the LLVM Verifier.
+ unsigned CXXCtorDtorAliases: 1; /// Emit complete ctors/dtors as linker
+ /// aliases to base ctors when possible.
/// The code model to use (-mcmodel).
std::string CodeModel;
@@ -101,6 +103,7 @@
UnrollLoops = 0;
UnwindTables = 0;
VerifyModule = 1;
+ CXXCtorDtorAliases = 0;
Inlining = NoInlining;
RelocationModel = "pic";
diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td
index 047363e..7cd26ef 100644
--- a/include/clang/Driver/CC1Options.td
+++ b/include/clang/Driver/CC1Options.td
@@ -143,6 +143,8 @@
HelpText<"The relocation model to use">;
def munwind_tables : Flag<"-munwind-tables">,
HelpText<"Generate unwinding tables for all functions">;
+def mconstructor_aliases : Flag<"-mconstructor-aliases">,
+ HelpText<"Emit complete constructors and destructors as aliases when possible">;
def O : Joined<"-O">, HelpText<"Optimization level">;
def Os : Flag<"-Os">, HelpText<"Optimize for size">;