From a2761e437f220ec2cc4a5503bc427b317cc8c59d Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Wed, 22 Aug 2018 23:53:39 +0000 Subject: [PATCH] win: Omit ".exe" from clang and clang-cl driver-level diagnostics. Like https://reviews.llvm.org/D51133 but for clang. https://reviews.llvm.org/D51134 llvm-svn: 340498 --- clang/tools/driver/driver.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clang/tools/driver/driver.cpp b/clang/tools/driver/driver.cpp index 0455ba029c65..51143e3d8cb7 100644 --- a/clang/tools/driver/driver.cpp +++ b/clang/tools/driver/driver.cpp @@ -260,9 +260,9 @@ static void FixupDiagPrefixExeName(TextDiagnosticPrinter *DiagClient, const std::string &Path) { // If the clang binary happens to be named cl.exe for compatibility reasons, // use clang-cl.exe as the prefix to avoid confusion between clang and MSVC. - StringRef ExeBasename(llvm::sys::path::filename(Path)); - if (ExeBasename.equals_lower("cl.exe")) - ExeBasename = "clang-cl.exe"; + StringRef ExeBasename(llvm::sys::path::stem(Path)); + if (ExeBasename.equals_lower("cl")) + ExeBasename = "clang-cl"; DiagClient->setPrefix(ExeBasename); }