forked from OSchip/llvm-project
clang-cl: Avoid confusing diagnostics when clang-cl is called just cl.exe
llvm-svn: 189901
This commit is contained in:
parent
8bd0ac1135
commit
dc74af1ab8
|
@ -346,7 +346,14 @@ int main(int argc_, const char **argv_) {
|
|||
// DiagnosticOptions instance.
|
||||
TextDiagnosticPrinter *DiagClient
|
||||
= new TextDiagnosticPrinter(llvm::errs(), &*DiagOpts);
|
||||
DiagClient->setPrefix(llvm::sys::path::filename(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.trim().equals_lower("cl.exe"))
|
||||
ExeBasename = "clang-cl.exe";
|
||||
DiagClient->setPrefix(ExeBasename);
|
||||
|
||||
IntrusiveRefCntPtr<DiagnosticIDs> DiagID(new DiagnosticIDs());
|
||||
|
||||
DiagnosticsEngine Diags(DiagID, &*DiagOpts, DiagClient);
|
||||
|
|
Loading…
Reference in New Issue