ADT: Avoid relying on UB in ilist_node::getNextNode()
[oota-llvm.git] / include / llvm / CodeGen / DwarfStringPoolEntry.h
index 19fbbff039992706c6a0c06ab9c85f331ddb0ada..fc2b5ddd2d2cfaa40780e95db8aa3182999679ec 100644 (file)
@@ -34,10 +34,16 @@ public:
       : I(&I) {}
 
   explicit operator bool() const { return I; }
-  MCSymbol *getSymbol() const { return I->second.Symbol; }
+  MCSymbol *getSymbol() const {
+    assert(I->second.Symbol && "No symbol available!");
+    return I->second.Symbol;
+  }
   unsigned getOffset() const { return I->second.Offset; }
   unsigned getIndex() const { return I->second.Index; }
   StringRef getString() const { return I->first(); }
+
+  bool operator==(const DwarfStringPoolEntryRef &X) const { return I == X.I; }
+  bool operator!=(const DwarfStringPoolEntryRef &X) const { return I != X.I; }
 };
 
 } // end namespace llvm