[all-commits] [llvm/llvm-project] ac1ffd: [TargetParser] Generate the defs for RISCV CPUs u...
Francesco Petrogalli via All-commits
all-commits at lists.llvm.org
Wed Jan 11 02:19:15 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: ac1ffd3caca12c254e0b8c847aa8ce8e51b6cfbf
https://github.com/llvm/llvm-project/commit/ac1ffd3caca12c254e0b8c847aa8ce8e51b6cfbf
Author: Francesco Petrogalli <francesco.petrogalli at apple.com>
Date: 2023-01-11 (Wed, 11 Jan 2023)
Changed paths:
M clang/lib/Basic/CMakeLists.txt
M clang/lib/Basic/Targets/RISCV.cpp
M clang/lib/Driver/CMakeLists.txt
M clang/lib/Driver/ToolChains/Arch/RISCV.cpp
M llvm/include/llvm/CMakeLists.txt
A llvm/include/llvm/TargetParser/CMakeLists.txt
R llvm/include/llvm/TargetParser/RISCVTargetParser.def
A llvm/include/llvm/TargetParser/RISCVTargetParser.h
M llvm/include/llvm/TargetParser/TargetParser.h
M llvm/include/llvm/module.extern.modulemap
M llvm/include/llvm/module.install.modulemap
M llvm/include/llvm/module.modulemap
M llvm/lib/Target/RISCV/RISCV.td
M llvm/lib/Target/RISCV/RISCVISelLowering.h
M llvm/lib/TargetParser/CMakeLists.txt
A llvm/lib/TargetParser/RISCVTargetParser.cpp
M llvm/lib/TargetParser/TargetParser.cpp
M llvm/utils/TableGen/CMakeLists.txt
A llvm/utils/TableGen/RISCVTargetDefEmitter.cpp
M llvm/utils/TableGen/TableGen.cpp
M llvm/utils/TableGen/TableGenBackends.h
Log Message:
-----------
[TargetParser] Generate the defs for RISCV CPUs using llvm-tblgen.
Rework the change to prevent build failures. NFCI.
The failing code was submitted as
cf7a8305a2b4ddfd299c748136cb9a2960ef7089 and reverted via
8bd65e535fb33bc48805bafed8217b16a853e158.
The rework in this new commit prevents failures like the following:
FAILED: tools/clang/lib/Basic/CMakeFiles/obj.clangBasic.dir/Targets/RISCV.cpp.o
/usr/bin/c++ [bunch of non interesting stuff] -c <path-to>/llvm-project/clang/lib/Basic/Targets/RISCV.cpp
In file included from <path-to>/llvm-project/clang/lib/Basic/Targets/RISCV.cpp:19:
<path-to>/llvm-project/llvm/include/llvm/TargetParser/RISCVTargetParser.h:29:10: fatal error: llvm/TargetParser/RISCVTargetParserDef.inc: No such file or directory
29 | #include "llvm/TargetParser/RISCVTargetParserDef.inc"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
These failures happen because the library LLVMTargetParser depends on
RISCVTargetParserTableGen, which is a tablegen target that generates
the list of CPUs in
llvm/TargetParser/RISCVTargetParserDef.inc. This *.inc file is
included by the public header file
llvm/TargetParser/RISCVTargetParser.h.
The header file llvm/TargetParser/RISCVTargetParser.h is also used in
components (clangDriver and clangBasic) that link into
LLVMTargetParser, but on some configurations such components might end
up being built before TargetParser is ready.
The fix is to make sure that clangDriver and clangBasic depend on the
tablegen target RISCVTargetParserTableGen, which generates the .inc
file whether or not LLVMTargetParser is ready.
WRT the original patch at https://reviews.llvm.org/D137517, this
commit is just adding RISCVTargetParserTableGen in the DEPENDS list of
clangDriver and clangBasic.
More information about the All-commits
mailing list