[clang] [Clang][Lexer] Reland "Detect SSE4.2 availability at runtime in fastParseASCIIIdentifier" (PR #175452)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 14 07:57:38 PST 2026
AaronBallman wrote:
> > Ok, well if I change `fastParseASCIIIdentifierSSE42` to `fastParseASCIIIdentifier` I still get
> > ```
> > ../../clang/lib/Lex/Lexer.cpp:1937:1: error: unused function 'fastParseASCIIIdentifier' [-Werror,-Wunused-function]
> > 1937 | fastParseASCIIIdentifier(const char *CurPtr, const char *BufferEnd) {
> > | ^~~~~~~~~~~~~~~~~~~~~~~~
> > 1 error generated.
> > ```
>
> To me, this seems more of a Clang bug that a real issue in the code. Explicitly marking the function as used seems like the only fix, though it is more of a hack. Is this acceptable?
I think it's almost a requirement; even if we change the behavior of Clang, we still need to be able to compile with older Clang versions because the fixed version won't be widely available for a while.
As for the behavior, my intuition is that it's a bug because the unused variant of the function is intentionally unused due to the target attribute. That would be worth filing an issue about.
https://github.com/llvm/llvm-project/pull/175452
More information about the cfe-commits
mailing list