Remove an extra whitespace.
[oota-llvm.git] / lib / IR / DebugInfo.cpp
index 4e36a8df3e1efd4314c21538995c39672d8ea421..42b0dc0fc271b0cf1544b5b8ac66a47d269c395d 100644 (file)
@@ -607,7 +607,13 @@ bool DIVariable::Verify() const {
 }
 
 /// Verify - Verify that a variable descriptor is well formed.
-bool DIExpression::Verify() const { return isExpression(); }
+bool DIExpression::Verify() const {
+  // Empty DIExpressions may be represented as a nullptr.
+  if (!DbgNode)
+    return true;
+
+  return isExpression();
+}
 
 /// Verify - Verify that a location descriptor is well formed.
 bool DILocation::Verify() const {
@@ -1450,11 +1456,13 @@ void DIExpression::printInternal(raw_ostream &OS) const {
     case DW_OP_piece: {
       unsigned Offset = getElement(++I);
       unsigned Size = getElement(++I);
-      OS << " offset=" << Offset << ", size= " << Size;
+      OS << " offset=" << Offset << ", size=" << Size;
       break;
     }
     default:
-      break;
+      // Else bail out early. This may be a line table entry.
+      OS << "Unknown]";
+      return;
     }
     OS << "]";
   }