git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113120
91177308-0d34-0410-b5e6-
96231b3b80d8
-struct DiffContext {
- DiffContext(Value *L, Value *R)
- : L(L), R(R), Differences(false), IsFunction(isa<Function>(L)) {}
- Value *L;
- Value *R;
- bool Differences;
- bool IsFunction;
- DenseMap<Value*,unsigned> LNumbering;
- DenseMap<Value*,unsigned> RNumbering;
-};
+ struct DiffContext {
+ DiffContext(Value *L, Value *R)
+ : L(L), R(R), Differences(false), IsFunction(isa<Function>(L)) {}
+ Value *L;
+ Value *R;
+ bool Differences;
+ bool IsFunction;
+ DenseMap<Value*,unsigned> LNumbering;
+ DenseMap<Value*,unsigned> RNumbering;
+ };
+}
-void ComputeNumbering(Function *F, DenseMap<Value*,unsigned> &Numbering) {
+static void ComputeNumbering(Function *F, DenseMap<Value*,unsigned> &Numbering){
unsigned IN = 0;
// Arguments get the first numbers.
unsigned IN = 0;
// Arguments get the first numbers.
assert(!Numbering.empty() && "asked for numbering but numbering was no-op");
}
assert(!Numbering.empty() && "asked for numbering but numbering was no-op");
}
class DiffConsumer : public DifferenceEngine::Consumer {
private:
raw_ostream &out;
class DiffConsumer : public DifferenceEngine::Consumer {
private:
raw_ostream &out;
+} // end anonymous namespace
static void diffGlobal(DifferenceEngine &Engine, Module *L, Module *R,
StringRef Name) {
static void diffGlobal(DifferenceEngine &Engine, Module *L, Module *R,
StringRef Name) {
errs() << "No function named @" << Name << " in right module\n";
}
errs() << "No function named @" << Name << " in right module\n";
}
-cl::opt<std::string> LeftFilename(cl::Positional,
- cl::desc("<first file>"),
- cl::Required);
-cl::opt<std::string> RightFilename(cl::Positional,
- cl::desc("<second file>"),
- cl::Required);
-cl::list<std::string> GlobalsToCompare(cl::Positional,
- cl::desc("<globals to compare>"));
+static cl::opt<std::string> LeftFilename(cl::Positional,
+ cl::desc("<first file>"),
+ cl::Required);
+static cl::opt<std::string> RightFilename(cl::Positional,
+ cl::desc("<second file>"),
+ cl::Required);
+static cl::list<std::string> GlobalsToCompare(cl::Positional,
+ cl::desc("<globals to compare>"));
int main(int argc, char **argv) {
cl::ParseCommandLineOptions(argc, argv);
int main(int argc, char **argv) {
cl::ParseCommandLineOptions(argc, argv);