Add support for the Switch instruction by running the lowerSwitch pass first
authorChris Lattner <sabre@nondot.org>
Wed, 23 Apr 2003 16:24:55 +0000 (16:24 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 23 Apr 2003 16:24:55 +0000 (16:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5867 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/SparcV9/SparcV9TargetMachine.cpp
lib/Target/X86/X86TargetMachine.cpp

index 81de95c6af78979638b3e98b3d23aedae089598d..c0269052be5201cc81f57b2068fc0251e056ce92 100644 (file)
@@ -143,6 +143,9 @@ UltraSparc::UltraSparc()
 //
 bool UltraSparc::addPassesToEmitAssembly(PassManager &PM, std::ostream &Out)
 {
+  // FIXME: implement the switch instruction in the instruction selector.
+  PM.add(createLowerSwitchPass());
+
   // Construct and initialize the MachineFunction object for this fn.
   PM.add(createMachineCodeConstructionPass(*this));
 
index 5015a9605b392d6775decf644c4e29f130aee7e3..4113d0e6dc8948772d2389fc5dc441c35b3cc339 100644 (file)
@@ -6,10 +6,11 @@
 
 #include "X86TargetMachine.h"
 #include "X86.h"
+#include "llvm/PassManager.h"
 #include "llvm/Target/TargetMachineImpls.h"
 #include "llvm/CodeGen/MachineFunction.h"
 #include "llvm/CodeGen/Passes.h"
-#include "llvm/PassManager.h"
+#include "llvm/Transforms/Scalar.h"
 #include "Support/CommandLine.h"
 #include "Support/Statistic.h"
 #include <iostream>
@@ -45,6 +46,9 @@ X86TargetMachine::X86TargetMachine(unsigned Config)
 /// not supported for this target.
 ///
 bool X86TargetMachine::addPassesToJITCompile(PassManager &PM) {
+  // FIXME: Implement the switch instruction in the instruction selector!
+  PM.add(createLowerSwitchPass());
+
   PM.add(createSimpleX86InstructionSelector(*this));
 
   // TODO: optional optimizations go here