[PATCH] D25045: [Coroutines] Add proper mangling for operator co_await for MicrosoftABI
Gor Nishanov via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 28 15:46:12 PDT 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL282645: [Coroutines] Add proper mangling for operator co_await for MicrosoftABI (authored by GorNishanov).
Changed prior to commit:
https://reviews.llvm.org/D25045?vs=72900&id=72916#toc
Repository:
rL LLVM
https://reviews.llvm.org/D25045
Files:
cfe/trunk/lib/AST/MicrosoftMangle.cpp
cfe/trunk/test/CodeGenCoroutines/microsoft-abi-operator-coawait.cpp
Index: cfe/trunk/test/CodeGenCoroutines/microsoft-abi-operator-coawait.cpp
===================================================================
--- cfe/trunk/test/CodeGenCoroutines/microsoft-abi-operator-coawait.cpp
+++ cfe/trunk/test/CodeGenCoroutines/microsoft-abi-operator-coawait.cpp
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -triple x86_64-pc-windows-msvc18.0.0 -fcoroutines -emit-llvm %s -o - -std=c++14 -disable-llvm-passes | FileCheck %s
+struct no_suspend {
+ bool await_ready() { return true; }
+ template <typename F> void await_suspend(F) {}
+ void await_resume() {}
+};
+
+struct A {
+ no_suspend operator co_await() { return {}; }
+};
+
+struct B {};
+
+no_suspend operator co_await(B const&) { return {}; }
+
+// CHECK-LABEL: f(
+extern "C" void f() {
+ A a;
+ B b;
+ // CHECK: call void @"\01??__LA@@QEAA?AUno_suspend@@XZ"(
+ a.operator co_await();
+ // CHECK-NEXT: call i8 @"\01??__L at YA?AUno_suspend@@AEBUB@@@Z"(
+ operator co_await(b);
+}
+
Index: cfe/trunk/lib/AST/MicrosoftMangle.cpp
===================================================================
--- cfe/trunk/lib/AST/MicrosoftMangle.cpp
+++ cfe/trunk/lib/AST/MicrosoftMangle.cpp
@@ -1089,6 +1089,8 @@
case OO_Array_New: Out << "?_U"; break;
// <operator-name> ::= ?_V # delete[]
case OO_Array_Delete: Out << "?_V"; break;
+ // <operator-name> ::= ?__L # co_await
+ case OO_Coawait: Out << "?__L"; break;
case OO_Conditional: {
DiagnosticsEngine &Diags = Context.getDiags();
@@ -1098,14 +1100,6 @@
break;
}
- case OO_Coawait: {
- DiagnosticsEngine &Diags = Context.getDiags();
- unsigned DiagID = Diags.getCustomDiagID(DiagnosticsEngine::Error,
- "cannot mangle this operator co_await yet");
- Diags.Report(Loc, DiagID);
- break;
- }
-
case OO_None:
case NUM_OVERLOADED_OPERATORS:
llvm_unreachable("Not an overloaded operator");
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25045.72916.patch
Type: text/x-patch
Size: 1870 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160928/0503ee78/attachment-0001.bin>
More information about the cfe-commits
mailing list