[LLVMdev] TargetParser - Always build all table-gen files?
renato.golin at linaro.org
Mon Mar 9 10:40:39 PDT 2015
On 9 March 2015 at 12:02, Renato Golin <renato.golin at linaro.org> wrote:
> My idea is to build all table-gen files on all targets, but not build
> all targets' files and not include them in the final libraries /
> binaries. Since the table-gen'ed files don't end up there by
> themselves, only what we use from them (in the target parser) will be
> included in the final binaries.
Attached is a patch that kind of does that, but not completely. CMakes
finishes ok, but make can't find the td files.
Basically, I moved the tablegen() registration process to a separate
file (CMakeTblGen.txt), which is included from CMakeLists.txt in each
target directory and also in the root lib/Target/CMakeLists.txt, so
that I can NOT include all targets while including ALL table-gen files
that weren't included by the targets_to_build.
The problem is that, when I include it from lib/Target/CMakeLists.txt,
the tablegen(LLVM File.td -opts) makes File.td relative to its own dir
(lib/Target/File.td) and not the targets'.
The only way I can think of solving this is to change how tablegen()
handles the file name, with some "if(IS_ABSOLUTE)", but looking
further, the file name is used to more than just a filename, and gets
included in some variables names, etc. Also, I can't add another
option to the end of tablegen() because, AFAICS, this function is
variadic, with all table-gen options following the file name...
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 22743 bytes
Desc: not available
More information about the llvm-dev