[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetMachine.cpp

Alkis Evlogimenos alkis at cs.uiuc.edu
Thu Oct 2 11:59:07 PDT 2003


Changes in directory llvm/lib/Target/X86:

X86TargetMachine.cpp updated: 1.28 -> 1.29

---
Log message:

Moved enum and command-line option in separate file. Also added function that returns the user selected register allocator to the caller.


---
Diffs of the changes:

Index: llvm/lib/Target/X86/X86TargetMachine.cpp
diff -u llvm/lib/Target/X86/X86TargetMachine.cpp:1.28 llvm/lib/Target/X86/X86TargetMachine.cpp:1.29
--- llvm/lib/Target/X86/X86TargetMachine.cpp:1.28	Thu Oct  2 01:13:19 2003
+++ llvm/lib/Target/X86/X86TargetMachine.cpp	Thu Oct  2 11:57:49 2003
@@ -16,15 +16,6 @@
 #include "Support/Statistic.h"
 
 namespace {
-  cl::opt<RegAllocName>
-  RegAlloc("regalloc",
-           cl::desc("Register allocator to use: (default = simple)"),
-           cl::Prefix,
-           cl::values(clEnumVal(simple, "  simple register allocator"),
-                      clEnumVal(local,  "  local register allocator"),
-                      0),
-           cl::init(local));
-
   cl::opt<bool> PrintCode("print-machineinstrs",
 			  cl::desc("Print generated machine code"));
   cl::opt<bool> NoPatternISel("disable-pattern-isel", cl::init(true),
@@ -73,16 +64,7 @@
     PM.add(createMachineFunctionPrinterPass());
 
   // Perform register allocation to convert to a concrete x86 representation
-  switch (RegAlloc) {
-  case simple:
-    PM.add(createSimpleRegisterAllocator());
-    break;
-  case local:
-    PM.add(createLocalRegisterAllocator());
-    break;
-  default:
-    assert(0 && "no register allocator selected");
-  }
+  PM.add(createRegisterAllocator());
 
   if (PrintCode)
     PM.add(createMachineFunctionPrinterPass());
@@ -126,16 +108,7 @@
     PM.add(createMachineFunctionPrinterPass());
 
   // Perform register allocation to convert to a concrete x86 representation
-  switch (RegAlloc) {
-  case simple:
-    PM.add(createSimpleRegisterAllocator());
-    break;
-  case local:
-    PM.add(createLocalRegisterAllocator());
-    break;
-  default:
-    assert(0 && "no register allocator selected");
-  }
+  PM.add(createRegisterAllocator());
 
   if (PrintCode)
     PM.add(createMachineFunctionPrinterPass());





More information about the llvm-commits mailing list