diff options
author | Piotr Padlewski <prazek@google.com> | 2015-09-28 20:30:22 +0000 |
---|---|---|
committer | Piotr Padlewski <prazek@google.com> | 2015-09-28 20:30:22 +0000 |
commit | 69dc971527faad8ccfa754ce7d855908b7a3f923 (patch) | |
tree | 5875e715688ee81da2e5c58edbfe74af52b4aa6a /clang/lib/CodeGen/CGClass.cpp | |
parent | 4b2ca85c1af5f0b237c5e65ea0378c6d374d1aaf (diff) | |
download | llvm-69dc971527faad8ccfa754ce7d855908b7a3f923.zip llvm-69dc971527faad8ccfa754ce7d855908b7a3f923.tar.gz llvm-69dc971527faad8ccfa754ce7d855908b7a3f923.tar.bz2 |
Generate assume loads only with -fstrict-vtable-pointers
Temporary fix till InstCombine and other possible passes will be
efficient to handle multiple assumes.
llvm-svn: 248734
Diffstat (limited to 'clang/lib/CodeGen/CGClass.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGClass.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp index 7d55685..6394d1f 100644 --- a/clang/lib/CodeGen/CGClass.cpp +++ b/clang/lib/CodeGen/CGClass.cpp @@ -2107,9 +2107,12 @@ void CodeGenFunction::EmitCXXConstructorCall(const CXXConstructorDecl *D, // FIXME: If vtable is used by ctor/dtor, or if vtable is external and we are // sure that definition of vtable is not hidden, // then we are always safe to refer to it. + // FIXME: It looks like InstCombine is very inefficient on dealing with + // assumes. Make assumption loads require -fstrict-vtable-pointers temporarily. if (CGM.getCodeGenOpts().OptimizationLevel > 0 && ClassDecl->isDynamicClass() && Type != Ctor_Base && - CGM.getCXXABI().canSpeculativelyEmitVTable(ClassDecl)) + CGM.getCXXABI().canSpeculativelyEmitVTable(ClassDecl) && + CGM.getCodeGenOpts().StrictVTablePointers) EmitVTableAssumptionLoads(ClassDecl, This); } |