make AsmPrinter::doFinalization iterate over the global variables
and call PrintGlobalVariable, allowing elimination and simplification
of various targets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76604 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/PIC16/PIC16AsmPrinter.cpp b/lib/Target/PIC16/PIC16AsmPrinter.cpp
index b61f774..8204e223 100644
--- a/lib/Target/PIC16/PIC16AsmPrinter.cpp
+++ b/lib/Target/PIC16/PIC16AsmPrinter.cpp
@@ -291,8 +291,7 @@
   EmitRemainingAutos();
   DbgInfo.EndModule(M);
   O << "\n\t" << "END\n";
-  bool Result = AsmPrinter::doFinalization(M);
-  return Result;
+  return AsmPrinter::doFinalization(M);
 }
 
 void PIC16AsmPrinter::EmitFunctionFrame(MachineFunction &MF) {
diff --git a/lib/Target/PIC16/PIC16AsmPrinter.h b/lib/Target/PIC16/PIC16AsmPrinter.h
index 2c8ce12..0e05940 100644
--- a/lib/Target/PIC16/PIC16AsmPrinter.h
+++ b/lib/Target/PIC16/PIC16AsmPrinter.h
@@ -1,4 +1,4 @@
-//===-- PIC16AsmPrinter.h - PIC16 LLVM assembly writer ------------------===//
+//===-- PIC16AsmPrinter.h - PIC16 LLVM assembly writer ----------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -35,7 +35,7 @@
       PTLI = static_cast<const PIC16TargetLowering *> (TM.getTargetLowering());
       PTAI = static_cast<const PIC16TargetAsmInfo *> (T);
     }
-    private :
+  private:
     virtual const char *getPassName() const {
       return "PIC16 Assembly Printer";
     }
@@ -55,11 +55,17 @@
     void EmitRomData (Module &M);
     void EmitFunctionFrame(MachineFunction &MF);
     void printLibcallDecls(void);
-    protected:
+  protected:
     bool doInitialization(Module &M);
     bool doFinalization(Module &M);
 
-    private:
+    /// PrintGlobalVariable - Emit the specified global variable and its
+    /// initializer to the output stream.
+    virtual void PrintGlobalVariable(const GlobalVariable *GV) {
+      // PIC16 doesn't use normal hooks for this.
+    }
+    
+  private:
     PIC16TargetLowering *PTLI;
     PIC16DbgInfo DbgInfo;
     const PIC16TargetAsmInfo *PTAI;