[llvm-commits] CVS: llvm/lib/Target/Alpha/AlphaTargetMachine.cpp AlphaTargetMachine.h

Jim Laskey jlaskey at apple.com
Thu Sep 7 16:39:50 PDT 2006



Changes in directory llvm/lib/Target/Alpha:

AlphaTargetMachine.cpp updated: 1.30 -> 1.31
AlphaTargetMachine.h updated: 1.16 -> 1.17
---
Log message:

1. Remove condition on delete.

2. Protect and outline createTargetAsmInfo.

3. Misc. kruft.


---
Diffs of the changes:  (+9 -11)

 AlphaTargetMachine.cpp |    8 ++++++--
 AlphaTargetMachine.h   |   12 +++---------
 2 files changed, 9 insertions(+), 11 deletions(-)


Index: llvm/lib/Target/Alpha/AlphaTargetMachine.cpp
diff -u llvm/lib/Target/Alpha/AlphaTargetMachine.cpp:1.30 llvm/lib/Target/Alpha/AlphaTargetMachine.cpp:1.31
--- llvm/lib/Target/Alpha/AlphaTargetMachine.cpp:1.30	Thu Sep  7 17:06:40 2006
+++ llvm/lib/Target/Alpha/AlphaTargetMachine.cpp	Thu Sep  7 18:39:26 2006
@@ -12,6 +12,7 @@
 
 #include "Alpha.h"
 #include "AlphaJITInfo.h"
+#include "AlphaTargetAsmInfo.h"
 #include "AlphaTargetMachine.h"
 #include "llvm/Module.h"
 #include "llvm/PassManager.h"
@@ -24,6 +25,10 @@
   RegisterTarget<AlphaTargetMachine> X("alpha", "  Alpha (incomplete)");
 }
 
+const TargetAsmInfo *AlphaTargetMachine::createTargetAsmInfo() const {
+  return new AlphaTargetAsmInfo(*this);
+}
+
 unsigned AlphaTargetMachine::getModuleMatchQuality(const Module &M) {
   // We strongly match "alpha*".
   std::string TT = M.getTargetTriple();
@@ -53,8 +58,7 @@
   : DataLayout("e"),
     FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
     JITInfo(*this),
-    Subtarget(M, FS),
-    AsmInfo(NULL) {
+    Subtarget(M, FS) {
 }
 
 


Index: llvm/lib/Target/Alpha/AlphaTargetMachine.h
diff -u llvm/lib/Target/Alpha/AlphaTargetMachine.h:1.16 llvm/lib/Target/Alpha/AlphaTargetMachine.h:1.17
--- llvm/lib/Target/Alpha/AlphaTargetMachine.h:1.16	Thu Sep  7 17:06:40 2006
+++ llvm/lib/Target/Alpha/AlphaTargetMachine.h	Thu Sep  7 18:39:26 2006
@@ -20,7 +20,6 @@
 #include "AlphaInstrInfo.h"
 #include "AlphaJITInfo.h"
 #include "AlphaSubtarget.h"
-#include "AlphaTargetAsmInfo.h"
 
 namespace llvm {
 
@@ -32,13 +31,12 @@
   TargetFrameInfo FrameInfo;
   AlphaJITInfo JITInfo;
   AlphaSubtarget Subtarget;
-  AlphaTargetAsmInfo *AsmInfo;
+  
+protected:
+  virtual const TargetAsmInfo *createTargetAsmInfo() const;
   
 public:
   AlphaTargetMachine(const Module &M, const std::string &FS);
-  ~AlphaTargetMachine() {
-    if (AsmInfo) delete AsmInfo;
-  }
 
   virtual const AlphaInstrInfo *getInstrInfo() const { return &InstrInfo; }
   virtual const TargetFrameInfo  *getFrameInfo() const { return &FrameInfo; }
@@ -51,10 +49,6 @@
     return &JITInfo;
   }
 
-  virtual const TargetAsmInfo *createTargetAsmInfo() const {
-    return static_cast<const TargetAsmInfo *>(new AlphaTargetAsmInfo(*this));
-  }
-
   static unsigned getJITMatchQuality();
   static unsigned getModuleMatchQuality(const Module &M);
   






More information about the llvm-commits mailing list