Quiesce warning about non-virtual d'tor in virtual class.
[oota-llvm.git] / tools / llvm-diff / DifferenceEngine.h
index bc3313173449e5cc9602ae8ef21fa28b5464ac6f..6eefb06118fa6d4973973bdbd71bff554369fc51 100644 (file)
@@ -79,8 +79,14 @@ namespace llvm {
       void addMatch(Instruction *L, Instruction *R) {
         Diff.push_back(DiffRecord(L, R));
       }
-      void addLeft(Instruction *L) { Diff.push_back(DiffRecord(L, 0)); }
-      void addRight(Instruction *R) { Diff.push_back(DiffRecord(0, R)); }
+      void addLeft(Instruction *L) {
+        // HACK: VS 2010 has a bug in the stdlib that requires this.
+        Diff.push_back(DiffRecord(L, DiffRecord::second_type(0)));
+      }
+      void addRight(Instruction *R) {
+        // HACK: VS 2010 has a bug in the stdlib that requires this.
+        Diff.push_back(DiffRecord(DiffRecord::first_type(0), R));
+      }
 
       unsigned getNumLines() const { return Diff.size(); }
       DiffChange getLineKind(unsigned I) const {
@@ -112,7 +118,7 @@ namespace llvm {
       virtual void logd(const DiffLogBuilder &Log) = 0;
 
     protected:
-      ~Consumer() {}
+      virtual ~Consumer() {}
     };
 
     /// A RAII object for recording the current context.
@@ -135,7 +141,7 @@ namespace llvm {
       virtual bool operator()(Value *L, Value *R) = 0;
 
     protected:
-      ~Oracle() {}
+      virtual ~Oracle() {}
     };
 
     DifferenceEngine(LLVMContext &context, Consumer &consumer)