csmith-project / creduce

C-Reduce, a C and C++ program reducer
Other
1.25k stars 123 forks source link

creduce make fail with llvm9.0.0 which complaint error: use of undeclared identifier 'Language' #258

Closed sendaoYan closed 1 year ago

sendaoYan commented 1 year ago

replay command:

llvm=/home/yansendao/software/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-14.04
./configure --with-llvm=$llvm --prefix=/home/yansendao/tone/run/csmith/creduce-binary CC=$llvm/bin/clang CXX=$llvm/bin/clang++ LDFLAGS="-L$HOME/software/llvm/lib"
make -j &> make.log

When change llvm binary from llvm9.0.0 to llvm16.0.0, then creduce make success.

log:

home/yansendao/software/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-14.04/bin/clang++ -DHAVE_CONFIG_H -I. -I..   -I"/home/yansendao/software/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-14.04/include/clang"  -I/home/yansendao/software/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-14.04/include -std=c++11 -stdlib=libc++ -fno-exceptions -fno-rtti -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-rtti -fno-exceptions -g -O3 -fno-strict-aliasing -Wall -Wextra -Wno-long-long -Wno-unused-parameter -Wno-missing-field-initializers -MT clang_delta-git_version.o -MD -MP -MF .deps/clang_delta-git_version.Tpo -c -o clang_delta-git_version.o `test -f 'git_version.cpp' || echo './'`git_version.cpp
mv -f .deps/clang_delta-git_version.Tpo .deps/clang_delta-git_version.Po
mv -f .deps/clang_delta-ClangDelta.Tpo .deps/clang_delta-ClangDelta.Po
TransformationManager.cpp:107:27: error: use of undeclared identifier 'Language'; did you mean 'LanguageID'?
  if (IK.getLanguage() == Language::C) {
                          ^~~~~~~~
                          LanguageID
/home/yansendao/software/llvm/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-14.04/include/clang/Basic/Builtins.h:32:6: note: 'LanguageID' declared here
enum LanguageID {
     ^
TransformationManager.cpp:107:37: error: no member named 'C' in 'clang::LanguageID'
  if (IK.getLanguage() == Language::C) {
                          ~~~~~~~~~~^
TransformationManager.cpp:108:34: error: no member named 'setLangDefaults' in 'clang::LangOptions'
    ClangInstance->getLangOpts().setLangDefaults(ClangInstance->getLangOpts(), Language::C, T, PPOpts.Includes);
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
TransformationManager.cpp:108:80: error: use of undeclared identifier 'Language'; did you mean 'LanguageID'?
    ClangInstance->getLangOpts().setLangDefaults(ClangInstance->getLangOpts(), Language::C, T, PPOpts.Includes);
                                                                               ^~~~~~~~
                                                                               LanguageID

make.log

eeide commented 1 year ago

The head of the master branch works with LLVM 16.0. My apologies that the documentation on the master branch is currently out of date w.r.t. this requirement.

The out-of-date documentation in the topic of #257, so I am going to close this issue.