[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
Wed Sep 30 16:48:05 PDT 2015


zarko created this revision.
zarko added reviewers: rnk, echristo, klimek.
zarko added a subscriber: cfe-commits.
Herald added subscribers: srhines, danalbert, tberghammer, klimek.

This diff adds `addTargetAndModeForProgramName`, a utility function that will add appropriate `-target foo` and `--driver-mode=g++` tokens to a command line for driver invocations of the form `a/b/foo-g++`. It is intended to support tooling: for example, should a compilation database record some invocation of `foo-g++` without these implicit flags, a Clang tool may use this function to add them back.

Note that a compilation database won't necessarily store these invocations without their corresponding implicit flags. Some may use `addTargetAndModeForProgramName` when the database is first written out so that later readers don't need to repeat the operation.

http://reviews.llvm.org/D13318

Files:
  include/clang/Tooling/Tooling.h
  lib/Tooling/Tooling.cpp
  unittests/Tooling/ToolingTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13318.36163.patch
Type: text/x-patch
Size: 6792 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150930/3def8adc/attachment-0001.bin>


More information about the cfe-commits mailing list