Put all LLVM code into the llvm namespace, as per bug 109.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/bugpoint/BugDriver.cpp b/tools/bugpoint/BugDriver.cpp
index f0fb785..1284358 100644
--- a/tools/bugpoint/BugDriver.cpp
+++ b/tools/bugpoint/BugDriver.cpp
@@ -23,6 +23,8 @@
 #include "Support/FileUtilities.h"
 #include <memory>
 
+using namespace llvm;
+
 // Anonymous namespace to define command line options for debugging.
 //
 namespace {
@@ -36,6 +38,8 @@
                                 "(for miscompilation detection)"));
 }
 
+namespace llvm {
+
 /// getPassesString - Turn a list of passes into a string which indicates the
 /// command line options that must be passed to add the passes.
 ///
@@ -179,3 +183,5 @@
   }
   std::cout << std::flush;
 }
+
+} // End llvm namespace
diff --git a/tools/bugpoint/BugDriver.h b/tools/bugpoint/BugDriver.h
index e1af721..af04a7d 100644
--- a/tools/bugpoint/BugDriver.h
+++ b/tools/bugpoint/BugDriver.h
@@ -19,6 +19,8 @@
 #include <vector>
 #include <string>
 
+namespace llvm {
+
 class PassInfo;
 class Module;
 class Function;
@@ -207,4 +209,6 @@
 //
 void DeleteFunctionBody(Function *F);
 
+} // End llvm namespace
+
 #endif
diff --git a/tools/bugpoint/CodeGeneratorBug.cpp b/tools/bugpoint/CodeGeneratorBug.cpp
index 41df79a..b24620e 100644
--- a/tools/bugpoint/CodeGeneratorBug.cpp
+++ b/tools/bugpoint/CodeGeneratorBug.cpp
@@ -33,6 +33,8 @@
 #include <algorithm>
 #include <set>
 
+namespace llvm {
+
 extern cl::list<std::string> InputArgv;
 
 class ReduceMisCodegenFunctions : public ListReducer<Function*> {
@@ -408,3 +410,5 @@
 
   return false;
 }
+
+} // End llvm namespace
diff --git a/tools/bugpoint/CrashDebugger.cpp b/tools/bugpoint/CrashDebugger.cpp
index 0b2851f..8c29ea2 100644
--- a/tools/bugpoint/CrashDebugger.cpp
+++ b/tools/bugpoint/CrashDebugger.cpp
@@ -29,6 +29,8 @@
 #include <fstream>
 #include <set>
 
+namespace llvm {
+
 class DebugCrashes : public ListReducer<const PassInfo*> {
   BugDriver &BD;
 public:
@@ -397,3 +399,5 @@
 
   return false;
 }
+
+} // End llvm namespace
diff --git a/tools/bugpoint/ExecutionDriver.cpp b/tools/bugpoint/ExecutionDriver.cpp
index 596aeb9..9a3bd55 100644
--- a/tools/bugpoint/ExecutionDriver.cpp
+++ b/tools/bugpoint/ExecutionDriver.cpp
@@ -30,6 +30,8 @@
 #include <fstream>
 #include <iostream>
 
+using namespace llvm;
+
 namespace {
   // OutputType - Allow the user to specify the way code should be run, to test
   // for miscompilation.
@@ -58,6 +60,8 @@
                          "into executing programs"));
 }
 
+namespace llvm {
+
 // Anything specified after the --args option are taken as arguments to the
 // program being debugged.
 cl::list<std::string>
@@ -232,3 +236,5 @@
 bool BugDriver::isExecutingJIT() {
   return InterpreterSel == RunJIT;
 }
+
+} // End llvm namespace
diff --git a/tools/bugpoint/ExtractFunction.cpp b/tools/bugpoint/ExtractFunction.cpp
index 38e2586..4c671be 100644
--- a/tools/bugpoint/ExtractFunction.cpp
+++ b/tools/bugpoint/ExtractFunction.cpp
@@ -25,8 +25,15 @@
 #include "llvm/Target/TargetData.h"
 #include "Support/CommandLine.h"
 
+
+namespace llvm {
+
 bool DisableSimplifyCFG = false;
 
+} // End llvm namespace
+
+using namespace llvm;
+
 namespace {
   cl::opt<bool>
   NoADCE("disable-adce",
@@ -39,6 +46,8 @@
          cl::desc("Do not use the -simplifycfg pass to reduce testcases"));
 }
 
+namespace llvm {
+
 /// deleteInstructionFromProgram - This method clones the current Program and
 /// deletes the specified instruction from the cloned module.  It then runs a
 /// series of cleanup passes (ADCE and SimplifyCFG) to eliminate any code which
@@ -125,3 +134,5 @@
   }
   return M;
 }
+
+} // End llvm namespace
diff --git a/tools/bugpoint/ListReducer.h b/tools/bugpoint/ListReducer.h
index 0ab2ef9..0ad2406 100644
--- a/tools/bugpoint/ListReducer.h
+++ b/tools/bugpoint/ListReducer.h
@@ -17,6 +17,8 @@
 
 #include <vector>
 
+namespace llvm {
+
 template<typename ElTy>
 struct ListReducer {
   enum TestResult {
@@ -109,4 +111,6 @@
   }
 };
 
+} // End llvm namespace
+
 #endif
diff --git a/tools/bugpoint/Miscompilation.cpp b/tools/bugpoint/Miscompilation.cpp
index 5ec8b15..1fb46a6 100644
--- a/tools/bugpoint/Miscompilation.cpp
+++ b/tools/bugpoint/Miscompilation.cpp
@@ -19,6 +19,8 @@
 #include "llvm/Transforms/Utils/Linker.h"
 #include "Support/FileUtilities.h"
 
+namespace llvm {
+
 class ReduceMiscompilingPasses : public ListReducer<const PassInfo*> {
   BugDriver &BD;
 public:
@@ -308,3 +310,5 @@
 
   return false;
 }
+
+} // End llvm namespace
diff --git a/tools/bugpoint/OptimizerDriver.cpp b/tools/bugpoint/OptimizerDriver.cpp
index 600a25a..af9d1e5 100644
--- a/tools/bugpoint/OptimizerDriver.cpp
+++ b/tools/bugpoint/OptimizerDriver.cpp
@@ -26,6 +26,8 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 
+namespace llvm {
+
 /// writeProgramToFile - This writes the current "Program" to the named bytecode
 /// file.  If an error occurs, true is returned.
 ///
@@ -159,3 +161,5 @@
   // Was the child successful?
   return !ExitedOK;
 }
+
+} // End llvm namespace
diff --git a/tools/bugpoint/TestPasses.cpp b/tools/bugpoint/TestPasses.cpp
index af5c045..ee2c0d7 100644
--- a/tools/bugpoint/TestPasses.cpp
+++ b/tools/bugpoint/TestPasses.cpp
@@ -18,6 +18,8 @@
 #include "llvm/Pass.h"
 #include "llvm/Support/InstVisitor.h"
 
+using namespace llvm;
+
 namespace {
   /// CrashOnCalls - This pass is used to test bugpoint.  It intentionally
   /// crashes on any call instructions.
diff --git a/tools/bugpoint/ToolRunner.cpp b/tools/bugpoint/ToolRunner.cpp
index a66b868..50a9ad2 100644
--- a/tools/bugpoint/ToolRunner.cpp
+++ b/tools/bugpoint/ToolRunner.cpp
@@ -18,6 +18,8 @@
 #include <iostream>
 #include <fstream>
 
+namespace llvm {
+
 //===---------------------------------------------------------------------===//
 // LLI Implementation of AbstractIntepreter interface
 //
@@ -391,3 +393,5 @@
   Message = "Found gcc: " + GCCPath + "\n";
   return new GCC(GCCPath);
 }
+
+} // End llvm namespace
diff --git a/tools/bugpoint/ToolRunner.h b/tools/bugpoint/ToolRunner.h
index e23ec7f..8ce3f5d 100644
--- a/tools/bugpoint/ToolRunner.h
+++ b/tools/bugpoint/ToolRunner.h
@@ -20,6 +20,8 @@
 #include "Support/SystemUtils.h"
 #include <vector>
 
+namespace llvm {
+
 class CBE;
 class LLC;
 
@@ -137,4 +139,6 @@
   int OutputAsm(const std::string &Bytecode, std::string &OutputAsmFile);
 };
 
+} // End llvm namespace
+
 #endif
diff --git a/tools/bugpoint/bugpoint.cpp b/tools/bugpoint/bugpoint.cpp
index 8f55804..9bca7fd 100644
--- a/tools/bugpoint/bugpoint.cpp
+++ b/tools/bugpoint/bugpoint.cpp
@@ -19,6 +19,8 @@
 #include "Config/unistd.h"
 #include <sys/resource.h>
 
+using namespace llvm;
+
 static cl::list<std::string>
 InputFilenames(cl::Positional, cl::OneOrMore,
                cl::desc("<input llvm ll/bc files>"));