Commit a7533c8
committed
Add option "--driver-mode" to config driver mode used by clang-tidy.
clang-tidy can't specify driver mode from command line. It will cause
problems when it is used with visual studio compiler (cl.exe). For
example, option of cl.exe can be started with either '-' or '/'. But
with default driver mode, you can only use '-' with clang-tidy.
cl.exe a.cpp /Iinclude
can be success, but
clang-tidy.exe a.cpp /Iinclude
may fail because /Iinclude can't be recongized by default driver mode of
clang-tidy. You need change the above line to:
clang-tidy.exe a.cpp -Iinclude
One workaround is passing "--driver-mode=cl" after "--":
clang-tidy.exe a.cpp -- --driver-mode
But this is not ideal. Generally, the options follow "--" should be
compiler options. "--driver-mode" is not the option of cl.exe. cl.exe
will generate "unknown option" warning.
This change adding an option "--driver-mode" to clang-tidy itself tries
to solve this problem. User can specify "gcc", "g++", "cpp", and "cl"
four modes. This option is optional. If this option is not specified,
the default driver mode will be used.1 parent 902f2f4 commit a7533c8
File tree
3 files changed
+39
-4
lines changed- clang-tools-extra/docs/clang-tidy
- clang/lib/Tooling
3 files changed
+39
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
137 | 143 | | |
138 | 144 | | |
139 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
95 | 111 | | |
96 | 112 | | |
97 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
69 | | - | |
| 68 | + | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| |||
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
356 | 369 | | |
357 | 370 | | |
358 | 371 | | |
| |||
406 | 419 | | |
407 | 420 | | |
408 | 421 | | |
409 | | - | |
| 422 | + | |
410 | 423 | | |
411 | 424 | | |
412 | 425 | | |
| |||
0 commit comments