Simplify assertion in XCoreInstPrinter.
authorRichard Osborne <richard@xmos.com>
Mon, 17 Dec 2012 12:13:46 +0000 (12:13 +0000)
committerRichard Osborne <richard@xmos.com>
Mon, 17 Dec 2012 12:13:46 +0000 (12:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170321 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/XCore/InstPrinter/XCoreInstPrinter.cpp

index 0ecbf63cc6552e8bdc6e2f302fb868dd1a81a4bc..1592351c3861c72a7d29de38e33bf85c1583ac06 100644 (file)
@@ -53,8 +53,9 @@ static void printExpr(const MCExpr *Expr, raw_ostream &OS) {
     const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(BE->getRHS());
     assert(SRE && CE && "Binary expression must be sym+const.");
     Offset = CE->getValue();
-  } else if (!(SRE = dyn_cast<MCSymbolRefExpr>(Expr))) {
-    assert(false && "Unexpected MCExpr type.");
+  } else {
+    SRE = dyn_cast<MCSymbolRefExpr>(Expr);
+    assert(SRE && "Unexpected MCExpr type.");
   }
   assert(SRE->getKind() == MCSymbolRefExpr::VK_None);