Rework the logic for setting the TargetName. This appears to
[oota-llvm.git] / tools / llvm-diff / DiffConsumer.h
index b95d42713a643c5d818f8e21b0f1cb934905d53e..ac13a5e3e5ccc5c232a0e309926f0b1b61bf2094 100644 (file)
 #define _LLVM_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;
@@ -29,6 +28,7 @@ namespace llvm {
 
   /// The interface for consumers of difference data.
   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
@@ -66,8 +66,6 @@ namespace llvm {
     };
 
     raw_ostream &out;
-    Module *LModule;
-    Module *RModule;
     SmallVector<DiffContext, 5> contexts;
     bool Differences;
     unsigned Indent;
@@ -77,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;
   };
 }