r197192 - Revert "[-cxx-abi microsoft] Mangle reference temporaries"

David Majnemer david.majnemer at gmail.com
Thu Dec 12 16:39:39 PST 2013


Author: majnemer
Date: Thu Dec 12 18:39:38 2013
New Revision: 197192

URL: http://llvm.org/viewvc/llvm-project?rev=197192&view=rev
Log:
Revert "[-cxx-abi microsoft] Mangle reference temporaries"

This reverts commit r197184.

Richard Smith brings up some good points, a proper implementation will
require us to mangle unnameable entities compatibly with MSVC.

Modified:
    cfe/trunk/lib/AST/MicrosoftMangle.cpp
    cfe/trunk/test/CodeGenCXX/mangle-ms.cpp

Modified: cfe/trunk/lib/AST/MicrosoftMangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/MicrosoftMangle.cpp?rev=197192&r1=197191&r2=197192&view=diff
==============================================================================
--- cfe/trunk/lib/AST/MicrosoftMangle.cpp (original)
+++ cfe/trunk/lib/AST/MicrosoftMangle.cpp Thu Dec 12 18:39:38 2013
@@ -2040,9 +2040,10 @@ void MicrosoftMangleContextImpl::mangleC
 }
 
 void MicrosoftMangleContextImpl::mangleReferenceTemporary(const VarDecl *VD,
-                                                          raw_ostream &Out) {
-  MicrosoftCXXNameMangler mangler(*this, Out);
-  mangler.mangle(VD);
+                                                          raw_ostream &) {
+  unsigned DiagID = getDiags().getCustomDiagID(DiagnosticsEngine::Error,
+    "cannot mangle this reference temporary yet");
+  getDiags().Report(VD->getLocation(), DiagID);
 }
 
 void MicrosoftMangleContextImpl::mangleStaticGuardVariable(const VarDecl *VD,

Modified: cfe/trunk/test/CodeGenCXX/mangle-ms.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle-ms.cpp?rev=197192&r1=197191&r2=197192&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle-ms.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle-ms.cpp Thu Dec 12 18:39:38 2013
@@ -445,10 +445,3 @@ decltype(a) fun(decltype(a) x, decltype(
 // CHECK-DAG: ?fun at PR18022@@YA?AU<unnamed-type-a>@1 at U21@0 at Z
 
 }
-
-// Binding to a bit-field that requires a temporary.
-struct { int bitfield : 3; } object_with_bitfield = { 3 };
-const int &reference_to_bitfield = object_with_bitfield.bitfield;
-// CHECK-DAG: ?object_with_bitfield@@3U<unnamed-type-object_with_bitfield>@@A
-// CHECK-DAG: ?reference_to_bitfield@@3ABHB
-// CHECK-DAG: ??__Ereference_to_bitfield@@YAXXZ





More information about the cfe-commits mailing list