aboutsummaryrefslogtreecommitdiff
path: root/compiler_wrapper/command.go
diff options
context:
space:
mode:
authorTobias Bosch <tbosch@google.com>2019-10-10 16:15:13 -0700
committerTobias Bosch <tbosch@google.com>2019-10-11 15:33:37 +0000
commitf40d1b4761c07826176d3075148ee21ce75da465 (patch)
tree018e32e0f0db50b7a70aeb3687bbcab57d84382e /compiler_wrapper/command.go
parent1fe6209e9e3a0f32412696971bf58b79d52d6d34 (diff)
downloadtoolchain-utils-f40d1b4761c07826176d3075148ee21ce75da465.tar.gz
Android wrapper: Support wrapping clang-tidy
Android uses the wrapper also for clang-tidy. TEST=golden tests BUG=chromium:773875 Change-Id: I17534b44b1bc7e6b60002f2660966f27d70301ad Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1854899 Reviewed-by: George Burgess <gbiv@chromium.org> Tested-by: Tobias Bosch <tbosch@google.com>
Diffstat (limited to 'compiler_wrapper/command.go')
-rw-r--r--compiler_wrapper/command.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler_wrapper/command.go b/compiler_wrapper/command.go
index 6c5beae1..26f85568 100644
--- a/compiler_wrapper/command.go
+++ b/compiler_wrapper/command.go
@@ -91,7 +91,12 @@ func getAbsCmdPath(env env, cmd *command) string {
func newCommandBuilder(env env, cfg *config, cmd *command) (*commandBuilder, error) {
basename := filepath.Base(cmd.Path)
- nameParts := strings.Split(basename, "-")
+ var nameParts []string
+ if basename == "clang-tidy" {
+ nameParts = []string{basename}
+ } else {
+ nameParts = strings.Split(basename, "-")
+ }
target := builderTarget{}
switch len(nameParts) {
case 1: