[cfe-commits] r153722 - in /cfe/trunk: NOTES.txt lib/CodeGen/CGClass.cpp
John McCall
rjmccall at apple.com
Thu Mar 29 21:25:04 PDT 2012
Author: rjmccall
Date: Thu Mar 29 23:25:03 2012
New Revision: 153722
URL: http://llvm.org/viewvc/llvm-project?rev=153722&view=rev
Log:
Add a note about a missing optimization in the case of virtual
inheritance.
Modified:
cfe/trunk/NOTES.txt
cfe/trunk/lib/CodeGen/CGClass.cpp
Modified: cfe/trunk/NOTES.txt
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/NOTES.txt?rev=153722&r1=153721&r2=153722&view=diff
==============================================================================
--- cfe/trunk/NOTES.txt (original)
+++ cfe/trunk/NOTES.txt Thu Mar 29 23:25:03 2012
@@ -101,3 +101,14 @@
metaprogramming.
//===---------------------------------------------------------------------===//
+
+We can still apply a modified version of the constructor/destructor
+delegation optimization in cases of virtual inheritance where:
+ - there is no function-try-block,
+ - the constructor signature is not variadic, and
+ - the parameter variables can safely be copied and repassed
+ to the base constructor because either
+ - they have not had their addresses taken by the vbase initializers or
+ - they were passed indirectly.
+
+//===---------------------------------------------------------------------===//
Modified: cfe/trunk/lib/CodeGen/CGClass.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGClass.cpp?rev=153722&r1=153721&r2=153722&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGClass.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGClass.cpp Thu Mar 29 23:25:03 2012
@@ -731,6 +731,9 @@
EHScopeStack::stable_iterator CleanupDepth = EHStack.stable_begin();
+ // TODO: in restricted cases, we can emit the vbase initializers of
+ // a complete ctor and then delegate to the base ctor.
+
// Emit the constructor prologue, i.e. the base and member
// initializers.
EmitCtorPrologue(Ctor, CtorType, Args);
More information about the cfe-commits
mailing list