]> granicus.if.org Git - clang/commit
[sanitizers] Use covering ObjectFormatType switches
authorHubert Tong <hubert.reinterpretcast@gmail.com>
Fri, 19 Jul 2019 08:46:18 +0000 (08:46 +0000)
committerHubert Tong <hubert.reinterpretcast@gmail.com>
Fri, 19 Jul 2019 08:46:18 +0000 (08:46 +0000)
commitb8bf8b22ff2179614588936299d0330997224fc8
treee542868a3c920eb19f24bd9a323c797d288d0b8f
parent59207d134acb8a1c6cb9974c32c1c04bd31f8f7b
[sanitizers] Use covering ObjectFormatType switches

Summary:
This patch removes the `default` case from some switches on
`llvm::Triple::ObjectFormatType`, and cases for the missing enumerators
(`UnknownObjectFormat`, `Wasm`, and `XCOFF`) are then added.

For `UnknownObjectFormat`, the effect of the action for the `default`
case is maintained; otherwise, where `llvm_unreachable` is called,
`report_fatal_error` is used instead.

Where the `default` case returns a default value, `report_fatal_error`
is used for XCOFF as a placeholder. For `Wasm`, the effect of the action
for the `default` case in maintained.

The code is structured to avoid strongly implying that the `Wasm` case
is present for any reason other than to make the switch cover all
`ObjectFormatType` enumerator values.

Reviewers: sfertile, jasonliu, daltenty

Reviewed By: sfertile

Subscribers: hiraditya, aheejin, sunfish, llvm-commits, cfe-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D64222

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366544 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/BackendUtil.cpp