summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorHubert Tong <hubert.reinterpretcast@gmail.com>2019-07-04 21:40:28 +0000
committerHubert Tong <hubert.reinterpretcast@gmail.com>2019-07-04 21:40:28 +0000
commit53a83b7e3c675aa96225b8a68fb07e1a01646333 (patch)
tree963430108043c0b35a0296f49f734ee3cc532962 /clang/lib
parent09a066b3aabfc4ea21d59d464f032f5f8a25c059 (diff)
downloadbcm5719-llvm-53a83b7e3c675aa96225b8a68fb07e1a01646333.tar.gz
bcm5719-llvm-53a83b7e3c675aa96225b8a68fb07e1a01646333.zip
[NFC] Make some ObjectFormatType switches covering
Summary: This patch removes the `default` case from some switches on `llvm::Triple::ObjectFormatType`, and cases for the missing enumerators are then added. For `UnknownObjectFormat`, the action (`llvm_unreachable`) for the `default` case is kept. For the other unhandled cases, `report_fatal_error` is used instead. Reviewers: sfertile, jasonliu, daltenty Reviewed By: sfertile Subscribers: wuzish, aheejin, jsji, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D63767 llvm-svn: 365160
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGObjCMac.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp
index 4d4e54d214d..37b9b40b1d9 100644
--- a/clang/lib/CodeGen/CGObjCMac.cpp
+++ b/clang/lib/CodeGen/CGObjCMac.cpp
@@ -4921,7 +4921,7 @@ llvm::Value *CGObjCMac::EmitIvarOffset(CodeGen::CodeGenFunction &CGF,
std::string CGObjCCommonMac::GetSectionName(StringRef Section,
StringRef MachOAttributes) {
switch (CGM.getTriple().getObjectFormat()) {
- default:
+ case llvm::Triple::UnknownObjectFormat:
llvm_unreachable("unexpected object file format");
case llvm::Triple::MachO: {
if (MachOAttributes.empty())
@@ -4936,6 +4936,10 @@ std::string CGObjCCommonMac::GetSectionName(StringRef Section,
assert(Section.substr(0, 2) == "__" &&
"expected the name to begin with __");
return ("." + Section.substr(2) + "$B").str();
+ case llvm::Triple::Wasm:
+ case llvm::Triple::XCOFF:
+ llvm::report_fatal_error(
+ "Objective-C support is unimplemented for object file format.");
}
}
OpenPOWER on IntegriCloud