Reapply r99881 with some fixes: only call destructor in releaseMemory!
[oota-llvm.git] / include / llvm / CodeGen / LiveInterval.h
index eb5901cf2f17ff67e4d3ffa225bb2d34731522b5..1f198e6325263712bf4490ac42c490d15fb22390 100644 (file)
@@ -330,12 +330,7 @@ namespace llvm {
     }
     
     void clear() {
-      while (!valnos.empty()) {
-        VNInfo *VNI = valnos.back();
-        valnos.pop_back();
-        VNI->~VNInfo();
-      }
-      
+      valnos.clear();
       ranges.clear();
     }