vsapsai added a comment.

Looks like this breaks a modular build. I.e.,

  cmake -GNinja ~/Projects/llvm/llvm-project/llvm \
    -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" \
    -DLLVM_ENABLE_ASSERTIONS=ON \
    -DCMAKE_BUILD_TYPE=RelWithDebInfo \
    -DLLVM_ENABLE_MODULES=ON
  ninja clangPseudoGrammar

fails with

  While building module 'Clang_Basic' imported from 
/Users/vsapsai/Projects/llvm/llvm-project/clang-tools-extra/pseudo/include/clang-pseudo/grammar/Grammar.h:55:
  In file included from <module-includes>:4:
  
/Users/vsapsai/Projects/llvm/llvm-project/clang/include/clang/Basic/AttrKinds.h:27:10:
 fatal error: 'clang/Basic/AttrList.inc' file not found
  #include "clang/Basic/AttrList.inc"
           ^~~~~~~~~~~~~~~~~~~~~~~~~~
  While building module 'Clang_Basic' imported from 
/Users/vsapsai/Projects/llvm/llvm-project/clang-tools-extra/pseudo/include/clang-pseudo/grammar/Grammar.h:55:
  While building module 'LLVM_Frontend_OpenMP' imported from 
/Users/vsapsai/Projects/llvm/llvm-project/clang/include/clang/Basic/TargetInfo.h:34:
  In file included from <module-includes>:2:
  
/Users/vsapsai/Projects/llvm/llvm-project/llvm/include/llvm/Frontend/OpenMP/OMPConstants.h:20:10:
 fatal error: 'llvm/Frontend/OpenMP/OMP.h.inc' file not found
  #include "llvm/Frontend/OpenMP/OMP.h.inc"
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  In file included from 
/Users/vsapsai/Projects/llvm/llvm-project/clang-tools-extra/pseudo/lib/grammar/LRGraph.cpp:9:
  In file included from 
/Users/vsapsai/Projects/llvm/llvm-project/clang-tools-extra/pseudo/include/clang-pseudo/grammar/LRGraph.h:34:
  
/Users/vsapsai/Projects/llvm/llvm-project/clang-tools-extra/pseudo/include/clang-pseudo/grammar/Grammar.h:55:10:
 fatal error: could not build module 'Clang_Basic'
  #include "clang/Basic/TokenKinds.h"
   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
  3 errors generated.

My understanding is that the module 'Clang_Basic' needs .inc headers and this 
module is pulled in by `#include "clang/Basic/TokenKinds.h"` at 
"clang-tools-extra/pseudo/include/clang-pseudo/grammar/Grammar.h:55". When 
those .inc headers aren't generated, the build fails. Don't know what would be 
the best way to fix the issue, I was able to fix the build by commenting out 
`list(REMOVE_ITEM LLVM_COMMON_DEPENDS clang-tablegen-targets)` in 
"lib/grammar/CMakeLists.txt".


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D126731/new/

https://reviews.llvm.org/D126731

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to