SNSystems / llvm-project-prepo

Fork of LLVM with modifications to support a program repository
26 stars 0 forks source link

repo-fragments now returns 1 (failure) if a requested name is not found #146

Closed paulhuggett closed 3 years ago

paulhuggett commented 3 years ago

There are two ways to use repo-fragments. One is to pass it a ticket file path and it will dump all of the names defined therein. The second way is to also pass one or more additional strings: this will limit the output to just those names.

In the latter case I would like the tool to return failure if a filter name is not present in the compilation. This then makes it much easier to find which ticket(s) are responsible for the definition of a known name. It’s as easy as something like:

find . -name \*.o -exec repo-fragments {} foo \; -print

This will search the directory tree starting at the current working directory for files named *.o. For each one found, it will run repo-fragments. If this returns success — which it will do if the compilation contains a definition named ‘foo’ — the name of the file is printed.

A useful tool when understanding the reasons for a link failure.

(This wiki page discusses other further ways in which repo-fragments can be used to explore a program repository.)