aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Format/FormatTestJava.cpp
diff options
context:
space:
mode:
authorKon <kinsei0916@gmail.com>2024-01-12 17:11:38 +0900
committerGitHub <noreply@github.com>2024-01-12 03:11:38 -0500
commitf489fb3d75aaedf6f056113370a8b3b8659b9f17 (patch)
tree6289cf6d05fbdb6b255e0ed68c0a276fb7f107f3 /clang/unittests/Format/FormatTestJava.cpp
parentc297597e1cc0e731540ec72334a305490db21fe6 (diff)
downloadllvm-f489fb3d75aaedf6f056113370a8b3b8659b9f17.zip
llvm-f489fb3d75aaedf6f056113370a8b3b8659b9f17.tar.gz
llvm-f489fb3d75aaedf6f056113370a8b3b8659b9f17.tar.bz2
[clangd] Fix sysroot flag handling in CommandMangler to prevent duplicates (#75694)
CommandMangler should guess the sysroot path of the host system and add that through `-isysroot` flag only when there is no `--sysroot` or `-isysroot` flag in the original compile command to avoid duplicate sysroot. Previously, CommandMangler appropriately avoided adding a guessed sysroot flag if the original command had an argument in the form of `--sysroot=<sysroot>`, `--sysroot <sysroot>`, or `-isysroot <sysroot>`. However, when presented as `-isysroot<sysroot>` (without spaces after `-isysroot`), CommandMangler mistakenly appended the guessed sysroot flag, resulting in duplicated sysroot in the final command. This commit fixes it, ensuring the final command has no duplicate sysroot flags. Also adds unit tests for this fix.
Diffstat (limited to 'clang/unittests/Format/FormatTestJava.cpp')
0 files changed, 0 insertions, 0 deletions