PTX: MC-ize the PTX backend (patch 2 of N)
authorJustin Holewinski <justin.holewinski@gmail.com>
Wed, 28 Sep 2011 14:32:06 +0000 (14:32 +0000)
committerJustin Holewinski <justin.holewinski@gmail.com>
Wed, 28 Sep 2011 14:32:06 +0000 (14:32 +0000)
Get rid of some of the no-longer-needed parts of PTXAsmPrinter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140698 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PTX/PTXAsmPrinter.cpp
lib/Target/PTX/PTXAsmPrinter.h

index 719567b99b3036c6f4986b6c0a9c244198fbba1c..80b1a4babdb34353f29d376474d6d02591a23b2d 100644 (file)
@@ -136,6 +136,7 @@ void PTXAsmPrinter::EmitStartOfAsmFile(Module &M)
 {
   const PTXSubtarget& ST = TM.getSubtarget<PTXSubtarget>();
 
+  // Emit the PTX .version and .target attributes
   OutStreamer.EmitRawText(Twine("\t.version " + ST.getPTXVersionString()));
   OutStreamer.EmitRawText(Twine("\t.target " + ST.getTargetString() +
                                 (ST.supportsDouble() ? ""
@@ -169,13 +170,6 @@ void PTXAsmPrinter::EmitStartOfAsmFile(Module &M)
     EmitVariableDeclaration(i);
 }
 
-bool PTXAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
-  SetupMachineFunction(MF);
-  EmitFunctionDeclaration();
-  EmitFunctionBody();
-  return false;
-}
-
 void PTXAsmPrinter::EmitFunctionBodyStart() {
   OutStreamer.EmitRawText(Twine("{"));
 
@@ -534,7 +528,7 @@ void PTXAsmPrinter::EmitVariableDeclaration(const GlobalVariable *gv) {
   OutStreamer.AddBlankLine();
 }
 
-void PTXAsmPrinter::EmitFunctionDeclaration() {
+void PTXAsmPrinter::EmitFunctionEntryLabel() {
   // The function label could have already been emitted if two symbols end up
   // conflicting due to asm renaming.  Detect this and emit an error.
   if (!CurrentFnSym->isUndefined()) {
index 85de57d90acedba2128c32abed993fbad0def2b4..e5b1187fad3532a4eb14564dff7e7388f795d303 100644 (file)
@@ -34,12 +34,9 @@ public:
   bool doFinalization(Module &M);
 
   virtual void EmitStartOfAsmFile(Module &M);
-
-  virtual bool runOnMachineFunction(MachineFunction &MF);
-
   virtual void EmitFunctionBodyStart();
   virtual void EmitFunctionBodyEnd();
-
+  virtual void EmitFunctionEntryLabel();
   virtual void EmitInstruction(const MachineInstr *MI);
 
   void printOperand(const MachineInstr *MI, int opNum, raw_ostream &OS);