Skip to content

[TableGen] Fix build failure by using int type for NextChar #103000

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

jurahul
Copy link
Contributor

@jurahul jurahul commented Aug 13, 2024

- Fixes an issue in llvm#102967,
  which inddvertently changed the type of `NextChar` from int to char,
  causing ppc64le build failures.
@jurahul
Copy link
Contributor Author

jurahul commented Aug 13, 2024

Can one of you please review and merge the MR? It seems I inadvertently change the variable type to char, causing ppc64le build failures:

FAILED: lib/TableGen/CMakeFiles/LLVMTableGen.dir/TGLexer.cpp.o
ccache /home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/install/stage1/bin/clang++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/build/stage2/lib/TableGen -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/lib/TableGen -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/build/stage2/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-f ield-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=c++17 -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT lib/TableGen/CMakeFiles/LLVMTableGen.dir/TGLexer.cpp.o -MF lib/TableGen/CMakeFiles/LLVMTableGen.dir/TGLexer.cpp.o.d -o lib/TableGen/CMakeFiles/LLVMTableGen.dir/TGLexer.cpp.o -c /home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/lib/TableGen/TGLexer.cpp
/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/lib/TableGen/TGLexer.cpp:654:57: error: result of comparison of constant -1 with expression of type 'char' is always false [-Werror,-Wtautological-constant-out-of-range-compare]
654 | if (NextChar == ' ' || NextChar == '\t' || NextChar == EOF ||
| ~~~~~~~~ ^ ~~~

@jurahul
Copy link
Contributor Author

jurahul commented Aug 13, 2024

Its flagging comparison with EOF, I think EOF is -1 and char us likely unsigned on this platform.

@jurahul jurahul changed the title [NFC][TableGen Fix build by using int type for NextChar. [NFC][TableGen] Fix build failure by using int type for NextChar Aug 13, 2024
@s-barannikov s-barannikov merged commit b68df87 into llvm:main Aug 13, 2024
6 of 8 checks passed
@jurahul
Copy link
Contributor Author

jurahul commented Aug 13, 2024

Awesome, thanks so much!

@jurahul jurahul deleted the fix_build branch August 13, 2024 04:47
@s-barannikov s-barannikov changed the title [NFC][TableGen] Fix build failure by using int type for NextChar [TableGen] Fix build failure by using int type for NextChar Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants