[llvm-commits] [llvm] r170321 - /llvm/trunk/lib/Target/XCore/InstPrinter/XCoreInstPrinter.cpp

Richard Osborne richard at xmos.com
Mon Dec 17 04:13:46 PST 2012


Author: friedgold
Date: Mon Dec 17 06:13:46 2012
New Revision: 170321

URL: http://llvm.org/viewvc/llvm-project?rev=170321&view=rev
Log:
Simplify assertion in XCoreInstPrinter.

Modified:
    llvm/trunk/lib/Target/XCore/InstPrinter/XCoreInstPrinter.cpp

Modified: llvm/trunk/lib/Target/XCore/InstPrinter/XCoreInstPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/InstPrinter/XCoreInstPrinter.cpp?rev=170321&r1=170320&r2=170321&view=diff
==============================================================================
--- llvm/trunk/lib/Target/XCore/InstPrinter/XCoreInstPrinter.cpp (original)
+++ llvm/trunk/lib/Target/XCore/InstPrinter/XCoreInstPrinter.cpp Mon Dec 17 06:13:46 2012
@@ -53,8 +53,9 @@
     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);
 





More information about the llvm-commits mailing list