[llvm] r365160 - [NFC] Make some ObjectFormatType switches covering
Hubert Tong via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 4 14:40:28 PDT 2019
Author: hubert.reinterpretcast
Date: Thu Jul 4 14:40:28 2019
New Revision: 365160
URL: http://llvm.org/viewvc/llvm-project?rev=365160&view=rev
Log:
[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
Modified:
llvm/trunk/include/llvm/Support/TargetRegistry.h
Modified: llvm/trunk/include/llvm/Support/TargetRegistry.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/TargetRegistry.h?rev=365160&r1=365159&r2=365160&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/TargetRegistry.h (original)
+++ llvm/trunk/include/llvm/Support/TargetRegistry.h Thu Jul 4 14:40:28 2019
@@ -470,7 +470,7 @@ public:
bool DWARFMustBeAtTheEnd) const {
MCStreamer *S;
switch (T.getObjectFormat()) {
- default:
+ case Triple::UnknownObjectFormat:
llvm_unreachable("Unknown object format");
case Triple::COFF:
assert(T.isOSWindows() && "only Windows COFF is supported");
@@ -504,6 +504,8 @@ public:
S = createWasmStreamer(Ctx, std::move(TAB), std::move(OW),
std::move(Emitter), RelaxAll);
break;
+ case Triple::XCOFF:
+ report_fatal_error("XCOFF MCObjectStreamer not implemented yet.");
}
if (ObjectTargetStreamerCtorFn)
ObjectTargetStreamerCtorFn(*S, STI);
More information about the llvm-commits
mailing list