[PATCH] D103112: Reimplement __builtin_unique_stable_name as __builtin_sycl_unique_stable_name

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 26 10:41:05 PDT 2021


aaron.ballman added inline comments.


================
Comment at: clang/docs/LanguageExtensions.rst:2408
+``__builtin_sycl_unique_stable_name``
+--------------------------------
+
----------------
Underlines look off now, so this likely causes Sphinx warnings.


================
Comment at: clang/docs/LanguageExtensions.rst:2440-2443
+  constexpr const char * __builtin_unique_stable_name( type-id );
+
+  // Computes a unique stable name for the type of the given expression.
+  constexpr const char * __builtin_unique_stable_name( expression );
----------------



================
Comment at: clang/include/clang/AST/ASTContext.h:3177
+  /// name all the SYCL kernels in the translation unit, so that we can get the
+  /// correct kernel name, as well as implement __builtin_unique_stable_name.
+  llvm::DenseMap<const DeclContext *,
----------------



================
Comment at: clang/include/clang/AST/Expr.h:2042
 
+// This represents a use of the __builtin_unique_stable_name, which takes either
+// a type-id or an expression, and at CodeGen time emits a unique string
----------------



================
Comment at: clang/include/clang/Serialization/ASTBitCodes.h:1964
+
+  // UniqueStableNameExpr
+  EXPR_SYCL_UNIQUE_STABLE_NAME,
----------------



================
Comment at: clang/lib/Basic/IdentifierTable.cpp:85
 
-  enum {
-    KEYC99        = 0x1,
-    KEYCXX        = 0x2,
-    KEYCXX11      = 0x4,
-    KEYGNU        = 0x8,
-    KEYMS         = 0x10,
-    BOOLSUPPORT   = 0x20,
-    KEYALTIVEC    = 0x40,
-    KEYNOCXX      = 0x80,
-    KEYBORLAND    = 0x100,
-    KEYOPENCLC    = 0x200,
-    KEYC11        = 0x400,
-    KEYNOMS18     = 0x800,
-    KEYNOOPENCL   = 0x1000,
-    WCHARSUPPORT  = 0x2000,
-    HALFSUPPORT   = 0x4000,
-    CHAR8SUPPORT  = 0x8000,
-    KEYCONCEPTS   = 0x10000,
-    KEYOBJC       = 0x20000,
-    KEYZVECTOR    = 0x40000,
-    KEYCOROUTINES = 0x80000,
-    KEYMODULES    = 0x100000,
-    KEYCXX20      = 0x200000,
-    KEYOPENCLCXX  = 0x400000,
-    KEYMSCOMPAT   = 0x800000,
-    KEYALLCXX = KEYCXX | KEYCXX11 | KEYCXX20,
-    KEYALL = (0xffffff & ~KEYNOMS18 &
-              ~KEYNOOPENCL) // KEYNOMS18 and KEYNOOPENCL are used to exclude.
-  };
-
-  /// How a keyword is treated in the selected standard.
-  enum KeywordStatus {
-    KS_Disabled,    // Disabled
-    KS_Extension,   // Is an extension
-    KS_Enabled,     // Enabled
-    KS_Future       // Is a keyword in future standard
-  };
+enum {
+  KEYC99 = 0x1,
----------------
It looks like you formatted a bit more than you intended to.


================
Comment at: clang/lib/Parse/ParseExpr.cpp:2329-2330
 }
 
+/// Parse a __builtin_unique_stable_name expression.  Accepts a type-id or an
+/// arbitrary expression as a parameter.
----------------



================
Comment at: clang/lib/Parse/ParseExpr.cpp:2339
+
+  // __builtin_unique_stable_name expressions are always parenthesized.
+  if (T.expectAndConsume(diag::err_expected_lparen_after,
----------------



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

https://reviews.llvm.org/D103112



More information about the cfe-commits mailing list