[clang] a57d16b - [CodeGen] Fix -Wswitch after D116462

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 19 17:33:19 PDT 2022


Author: Fangrui Song
Date: 2022-04-19T17:33:15-07:00
New Revision: a57d16bf80db1bdb785df6b7bca96cb4daff5ea7

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

LOG: [CodeGen] Fix -Wswitch after D116462

Added: 
    

Modified: 
    clang/lib/CodeGen/CGObjCMac.cpp
    clang/lib/CodeGen/CodeGenModule.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp
index 2ec9ef9ae0605..46e65eb1ed43d 100644
--- a/clang/lib/CodeGen/CGObjCMac.cpp
+++ b/clang/lib/CodeGen/CGObjCMac.cpp
@@ -5068,6 +5068,7 @@ std::string CGObjCCommonMac::GetSectionName(StringRef Section,
     return ("." + Section.substr(2) + "$B").str();
   case llvm::Triple::Wasm:
   case llvm::Triple::GOFF:
+  case llvm::Triple::SPIRV:
   case llvm::Triple::XCOFF:
   case llvm::Triple::DXContainer:
     llvm::report_fatal_error(

diff  --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 9f6e2e5a9f52d..e1afe81e5a80e 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -5502,12 +5502,11 @@ CodeGenModule::GetAddrOfConstantCFString(const StringLiteral *Literal) {
   switch (Triple.getObjectFormat()) {
   case llvm::Triple::UnknownObjectFormat:
     llvm_unreachable("unknown file format");
+  case llvm::Triple::DXContainer:
   case llvm::Triple::GOFF:
-    llvm_unreachable("GOFF is not yet implemented");
+  case llvm::Triple::SPIRV:
   case llvm::Triple::XCOFF:
-    llvm_unreachable("XCOFF is not yet implemented");
-  case llvm::Triple::DXContainer:
-    llvm_unreachable("DXContainer is not yet implemented");
+    llvm_unreachable("unimplemented");
   case llvm::Triple::COFF:
   case llvm::Triple::ELF:
   case llvm::Triple::Wasm:


        


More information about the cfe-commits mailing list