Clean up a lot of the code I added yesterday by exposing the IntrinsicLowering
implementation from the TargetMachine directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10636 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp
index e4d1ecb..879ad50 100644
--- a/lib/Target/X86/X86TargetMachine.cpp
+++ b/lib/Target/X86/X86TargetMachine.cpp
@@ -45,15 +45,10 @@
 
 /// X86TargetMachine ctor - Create an ILP32 architecture model
 ///
-X86TargetMachine::X86TargetMachine(const Module &M, IntrinsicLowering *il)
-  : TargetMachine("X86", true, 4, 4, 4, 4, 4),
-    IL(il ? il : new DefaultIntrinsicLowering()),
+X86TargetMachine::X86TargetMachine(const Module &M, IntrinsicLowering *IL)
+  : TargetMachine("X86", IL, true, 4, 4, 4, 4, 4),
     FrameInfo(TargetFrameInfo::StackGrowsDown, 8/*16 for SSE*/, 4),
-    JITInfo(*this, *IL) {
-}
-
-X86TargetMachine::~X86TargetMachine() {
-  delete IL;
+    JITInfo(*this) {
 }
 
 
@@ -72,9 +67,9 @@
   PM.add(createCFGSimplificationPass());
 
   if (NoPatternISel)
-    PM.add(createX86SimpleInstructionSelector(*this, *IL));
+    PM.add(createX86SimpleInstructionSelector(*this));
   else
-    PM.add(createX86PatternInstructionSelector(*this, *IL));
+    PM.add(createX86PatternInstructionSelector(*this));
 
   // Run optional SSA-based machine code optimizations next...
   if (!NoSSAPeephole)
@@ -127,9 +122,9 @@
   PM.add(createCFGSimplificationPass());
 
   if (NoPatternISel)
-    PM.add(createX86SimpleInstructionSelector(TM, IL));
+    PM.add(createX86SimpleInstructionSelector(TM));
   else
-    PM.add(createX86PatternInstructionSelector(TM, IL));
+    PM.add(createX86PatternInstructionSelector(TM));
 
   // Run optional SSA-based machine code optimizations next...
   if (!NoSSAPeephole)