[PATCH] [CMake][Concept] Auto dependency scanner "tddeps" for *.td

NAKAMURA Takumi geek4civic at gmail.com
Tue Feb 25 08:04:02 PST 2014


**It doesn't work with released version of CMake.**

I show AS-IS version of automatic dependency scanner.
Also available here; https://github.com/chapuni/llvm-project/commits/cmake/tddeps
For now, I have tweaked version of cmake; https://github.com/chapuni/CMake/commits/chapuni/trunk

This improvement introduces;

- Accurate dependencies among *.td(s).
- Suboptimal dependencies between *.inc (generated from *td) and *.cpp.
  (It could be made optimal easily)
- To cut dependencies for files that do not require any tblgen'd *.inc files.
  - For example in clangBasic, 16/20 of files are independent from clang-tblgen.
  - For example in clangCodeGen, 25/42 of files are independent from llvm-tblgen.
    (42/42 dependent of clang-tblgen, though)

It also makes increase opportunity of parallel build so much.
Hundreds of files are made independent from *-tblgen.

The scanner, "tddeps.py" runs whenever any of source files were touched in advance of "cmake --recheck".
CMake will rerun only when topology is changed.
Although this version of tddeps.py doesn't do incremental scanning,
scanning will finish within one second even with full scan. Expected milseconds with incremental scan.
Grep(1) is the fastest tool to scan source files, ...assuming GNU grep.

Again, it doesn't work with released version of CMake.
Discussions are here; http://www.cmake.org/Bug/view.php?id=14729

I have tested this only on Linux.

http://llvm-reviews.chandlerc.com/D2879

Files:
  llvm/CMakeLists.txt
  llvm/cmake/modules/AddLLVM.cmake
  llvm/cmake/modules/TableGen.cmake
  llvm/include/llvm/TableGen/X86DisassemblerDecoderCommon.h
  llvm/lib/Target/X86/Disassembler/X86Disassembler.h
  llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.h
  llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoderCommon.h
  llvm/tools/lli/ChildTarget/CMakeLists.txt
  llvm/utils/TableGen/X86DisassemblerShared.h
  llvm/utils/tddeps/CMakeLists.txt
  llvm/utils/tddeps/tddeps.py
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2879.1.patch
Type: text/x-patch
Size: 103529 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140225/58a0eb12/attachment.bin>


More information about the cfe-commits mailing list