diff options
author | Reid Kleckner <rnk@google.com> | 2018-05-17 18:12:18 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2018-05-17 18:12:18 +0000 |
commit | 138ab4947c408ab849c7c27b5037ed7c2100e50f (patch) | |
tree | db828f9bd99143463a9c3671dfc2c55984d114f0 /clang/lib/CodeGen/ItaniumCXXABI.cpp | |
parent | 5c48b73fffcde5f9dd41fc51b2372b1d88e562bb (diff) | |
download | bcm5719-llvm-138ab4947c408ab849c7c27b5037ed7c2100e50f.tar.gz bcm5719-llvm-138ab4947c408ab849c7c27b5037ed7c2100e50f.zip |
Fix a mangling failure on clang-cl C++17
MethodVFTableLocations in MigrosoftVTableContext contains canonicalized
decl. But, it's sometimes asked to lookup for non-canonicalized decl,
and that causes assertion failure, and compilation failure.
Fixes PR37481.
Patch by Taiju Tsuiki!
Differential Revision: https://reviews.llvm.org/D46929
llvm-svn: 332639
Diffstat (limited to 'clang/lib/CodeGen/ItaniumCXXABI.cpp')
-rw-r--r-- | clang/lib/CodeGen/ItaniumCXXABI.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/ItaniumCXXABI.cpp b/clang/lib/CodeGen/ItaniumCXXABI.cpp index e7d4d8ac295..c77644b56a5 100644 --- a/clang/lib/CodeGen/ItaniumCXXABI.cpp +++ b/clang/lib/CodeGen/ItaniumCXXABI.cpp @@ -825,7 +825,6 @@ ItaniumCXXABI::EmitMemberFunctionPointer(const CXXMethodDecl *MD) { llvm::Constant *ItaniumCXXABI::BuildMemberPointer(const CXXMethodDecl *MD, CharUnits ThisAdjustment) { assert(MD->isInstance() && "Member function must not be static!"); - MD = MD->getCanonicalDecl(); CodeGenTypes &Types = CGM.getTypes(); @@ -1640,7 +1639,6 @@ CGCallee ItaniumCXXABI::getVirtualFunctionPointer(CodeGenFunction &CGF, Address This, llvm::Type *Ty, SourceLocation Loc) { - GD = GD.getCanonicalDecl(); Ty = Ty->getPointerTo()->getPointerTo(); auto *MethodDecl = cast<CXXMethodDecl>(GD.getDecl()); llvm::Value *VTable = CGF.GetVTablePtr(This, Ty, MethodDecl->getParent()); @@ -1674,7 +1672,7 @@ CGCallee ItaniumCXXABI::getVirtualFunctionPointer(CodeGenFunction &CGF, VFunc = VFuncLoad; } - CGCallee Callee(MethodDecl, VFunc); + CGCallee Callee(MethodDecl->getCanonicalDecl(), VFunc); return Callee; } |