diff options
Diffstat (limited to 'clang')
-rw-r--r-- | clang/NOTES.txt | 11 | ||||
-rw-r--r-- | clang/lib/CodeGen/CGClass.cpp | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/clang/NOTES.txt b/clang/NOTES.txt index 9f7ed4b9591..ca46d1cae47 100644 --- a/clang/NOTES.txt +++ b/clang/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. + +//===---------------------------------------------------------------------===// diff --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp index b452c1b7ab4..6303e2069d5 100644 --- a/clang/lib/CodeGen/CGClass.cpp +++ b/clang/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); |