Merging r259645:
[oota-llvm.git] / tools / llvm-diff / DiffConsumer.h
index e5510ccee5a79cea9b1b18643e7702d3947e6cd4..855f6884e65b4c86b98c39551ce89a74315daeef 100644 (file)
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LLVM_DIFFCONSUMER_H_
-#define _LLVM_DIFFCONSUMER_H_
+#ifndef LLVM_TOOLS_LLVM_DIFF_DIFFCONSUMER_H
+#define LLVM_TOOLS_LLVM_DIFF_DIFFCONSUMER_H
 
 #include "DiffLog.h"
-
-#include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
-#include "llvm/Support/raw_ostream.h"
 #include "llvm/Support/Casting.h"
+#include "llvm/Support/raw_ostream.h"
 
 namespace llvm {
   class Module;
@@ -28,7 +27,9 @@ namespace llvm {
   class Function;
 
   /// The interface for consumers of difference data.
-  struct Consumer {
+  class Consumer {
+    virtual void anchor();
+  public:
     /// Record that a local context has been entered.  Left and
     /// Right are IR "containers" of some sort which are being
     /// considered for structural equivalence: global variables,
@@ -65,8 +66,6 @@ namespace llvm {
     };
 
     raw_ostream &out;
-    Module *LModule;
-    Module *RModule;
     SmallVector<DiffContext, 5> contexts;
     bool Differences;
     unsigned Indent;
@@ -76,15 +75,15 @@ namespace llvm {
     void indent();
 
   public:
-    DiffConsumer(Module *L, Module *R)
-      : out(errs()), LModule(L), RModule(R), Differences(false), Indent(0) {}
+    DiffConsumer()
+      : out(errs()), Differences(false), Indent(0) {}
 
     bool hadDifferences() const;
-    void enterContext(Value *L, Value *R);
-    void exitContext();
-    void log(StringRef text);
-    void logf(const LogBuilder &Log);
-    void logd(const DiffLogBuilder &Log);
+    void enterContext(Value *L, Value *R) override;
+    void exitContext() override;
+    void log(StringRef text) override;
+    void logf(const LogBuilder &Log) override;
+    void logd(const DiffLogBuilder &Log) override;
   };
 }