Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add a note about a missing optimization in the case of virtual

inheritance.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153722 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information...
commit 56ea377bc58a3a821da917599ed26c6b37b9727c 1 parent 3754f96
@rjmccall rjmccall authored
Showing with 14 additions and 0 deletions.
  1. +11 −0 NOTES.txt
  2. +3 −0  lib/CodeGen/CGClass.cpp
View
11 NOTES.txt
@@ -101,3 +101,14 @@ only if the non-reachability is not due to macro or template
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.
+
+//===---------------------------------------------------------------------===//
View
3  lib/CodeGen/CGClass.cpp
@@ -731,6 +731,9 @@ void CodeGenFunction::EmitConstructorBody(FunctionArgList &Args) {
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);
Please sign in to comment.
Something went wrong with that request. Please try again.