Commit 78b08da
committed
Fix the modification detection logic in
`OverlayCDB::getCompileCommand` applies a mangling operation if
the CDB has one set. Given a `CommandMangler`, the provided command line
is mangled to have additional flags such as `--driver-mode=g++`.
Example: https://github.com/llvm/llvm-project/blob/d4525b016f5a1ab2852acb2108742b2f9d0bd3bd/clang-tools-extra/clangd/unittests/CompileCommandsTests.cpp#L46-L62
Considering the previous logic of:
```
auto Old = CDB->getCompileCommand(File);
auto New = tooling::CompileCommand(...);
if (Old != New) {
...
}
```
The `Old != New` here is always true because `New` is the "raw" compile
command whereas `Old` is the "cooked" (mangling aplied) compile command.
This diff performs the change check inside of `setCompileCommand`
instead to compare the "raw" compile commands.ClangdLSPServer::applyConfiguration.1 parent 1adca7a commit 78b08da
File tree
4 files changed
+31
-23
lines changed- clang-tools-extra/clangd
- unittests
4 files changed
+31
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1419 | 1419 | | |
1420 | 1420 | | |
1421 | 1421 | | |
1422 | | - | |
1423 | | - | |
1424 | | - | |
1425 | | - | |
1426 | | - | |
1427 | | - | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
1428 | 1426 | | |
1429 | | - | |
1430 | | - | |
| 1427 | + | |
1431 | 1428 | | |
1432 | 1429 | | |
1433 | 1430 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
807 | 807 | | |
808 | 808 | | |
809 | 809 | | |
810 | | - | |
| 810 | + | |
811 | 811 | | |
812 | 812 | | |
813 | 813 | | |
814 | 814 | | |
815 | 815 | | |
816 | 816 | | |
817 | 817 | | |
818 | | - | |
819 | | - | |
820 | | - | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
821 | 827 | | |
822 | 828 | | |
823 | 829 | | |
| 830 | + | |
824 | 831 | | |
825 | 832 | | |
826 | 833 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
207 | 209 | | |
208 | 210 | | |
209 | 211 | | |
| |||
Lines changed: 12 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
| 95 | + | |
| 96 | + | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
99 | | - | |
| 100 | + | |
| 101 | + | |
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
| |||
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
114 | | - | |
| 116 | + | |
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
| |||
128 | 130 | | |
129 | 131 | | |
130 | 132 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
135 | 137 | | |
136 | 138 | | |
137 | 139 | | |
| |||
151 | 153 | | |
152 | 154 | | |
153 | 155 | | |
154 | | - | |
| 156 | + | |
155 | 157 | | |
156 | 158 | | |
157 | 159 | | |
| |||
412 | 414 | | |
413 | 415 | | |
414 | 416 | | |
415 | | - | |
| 417 | + | |
416 | 418 | | |
417 | 419 | | |
418 | 420 | | |
| |||
432 | 434 | | |
433 | 435 | | |
434 | 436 | | |
435 | | - | |
| 437 | + | |
436 | 438 | | |
437 | 439 | | |
438 | 440 | | |
| |||
0 commit comments