[clang] clang_EvalResult_getAsCXString impl (PR #134551)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 15 09:46:29 PDT 2025
AaronBallman wrote:
> `CXString::private_flags` only has 2 bits used. Could we use the rest for the size? Would it be enough?
I'd be a bit uncomfortable with that. It would work, but it means we're never able to add any new private flags in the future.
> There's also the possibility to not touch `CXString` at all, and add a function that returns ptr+size only for `clang_EvalResult_getAs...`.
What if we add `unsigned clang_getCStringLength(CXString);` which gets the length but not the contents? Do we need to package pointer and size together?
https://github.com/llvm/llvm-project/pull/134551
More information about the cfe-commits
mailing list