This revision was automatically updated to reflect the committed changes. Closed by commit rC359077: Fix unquoted spaces in args in clang --verbose output (authored by hans, committed by ).
Changed prior to commit: https://reviews.llvm.org/D60997?vs=196191&id=196398#toc Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60997/new/ https://reviews.llvm.org/D60997 Files: lib/Driver/Job.cpp test/Driver/verbose-output-quoting.c Index: lib/Driver/Job.cpp =================================================================== --- lib/Driver/Job.cpp +++ lib/Driver/Job.cpp @@ -99,7 +99,7 @@ } void Command::printArg(raw_ostream &OS, StringRef Arg, bool Quote) { - const bool Escape = Arg.find_first_of("\"\\$") != StringRef::npos; + const bool Escape = Arg.find_first_of(" \"\\$") != StringRef::npos; if (!Quote && !Escape) { OS << Arg; Index: test/Driver/verbose-output-quoting.c =================================================================== --- test/Driver/verbose-output-quoting.c +++ test/Driver/verbose-output-quoting.c @@ -0,0 +1,9 @@ +// RUN: %clang --verbose -DSPACE="a b" -c %s 2>&1 | FileCheck -check-prefix=SPACE -strict-whitespace %s +// RUN: %clang --verbose -DQUOTES=\"\" -c %s 2>&1 | FileCheck -check-prefix=QUOTES -strict-whitespace %s +// RUN: %clang --verbose -DBACKSLASH=\\ -c %s 2>&1 | FileCheck -check-prefix=BACKSLASH -strict-whitespace %s +// RUN: %clang --verbose -DDOLLAR=\$ -c %s 2>&1 | FileCheck -check-prefix=DOLLAR -strict-whitespace %s + +// SPACE: -cc1 {{.*}} -D "SPACE=a b" +// QUOTES: -cc1 {{.*}} -D "QUOTES=\"\"" +// BACKSLASH: -cc1 {{.*}} -D "BACKSLASH=\\" +// DOLLAR: -cc1 {{.*}} -D "DOLLAR=\$"
Index: lib/Driver/Job.cpp =================================================================== --- lib/Driver/Job.cpp +++ lib/Driver/Job.cpp @@ -99,7 +99,7 @@ } void Command::printArg(raw_ostream &OS, StringRef Arg, bool Quote) { - const bool Escape = Arg.find_first_of("\"\\$") != StringRef::npos; + const bool Escape = Arg.find_first_of(" \"\\$") != StringRef::npos; if (!Quote && !Escape) { OS << Arg; Index: test/Driver/verbose-output-quoting.c =================================================================== --- test/Driver/verbose-output-quoting.c +++ test/Driver/verbose-output-quoting.c @@ -0,0 +1,9 @@ +// RUN: %clang --verbose -DSPACE="a b" -c %s 2>&1 | FileCheck -check-prefix=SPACE -strict-whitespace %s +// RUN: %clang --verbose -DQUOTES=\"\" -c %s 2>&1 | FileCheck -check-prefix=QUOTES -strict-whitespace %s +// RUN: %clang --verbose -DBACKSLASH=\\ -c %s 2>&1 | FileCheck -check-prefix=BACKSLASH -strict-whitespace %s +// RUN: %clang --verbose -DDOLLAR=\$ -c %s 2>&1 | FileCheck -check-prefix=DOLLAR -strict-whitespace %s + +// SPACE: -cc1 {{.*}} -D "SPACE=a b" +// QUOTES: -cc1 {{.*}} -D "QUOTES=\"\"" +// BACKSLASH: -cc1 {{.*}} -D "BACKSLASH=\\" +// DOLLAR: -cc1 {{.*}} -D "DOLLAR=\$"
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits