Privatize LLCOptions.  It had no business being visible to the entire
program.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/llc/llc.cpp b/tools/llc/llc.cpp
index 6ac3175f..4bf26d5 100644
--- a/tools/llc/llc.cpp
+++ b/tools/llc/llc.cpp
@@ -11,29 +11,39 @@
 // 
 //**************************************************************************/
 
-//************************** System Include Files **************************/
-
-//*************************** User Include Files ***************************/
-
 #include "llvm/Module.h"
 #include "llvm/Method.h"
 #include "llvm/Bytecode/Reader.h"
 #include "llvm/Bytecode/Writer.h"
-#include "llvm/CodeGen/InstrForest.h"
 #include "llvm/CodeGen/InstrSelection.h"
-#include "llvm/LLC/LLCOptions.h"
 #include "llvm/LLC/CompileContext.h"
+#include "llvm/CodeGen/Sparc.h"
+#include "LLCOptions.h"
 
-//************************** Forward Declarations **************************/
+CompileContext::~CompileContext() { delete targetMachine; }
 
-class Module;
-class CompileContext;
-
-
-static bool	CompileModule	(Module *module,
-				 CompileContext& compileContext);
-
-int DebugInstrSelectLevel = DEBUG_INSTR_TREES;
+static bool CompileModule(Module *module, CompileContext& ccontext,
+			  LLCOptions &Options) {
+  bool failed = false;
+  
+  for (Module::MethodListType::const_iterator
+	 methodIter = module->getMethodList().begin();
+       methodIter != module->getMethodList().end();
+       ++methodIter)
+    {
+      Method* method = *methodIter;
+      
+      if (SelectInstructionsForMethod(method, ccontext, 
+			   Options.IntOptionValue(DEBUG_INSTR_SELECT_OPT)))
+	{
+	  failed = true;
+	  cerr << "Instruction selection failed for method "
+	       << method->getName() << "\n\n";
+	}
+    }
+  
+  return failed;
+}
 
 
 //---------------------------------------------------------------------------
@@ -42,26 +52,21 @@
 // Entry point for the driver.
 //---------------------------------------------------------------------------
 
-
-int
-main(int argc, const char** argv, const char** envp)
-{
-  CompileContext compileContext(argc, argv, envp);
+int main(int argc, const char** argv, const char** envp) {
+  LLCOptions Options(argc, argv, envp);
+  CompileContext compileContext(new UltraSparc());
   
-  Module *module =
-    ParseBytecodeFile(compileContext.getOptions().getInputFileName());
-  
+  Module *module = ParseBytecodeFile(Options.getInputFileName());
   if (module == 0) {
     cerr << "bytecode didn't read correctly.\n";
     return 1;
   }
   
-  bool failure = CompileModule(module, compileContext);
+  bool failure = CompileModule(module, compileContext, Options);
   
-  if (failure)
-    {
+  if (failure) {
       cerr << "Error compiling "
-	   << compileContext.getOptions().getInputFileName() << "!\n";
+	   << Options.getInputFileName() << "!\n";
       delete module;
       return 1;
     }
@@ -74,30 +79,3 @@
   delete module;
   return 0;
 }
-
-
-static bool
-CompileModule(Module *module,
-	      CompileContext& ccontext)
-{
-  bool failed = false;
-  
-  for (Module::MethodListType::const_iterator
-	 methodIter = module->getMethodList().begin();
-       methodIter != module->getMethodList().end();
-       ++methodIter)
-    {
-      Method* method = *methodIter;
-      
-      if (SelectInstructionsForMethod(method, ccontext))
-	{
-	  failed = true;
-	  cerr << "Instruction selection failed for method "
-	       << (method->hasName()? method->getName() : "")
-	       << endl << endl;
-	}
-    }
-  
-  return failed;
-}
-