[llvm-commits] [llvm] r149809 - in /llvm/trunk/lib/Target/X86: InstPrinter/X86ATTInstPrinter.cpp InstPrinter/X86IntelInstPrinter.cpp MCTargetDesc/X86AsmBackend.cpp MCTargetDesc/X86BaseInfo.h MCTargetDesc/X86MCCodeEmitter.cpp X86ELFWriterInfo.cpp X86ISelLowering.cpp X86MCInstLower.cpp
Bob Wilson
bob.wilson at apple.com
Sun Feb 5 20:43:33 PST 2012
On Feb 4, 2012, at 9:38 PM, Craig Topper wrote:
> Author: ctopper
> Date: Sat Feb 4 23:38:58 2012
> New Revision: 149809
>
> URL: http://llvm.org/viewvc/llvm-project?rev=149809&view=rev
> Log:
> Convert assert(0) to llvm_unreachable in X86 Target directory.
>
> Modified:
> llvm/trunk/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp
> llvm/trunk/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp
> llvm/trunk/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
> llvm/trunk/lib/Target/X86/MCTargetDesc/X86BaseInfo.h
> llvm/trunk/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
> llvm/trunk/lib/Target/X86/X86ELFWriterInfo.cpp
> llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
> llvm/trunk/lib/Target/X86/X86MCInstLower.cpp
>
> Modified: llvm/trunk/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp?rev=149809&r1=149808&r2=149809&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp (original)
> +++ llvm/trunk/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp Sat Feb 4 23:38:58 2012
> @@ -59,7 +59,7 @@
> void X86ATTInstPrinter::printSSECC(const MCInst *MI, unsigned Op,
> raw_ostream &O) {
> switch (MI->getOperand(Op).getImm()) {
> - default: assert(0 && "Invalid ssecc argument!");
> + default: llvm_unreachable("Invalid ssecc argument!");
> case 0: O << "eq"; break;
> case 1: O << "lt"; break;
> case 2: O << "le"; break;
Why? This does not seem like the intended use of llvm_unreachable, which is to mark unreachable code rather than to replace assert.
More information about the llvm-commits
mailing list