r210197 - MS-ABI: Implement user defined literals
David Majnemer
david.majnemer at gmail.com
Wed Jun 4 09:46:27 PDT 2014
Author: majnemer
Date: Wed Jun 4 11:46:26 2014
New Revision: 210197
URL: http://llvm.org/viewvc/llvm-project?rev=210197&view=rev
Log:
MS-ABI: Implement user defined literals
Straightforward implementation of UDLs, it's compatible with VS "14".
This nearly completes our implementation of C++ name mangling for the
MS-ABI.
Modified:
cfe/trunk/lib/AST/MicrosoftMangle.cpp
cfe/trunk/test/CodeGenCXX/mangle-ms-cxx11.cpp
Modified: cfe/trunk/lib/AST/MicrosoftMangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/MicrosoftMangle.cpp?rev=210197&r1=210196&r2=210197&view=diff
==============================================================================
--- cfe/trunk/lib/AST/MicrosoftMangle.cpp (original)
+++ cfe/trunk/lib/AST/MicrosoftMangle.cpp Wed Jun 4 11:46:26 2014
@@ -803,11 +803,8 @@ void MicrosoftCXXNameMangler::mangleUnqu
break;
case DeclarationName::CXXLiteralOperatorName: {
- // FIXME: Was this added in VS2010? Does MS even know how to mangle this?
- DiagnosticsEngine &Diags = Context.getDiags();
- unsigned DiagID = Diags.getCustomDiagID(DiagnosticsEngine::Error,
- "cannot mangle this literal operator yet");
- Diags.Report(ND->getLocation(), DiagID);
+ Out << "?__K";
+ mangleSourceName(Name.getCXXLiteralIdentifier()->getName());
break;
}
Modified: cfe/trunk/test/CodeGenCXX/mangle-ms-cxx11.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle-ms-cxx11.cpp?rev=210197&r1=210196&r2=210197&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle-ms-cxx11.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle-ms-cxx11.cpp Wed Jun 4 11:46:26 2014
@@ -130,3 +130,6 @@ void A::foo() __restrict & {}
void A::foo() __restrict && {}
// CHECK-DAG: @"\01?foo at A@PR19361@@QIHAEXXZ"
}
+
+int operator"" _deg(long double) { return 0; }
+// CHECK-DAG: @"\01??__K_deg@@YAHO at Z"
More information about the cfe-commits
mailing list