diff options
| author | Manuel Klimek <klimek@google.com> | 2015-02-24 09:06:28 +0000 |
|---|---|---|
| committer | Manuel Klimek <klimek@google.com> | 2015-02-24 09:06:28 +0000 |
| commit | 7906f139c3adf797c8f1a8ec3a287682dec0176b (patch) | |
| tree | b6a66de5eb3c55738a71b1f3214214ab04971d61 /clang/lib/AST | |
| parent | cf51397c4872807e10d5ed3a55999693406eb2ae (diff) | |
| download | bcm5719-llvm-7906f139c3adf797c8f1a8ec3a287682dec0176b.tar.gz bcm5719-llvm-7906f139c3adf797c8f1a8ec3a287682dec0176b.zip | |
Fix codegen for virtual methods that are (re-) exported from multiple modules.
Fixes multiple crashes where a non-canonical decl would be used as key
in a lookup.
llvm-svn: 230314
Diffstat (limited to 'clang/lib/AST')
| -rw-r--r-- | clang/lib/AST/VTableBuilder.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/AST/VTableBuilder.cpp b/clang/lib/AST/VTableBuilder.cpp index ddb1f057ac8..c0777e08c9f 100644 --- a/clang/lib/AST/VTableBuilder.cpp +++ b/clang/lib/AST/VTableBuilder.cpp @@ -411,7 +411,8 @@ void FinalOverriders::dump(raw_ostream &Out, BaseSubobject Base, for (const auto *MD : RD->methods()) { if (!MD->isVirtual()) continue; - + MD = MD->getCanonicalDecl(); + OverriderInfo Overrider = getOverrider(MD, Base.getBaseOffset()); Out << " "; @@ -695,6 +696,7 @@ void VCallAndVBaseOffsetBuilder::AddVCallOffsets(BaseSubobject Base, for (const auto *MD : RD->methods()) { if (!MD->isVirtual()) continue; + MD = MD->getCanonicalDecl(); CharUnits OffsetOffset = getCurrentOffsetOffset(); @@ -1514,6 +1516,7 @@ void ItaniumVTableBuilder::AddMethods( for (const auto *MD : RD->methods()) { if (!MD->isVirtual()) continue; + MD = MD->getCanonicalDecl(); // Get the final overrider. FinalOverriders::OverriderInfo Overrider = @@ -2196,6 +2199,7 @@ void ItaniumVTableBuilder::dumpLayout(raw_ostream &Out) { // We only want virtual member functions. if (!MD->isVirtual()) continue; + MD = MD->getCanonicalDecl(); std::string MethodName = PredefinedExpr::ComputeName(PredefinedExpr::PrettyFunctionNoVirtual, |

