[PATCH] D77962: PR38490: Support reading values out of __uuidof(X) expressions during constant evaluation.

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 13 13:00:08 PDT 2020


rnk added a comment.

Thanks for looking into this.

This code is very string-y. Should clang be parsing uuids into u32-u16-u16-u8[8] earlier, so that we can get the semantic form directly from the UuidAttr? Based on the test cases you had to pass, is there any reason that would be difficult?



================
Comment at: clang/test/CodeGenCXX/microsoft-uuidof.cpp:37
 // Make sure we can properly generate code when the UUID has curly braces on it.
-GUID thing = __uuidof(Curly);
+GUID thing = (side_effect(), __uuidof(Curly));
 // CHECK-DEFINE-GUID: @thing = global %struct._GUID zeroinitializer, align 4
----------------
Do we need to add coverage of the constexpr-evaluated initializer codepath? Is it just a matter of updating the CHECKs, or do we reject this code now?

If we reject, will that create a migration problem for users?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77962/new/

https://reviews.llvm.org/D77962





More information about the cfe-commits mailing list