From 53b1acd06d703fcdb251b23337c2bb5d507b0611 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 5 Sep 2010 21:25:43 +0000 Subject: cleanups: mark stuff static, only tagdecls should be in anon namespaces. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113120 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-diff/llvm-diff.cpp | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) (limited to 'tools') diff --git a/tools/llvm-diff/llvm-diff.cpp b/tools/llvm-diff/llvm-diff.cpp index 16a990fb28..579b60ffdf 100644 --- a/tools/llvm-diff/llvm-diff.cpp +++ b/tools/llvm-diff/llvm-diff.cpp @@ -63,18 +63,19 @@ static Module *ReadModule(LLVMContext &Context, StringRef Name) { } namespace { -struct DiffContext { - DiffContext(Value *L, Value *R) - : L(L), R(R), Differences(false), IsFunction(isa(L)) {} - Value *L; - Value *R; - bool Differences; - bool IsFunction; - DenseMap LNumbering; - DenseMap RNumbering; -}; + struct DiffContext { + DiffContext(Value *L, Value *R) + : L(L), R(R), Differences(false), IsFunction(isa(L)) {} + Value *L; + Value *R; + bool Differences; + bool IsFunction; + DenseMap LNumbering; + DenseMap RNumbering; + }; +} -void ComputeNumbering(Function *F, DenseMap &Numbering) { +static void ComputeNumbering(Function *F, DenseMap &Numbering){ unsigned IN = 0; // Arguments get the first numbers. @@ -98,6 +99,7 @@ void ComputeNumbering(Function *F, DenseMap &Numbering) { assert(!Numbering.empty() && "asked for numbering but numbering was no-op"); } +namespace { class DiffConsumer : public DifferenceEngine::Consumer { private: raw_ostream &out; @@ -273,7 +275,7 @@ public: } }; -} +} // end anonymous namespace static void diffGlobal(DifferenceEngine &Engine, Module *L, Module *R, StringRef Name) { @@ -292,14 +294,14 @@ static void diffGlobal(DifferenceEngine &Engine, Module *L, Module *R, errs() << "No function named @" << Name << " in right module\n"; } -cl::opt LeftFilename(cl::Positional, - cl::desc(""), - cl::Required); -cl::opt RightFilename(cl::Positional, - cl::desc(""), - cl::Required); -cl::list GlobalsToCompare(cl::Positional, - cl::desc("")); +static cl::opt LeftFilename(cl::Positional, + cl::desc(""), + cl::Required); +static cl::opt RightFilename(cl::Positional, + cl::desc(""), + cl::Required); +static cl::list GlobalsToCompare(cl::Positional, + cl::desc("")); int main(int argc, char **argv) { cl::ParseCommandLineOptions(argc, argv); -- cgit v1.2.3