[cfe-dev] Clang-Cl and Coroutines

Gaier, Bjoern via cfe-dev cfe-dev at lists.llvm.org
Wed Jan 2 06:43:06 PST 2019


Hey,

Seems like... I found a workaround... At least I was able to run co_return and co_yield now...
Basically I just copied the header from Microsoft implementing the feature and replaced certain lines of code with the builtins...

I would still be interested in replies to this - maybe I oversaw something or so?

Kind greetings
Björn

From: cfe-dev <cfe-dev-bounces at lists.llvm.org> On Behalf Of Gaier, Bjoern via cfe-dev
Sent: Mittwoch, 2. Januar 2019 13:38
To: cfe-dev at lists.llvm.org
Subject: [cfe-dev] Clang-Cl and Coroutines

Hey Clang-Team,

I'm a big fan of the Clang-cl compiler and its integration into VisualStudio2017 - I use it for private projects and even try to establish the compiler in my company.

Today I tried diving into Coroutines - a C++20 feature if I'm not mistaken. I followed a simple tutorial and created a source file, which I will attach to this mail.
Compiling this file with Clang-cl leads to a linker error: "unresolved external symbol _coro_destroy"

For me _coro_destoy seems to be the intrinsic for "__builtin_coro_destory" so I made a define statement to replace _coro_destory with the builtin function from Clang. That compiles! But calling the function will lead to a crash...

So I decided to go another way, I used the define statement to replace _coro_destory with an external function "_coro_destory2" - I generated an object file with that function, simply calling the _coro_destory intrinsic inside - compiled with MSVC2017. Sadly... this crashes as well...

When I compile the code with the VisualStudio compiler, then it works.

Long story short: can't I use Coroutines in Clang-cl? Or in a Visual Studio project with Clan-cl?

Kind greetings
Björn
Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr. DE 114 165 789 Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko Lampert, Takashi Nagano, Takeshi Fukushima. Junichi Tajika
Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr. DE 114 165 789 Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko Lampert, Takashi Nagano, Takeshi Fukushima. Junichi Tajika
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190102/f4be9f70/attachment.html>


More information about the cfe-dev mailing list