[clang] 4a96081 - [clang-linker-wrapper] Fix a warning

Kazu Hirata via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 29 14:12:33 PDT 2024


Author: Kazu Hirata
Date: 2024-10-29T14:12:15-07:00
New Revision: 4a96081224b6c0f166760eab0c42ef3dfadd5ed1

URL: https://github.com/llvm/llvm-project/commit/4a96081224b6c0f166760eab0c42ef3dfadd5ed1
DIFF: https://github.com/llvm/llvm-project/commit/4a96081224b6c0f166760eab0c42ef3dfadd5ed1.diff

LOG: [clang-linker-wrapper] Fix a warning

This patch fixes:

  clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp:642:6:
  error: unused function 'diagnosticHandler'
  [-Werror,-Wunused-function]

Added: 
    

Modified: 
    clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp

Removed: 
    


################################################################################
diff  --git a/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp b/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
index 45274b797236c9..561b73c73ad7df 100644
--- a/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
+++ b/clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
@@ -639,28 +639,6 @@ Expected<StringRef> linkDevice(ArrayRef<StringRef> InputFiles,
   }
 }
 
-void diagnosticHandler(const DiagnosticInfo &DI) {
-  std::string ErrStorage;
-  raw_string_ostream OS(ErrStorage);
-  DiagnosticPrinterRawOStream DP(OS);
-  DI.print(DP);
-
-  switch (DI.getSeverity()) {
-  case DS_Error:
-    WithColor::error(errs(), LinkerExecutable) << ErrStorage << "\n";
-    break;
-  case DS_Warning:
-    WithColor::warning(errs(), LinkerExecutable) << ErrStorage << "\n";
-    break;
-  case DS_Note:
-    WithColor::note(errs(), LinkerExecutable) << ErrStorage << "\n";
-    break;
-  case DS_Remark:
-    WithColor::remark(errs()) << ErrStorage << "\n";
-    break;
-  }
-}
-
 Expected<StringRef> writeOffloadFile(const OffloadFile &File) {
   const OffloadBinary &Binary = *File.getBinary();
 


        


More information about the cfe-commits mailing list