[PATCH] D156237: Complete the implementation of P2361 Unevaluated string literals

Hubert Tong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 12 17:13:01 PDT 2023


hubert.reinterpretcast added inline comments.


================
Comment at: clang/lib/Parse/ParseDecl.cpp:431-436
+    if (Expr.isInvalid()) {
+      SawError = true;
+      break;
+    } else {
+      Exprs.push_back(Expr.get());
+    }
----------------
cor3ntin wrote:
> aaron.ballman wrote:
> > 
> Oups, sorry @Fznamznon, I'll fix that!
It seems Aaron's request to move the code out of the `else` was not acted on.


================
Comment at: clang/utils/TableGen/ClangAttrEmitter.cpp:2337
+// Emits the list of arguments that should be parsed as unevaluated string
+// literals for each attributes
+static void emitClangAttrUnevaluatedStringLiteralList(RecordKeeper &Records,
----------------
Minor nit: Grammar


================
Comment at: clang/utils/TableGen/ClangAttrEmitter.cpp:2345
+    uint32_t Bits = 0;
+    for (uint32_t N = 0; N < Args.size(); ++N) {
+      Bits |= (isStringLiteralArgument(Args[N]) << N);
----------------
Do we know that `Args.size()` is less than 32?


================
Comment at: clang/utils/TableGen/ClangAttrEmitter.cpp:2349-2350
+      if (isVariadicStringLiteralArgument(Args[N])) {
+        for (; N < sizeof(uint32_t) * CHAR_BIT; ++N)
+          Bits |= (1 << N);
+        break;
----------------
```
#include <llvm/Support/MathExtras.h>
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156237



More information about the cfe-commits mailing list