wrappers: Use --{start,end}-no-unused-arguments instead of -Qunused-arguments

This makes warnings for other unused arguments visible to the user.

This requires a version of llvm-project past
50ec1306d060e46e0d53c9f5d8a052e1b0d10d3b (Jan 2022) which added these
new options.
This commit is contained in:
Martin Storsjö committed 2022-02-09 14:02:20 +02:00
1 parent 7b1d05f545
commit 14db168cd6
2 files changed
+4 -2

No files matched your search

+2 -1
View File
@@ -56,6 +56,7 @@ int _tmain(int argc, TCHAR* argv[]) {
if (getenv("CCACHE"))
exec_argv[arg++] = _T("ccache");
exec_argv[arg++] = concat(dir, _T(CLANG));
exec_argv[arg++] = _T("--start-no-unused-arguments");
// If changing this wrapper, change clang-target-wrapper.sh accordingly.
if (!_tcscmp(exe, _T("clang++")) || !_tcscmp(exe, _T("g++")) || !_tcscmp(exe, _T("c++")))
@@ -94,7 +95,7 @@ int _tmain(int argc, TCHAR* argv[]) {
exec_argv[arg++] = _T("-unwindlib=libunwind");
exec_argv[arg++] = _T("-stdlib=libc++");
exec_argv[arg++] = _T("-fuse-ld=lld");
exec_argv[arg++] = _T("-Qunused-arguments");
exec_argv[arg++] = _T("--end-no-unused-arguments");
for (int i = 1; i < argc; i++)
exec_argv[arg++] = argv[i];
+2 -1
View File
@@ -45,6 +45,7 @@ fi
# If changing this wrapper, change clang-target-wrapper.c accordingly.
CLANG="$DIR/clang"
FLAGS=""
FLAGS="$FLAGS --start-no-unused-arguments"
case $EXE in
clang++|g++|c++)
FLAGS="$FLAGS --driver-mode=g++"
@@ -87,6 +88,6 @@ FLAGS="$FLAGS -rtlib=compiler-rt"
FLAGS="$FLAGS -unwindlib=libunwind"
FLAGS="$FLAGS -stdlib=libc++"
FLAGS="$FLAGS -fuse-ld=lld"
FLAGS="$FLAGS -Qunused-arguments"
FLAGS="$FLAGS --end-no-unused-arguments"
$CCACHE "$CLANG" $FLAGS "$@"