[PATCH] D13318: Add a utility function to add target information to a command line

Luke Zarko via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 1 10:08:21 PDT 2015


zarko marked an inline comment as done.
zarko added a comment.

Thanks; would someone with commit access land this?

echristo: for a more concrete example, imagine a source code indexer that collects up dependencies. This is a Clang tool that gets called by the build system for each translation unit and is provided with the path to the compiler it would use to build it along with the arguments to that compiler. The indexer is unlikely to be on the same path as the compiler, but the indexer's path needs to be preserved because of the way Clang tools search for resources.

The only important part of the path to the compiler is the compiler's name, because sometimes the name contains information about the target or driver mode that affects how the indexer should interpret the translation unit. This function applies the logic that Clang's driver uses to deduce that information; it then adds arguments that cause the tooling infrastructure to correctly interpret the code.


http://reviews.llvm.org/D13318





More information about the cfe-commits mailing list