1. Remove condition on delete.

2. Protect and outline createTargetAsmInfo.

3. Misc. kruft.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30169 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp
index ec449e4..807b462 100644
--- a/lib/Target/X86/X86TargetMachine.cpp
+++ b/lib/Target/X86/X86TargetMachine.cpp
@@ -11,6 +11,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "X86TargetAsmInfo.h"
 #include "X86TargetMachine.h"
 #include "X86.h"
 #include "llvm/Module.h"
@@ -35,6 +36,10 @@
   RegisterTarget<X86TargetMachine> X("x86", "  IA-32 (Pentium and above)");
 }
 
+const TargetAsmInfo *X86TargetMachine::createTargetAsmInfo() const {
+  return new X86TargetAsmInfo(*this);
+}
+
 unsigned X86TargetMachine::getJITMatchQuality() {
 #if defined(i386) || defined(__i386__) || defined(__x86__) || defined(_M_IX86)
   return 10;
diff --git a/lib/Target/X86/X86TargetMachine.h b/lib/Target/X86/X86TargetMachine.h
index 0bbef05..8278cf1 100644
--- a/lib/Target/X86/X86TargetMachine.h
+++ b/lib/Target/X86/X86TargetMachine.h
@@ -21,7 +21,6 @@
 #include "X86InstrInfo.h"
 #include "X86JITInfo.h"
 #include "X86Subtarget.h"
-#include "X86TargetAsmInfo.h"
 #include "X86ISelLowering.h"
 
 namespace llvm {
@@ -33,6 +32,10 @@
   X86InstrInfo      InstrInfo;
   X86JITInfo        JITInfo;
   X86TargetLowering TLInfo;
+
+protected:
+  virtual const TargetAsmInfo *createTargetAsmInfo() const;
+  
 public:
   X86TargetMachine(const Module &M, const std::string &FS);
 
@@ -51,10 +54,6 @@
   static unsigned getModuleMatchQuality(const Module &M);
   static unsigned getJITMatchQuality();
   
-  virtual const TargetAsmInfo *createTargetAsmInfo() const {
-    return static_cast<const TargetAsmInfo *>(new X86TargetAsmInfo(*this));
-  }
-  
   // Set up the pass pipeline.
   virtual bool addInstSelector(FunctionPassManager &PM, bool Fast);  
   virtual bool addPostRegAlloc(FunctionPassManager &PM, bool Fast);