[llvm-commits] [llvm] r123297 - /llvm/trunk/lib/Target/ARM/ARMMCCodeEmitter.cpp
Chris Lattner
clattner at apple.com
Tue Jan 11 17:47:49 PST 2011
On Jan 11, 2011, at 5:42 PM, Matt Beaumont-Gay wrote:
> Author: matthewbg
> Date: Tue Jan 11 19:42:42 2011
> New Revision: 123297
>
> URL: http://llvm.org/viewvc/llvm-project?rev=123297&view=rev
> Log:
> Prefer llvm_unreachable to assert(0)
Hi Matt,
Please use assert(0) unless we need the "does not fallthrough" behavior of llvm_unreachable.
-Chris
>
> Modified:
> llvm/trunk/lib/Target/ARM/ARMMCCodeEmitter.cpp
>
> Modified: llvm/trunk/lib/Target/ARM/ARMMCCodeEmitter.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMMCCodeEmitter.cpp?rev=123297&r1=123296&r2=123297&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Target/ARM/ARMMCCodeEmitter.cpp (original)
> +++ llvm/trunk/lib/Target/ARM/ARMMCCodeEmitter.cpp Tue Jan 11 19:42:42 2011
> @@ -129,7 +129,7 @@
> SmallVectorImpl<MCFixup> &Fixups) const {
> ARM_AM::AMSubMode Mode = (ARM_AM::AMSubMode)MI.getOperand(OpIdx).getImm();
> switch (Mode) {
> - default: assert(0 && "Unknown addressing sub-mode!");
> + default: llvm_unreachable("Unknown addressing sub-mode!");
> case ARM_AM::da: return 0;
> case ARM_AM::ia: return 1;
> case ARM_AM::db: return 2;
> @@ -648,7 +648,7 @@
> switch (Expr->getKind()) {
> case MCExpr::SymbolRef: return false;
> case MCExpr::Binary: return true;
> - default: assert(0 && "Unexpected expression type");
> + default: llvm_unreachable("Unexpected expression type");
> }
> }
>
> @@ -669,7 +669,7 @@
> const MCExpr *OrigExpr = MO.getExpr();
> MCFixupKind Kind;
> switch (Expr->getKind()) {
> - default: assert(0 && "Unsupported ARMFixup");
> + default: llvm_unreachable("Unsupported ARMFixup");
> case MCSymbolRefExpr::VK_ARM_HI16:
> Kind = MCFixupKind(ARM::fixup_arm_movt_hi16);
> if (EvaluateAsPCRel(OrigExpr))
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list