[PATCH] D156185: [clang][ConstExprEmitter] handle ArrayToPointerDecay ImplicitCastExpr of StringLiterals
Nick Desaulniers via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jul 25 14:59:46 PDT 2023
nickdesaulniers added a comment.
In D156185#4533083 <https://reviews.llvm.org/D156185#4533083>, @efriedma wrote:
> No, that's taking the address of a string literal lvalue.
ah! sorry, yeah
`const char* foo = "foo";`
vs
`char foo[100000] = "x";`
That AST looks like:
`-VarDecl 0x55eaf6075ba8 <x.c:1:1, col:20> col:6 foo 'char[100000]' cinit
`-StringLiteral 0x55eaf6075c98 <col:20> 'char[100000]' "x"
That case is handled today by the fast path today. The case //I// refer to which is 1000% more common is not, hence this patch. WDYT?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D156185/new/
https://reviews.llvm.org/D156185
More information about the cfe-commits
mailing list