summaryrefslogtreecommitdiff
path: root/tools/llvm-diff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2012-08-15 19:34:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2012-08-15 19:34:23 +0000
commit58b69754af0cbff56b1cfce9be9392e4451f6628 (patch)
treeeacfc83d988e4b9d11114387ae7dc41243f2a363 /tools/llvm-diff
parent0378662f5bd3dbe8305a485b0282bceb8b52f465 (diff)
downloadsrc-test2-58b69754af0cbff56b1cfce9be9392e4451f6628.tar.gz
src-test2-58b69754af0cbff56b1cfce9be9392e4451f6628.zip
Notes
Diffstat (limited to 'tools/llvm-diff')
-rw-r--r--tools/llvm-diff/DiffConsumer.cpp2
-rw-r--r--tools/llvm-diff/DiffConsumer.h6
-rw-r--r--tools/llvm-diff/DifferenceEngine.cpp8
-rw-r--r--tools/llvm-diff/DifferenceEngine.h5
-rw-r--r--tools/llvm-diff/llvm-diff.cpp4
5 files changed, 11 insertions, 14 deletions
diff --git a/tools/llvm-diff/DiffConsumer.cpp b/tools/llvm-diff/DiffConsumer.cpp
index 05280392a47f..91c1699bee53 100644
--- a/tools/llvm-diff/DiffConsumer.cpp
+++ b/tools/llvm-diff/DiffConsumer.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
-// This files implements the the LLVM difference Consumer
+// This files implements the LLVM difference Consumer
//
//===----------------------------------------------------------------------===//
diff --git a/tools/llvm-diff/DiffConsumer.h b/tools/llvm-diff/DiffConsumer.h
index 2060fe1c944f..98e369ba9768 100644
--- a/tools/llvm-diff/DiffConsumer.h
+++ b/tools/llvm-diff/DiffConsumer.h
@@ -67,8 +67,6 @@ namespace llvm {
};
raw_ostream &out;
- Module *LModule;
- Module *RModule;
SmallVector<DiffContext, 5> contexts;
bool Differences;
unsigned Indent;
@@ -78,8 +76,8 @@ 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);
diff --git a/tools/llvm-diff/DifferenceEngine.cpp b/tools/llvm-diff/DifferenceEngine.cpp
index a5a99f5b9c47..0c1e30c987ea 100644
--- a/tools/llvm-diff/DifferenceEngine.cpp
+++ b/tools/llvm-diff/DifferenceEngine.cpp
@@ -318,15 +318,15 @@ class FunctionDifferenceEngine {
bool Difference = false;
- DenseMap<ConstantInt*,BasicBlock*> LCases;
+ DenseMap<Constant*, BasicBlock*> LCases;
for (SwitchInst::CaseIt I = LI->case_begin(), E = LI->case_end();
I != E; ++I)
- LCases[I.getCaseValue()] = I.getCaseSuccessor();
+ LCases[I.getCaseValueEx()] = I.getCaseSuccessor();
for (SwitchInst::CaseIt I = RI->case_begin(), E = RI->case_end();
I != E; ++I) {
- ConstantInt *CaseValue = I.getCaseValue();
+ IntegersSubset CaseValue = I.getCaseValueEx();
BasicBlock *LCase = LCases[CaseValue];
if (LCase) {
if (TryUnify) tryUnify(LCase, I.getCaseSuccessor());
@@ -338,7 +338,7 @@ class FunctionDifferenceEngine {
}
}
if (!Difference)
- for (DenseMap<ConstantInt*,BasicBlock*>::iterator
+ for (DenseMap<Constant*, BasicBlock*>::iterator
I = LCases.begin(), E = LCases.end(); I != E; ++I) {
if (Complain)
Engine.logf("left switch has extra case %l") << I->first;
diff --git a/tools/llvm-diff/DifferenceEngine.h b/tools/llvm-diff/DifferenceEngine.h
index 7ea79e430ff5..0246d8ff5d6b 100644
--- a/tools/llvm-diff/DifferenceEngine.h
+++ b/tools/llvm-diff/DifferenceEngine.h
@@ -59,8 +59,8 @@ namespace llvm {
virtual ~Oracle() {}
};
- DifferenceEngine(LLVMContext &context, Consumer &consumer)
- : context(context), consumer(consumer), globalValueOracle(0) {}
+ DifferenceEngine(Consumer &consumer)
+ : consumer(consumer), globalValueOracle(0) {}
void diff(Module *L, Module *R);
void diff(Function *L, Function *R);
@@ -84,7 +84,6 @@ namespace llvm {
bool equivalentAsOperands(GlobalValue *L, GlobalValue *R);
private:
- LLVMContext &context;
Consumer &consumer;
Oracle *globalValueOracle;
};
diff --git a/tools/llvm-diff/llvm-diff.cpp b/tools/llvm-diff/llvm-diff.cpp
index 774169bcde17..45957b3f8c92 100644
--- a/tools/llvm-diff/llvm-diff.cpp
+++ b/tools/llvm-diff/llvm-diff.cpp
@@ -78,8 +78,8 @@ int main(int argc, char **argv) {
Module *RModule = ReadModule(Context, RightFilename);
if (!LModule || !RModule) return 1;
- DiffConsumer Consumer(LModule, RModule);
- DifferenceEngine Engine(Context, Consumer);
+ DiffConsumer Consumer;
+ DifferenceEngine Engine(Consumer);
// If any global names were given, just diff those.
if (!GlobalsToCompare.empty()) {