r197184 - [-cxx-abi microsoft] Mangle reference temporaries

David Majnemer david.majnemer at gmail.com
Thu Dec 12 15:12:01 PST 2013


Author: majnemer
Date: Thu Dec 12 17:12:01 2013
New Revision: 197184

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

They are mangled the same as normal references, nothing special is going
on here.

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=197184&r1=197183&r2=197184&view=diff
==============================================================================
--- cfe/trunk/lib/AST/MicrosoftMangle.cpp (original)
+++ cfe/trunk/lib/AST/MicrosoftMangle.cpp Thu Dec 12 17:12:01 2013
@@ -2040,10 +2040,9 @@ void MicrosoftMangleContextImpl::mangleC
 }
 
 void MicrosoftMangleContextImpl::mangleReferenceTemporary(const VarDecl *VD,
-                                                          raw_ostream &) {
-  unsigned DiagID = getDiags().getCustomDiagID(DiagnosticsEngine::Error,
-    "cannot mangle this reference temporary yet");
-  getDiags().Report(VD->getLocation(), DiagID);
+                                                          raw_ostream &Out) {
+  MicrosoftCXXNameMangler mangler(*this, Out);
+  mangler.mangle(VD);
 }
 
 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=197184&r1=197183&r2=197184&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle-ms.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle-ms.cpp Thu Dec 12 17:12:01 2013
@@ -445,3 +445,10 @@ 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