From: Timur Iskhodzhanov Date: Mon, 26 Aug 2013 10:32:04 +0000 (+0000) Subject: Fix virtual destructor mangling when using "-cxx-abi microsoft" on x64 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4b104067143cd97e954d279ddc42ed03bbe86a08;p=clang Fix virtual destructor mangling when using "-cxx-abi microsoft" on x64 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189214 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/MicrosoftMangle.cpp b/lib/AST/MicrosoftMangle.cpp index d9e18eb067..cb93f070ff 100644 --- a/lib/AST/MicrosoftMangle.cpp +++ b/lib/AST/MicrosoftMangle.cpp @@ -1294,7 +1294,7 @@ void MicrosoftCXXNameMangler::mangleFunctionType(const FunctionType *T, // However, the FunctionType generated has 0 arguments. // FIXME: This is a temporary hack. // Maybe should fix the FunctionType creation instead? - Out << "PAXI@Z"; + Out << (PointersAre64Bit ? "PEAXI@Z" : "PAXI@Z"); return; } Out << '@'; diff --git a/test/CodeGenCXX/microsoft-abi-structors.cpp b/test/CodeGenCXX/microsoft-abi-structors.cpp index 95752752f3..10308353b4 100644 --- a/test/CodeGenCXX/microsoft-abi-structors.cpp +++ b/test/CodeGenCXX/microsoft-abi-structors.cpp @@ -3,6 +3,8 @@ // vftables are emitted very late, so do another pass to try to keep the checks // in source order. // RUN: FileCheck --check-prefix DTORS %s < %t +// +// RUN: %clang_cc1 -emit-llvm %s -o - -cxx-abi microsoft -triple=x86_64-pc-win32 -fno-rtti | FileCheck --check-prefix DTORS-X64 %s namespace basic { @@ -57,6 +59,9 @@ struct C { // // DTORS: [[CONTINUE_LABEL]] // DTORS-NEXT: ret void + +// Check that we do the mangling correctly on x64. +// DTORS-X64: @"\01??_GC@basic@@UEAAPEAXI@Z" } virtual void foo(); };