[llvm-dev] Ninja behavior that befuddles me

Paul C. Anagnostopoulos via llvm-dev llvm-dev at lists.llvm.org
Wed Aug 12 06:34:53 PDT 2020


Hmm. Someone suggested that I rebuild them all and do a diff just precisely to obtain the warm and fuzzies. Since I've copied the original .inc files, it's probably easiest to delete all the built .inc files. That will force a complete rebuild of them.

At 8/12/2020 09:15 AM, Robinson, Paul wrote:


>> -----Original Message-----
>> From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of Paul C.
>> Anagnostopoulos via llvm-dev
>> Sent: Wednesday, August 12, 2020 8:48 AM
>> To: Michael Kruse <llvmdev at meinersbur.de>
>> Cc: llvm-dev <llvm-dev at lists.llvm.org>
>> Subject: Re: [llvm-dev] Ninja behavior that befuddles me
>> 
>> I'm a total newbie as far as CMake and Ninja are concerned. How do I force
>> Ninja to build the target .inc files? I'm working on TableGen, so my
>> changes to the executable may indeed change the output files. I want to be
>> sure they did not, in fact, change.
>> 
>> Should I just touch all the .td files?
>
>That's the traditional method for forcing something to rebuild.
>Note the .td rules actually create the new .inc file "on the side"
>and only overwrite the target .inc file itself if the new file
>does not compare equal, so you could look at the .inc timestamps
>after the build to determine whether any have been updated.
>
>If you're especially worried, you could rename all the .inc files
>in the build tree, which will cause all new .inc files to be
>created using your modified tablegen; then you can do your own
>diffs and verify no changes in the generated files.
>This method will of course cause everything that depends on the
>.inc files to be rebuilt, so the test build will take much longer,
>but it would provide that little extra warm-fuzzy feeling.
>--paulr



More information about the llvm-dev mailing list