[llvm-commits] CVS: llvm/include/llvm/CodeGen/AsmPrinter.h

Chris Lattner lattner at cs.uiuc.edu
Sun Nov 20 23:05:54 PST 2005



Changes in directory llvm/include/llvm/CodeGen:

AsmPrinter.h updated: 1.16 -> 1.17
---
Log message:

Add section switching to to common AsmPrinter code.


---
Diffs of the changes:  (+13 -0)

 AsmPrinter.h |   13 +++++++++++++
 1 files changed, 13 insertions(+)


Index: llvm/include/llvm/CodeGen/AsmPrinter.h
diff -u llvm/include/llvm/CodeGen/AsmPrinter.h:1.16 llvm/include/llvm/CodeGen/AsmPrinter.h:1.17
--- llvm/include/llvm/CodeGen/AsmPrinter.h:1.16	Mon Nov 21 00:41:08 2005
+++ llvm/include/llvm/CodeGen/AsmPrinter.h	Mon Nov 21 01:05:42 2005
@@ -24,6 +24,9 @@
   class Mangler;
 
   class AsmPrinter : public MachineFunctionPass {
+    /// CurrentSection - The current section we are emitting to.  This is
+    /// controlled and used by the SwitchSection method.
+    std::string CurrentSection;
   protected:
     /// Output stream on which we're printing assembly code.
     ///
@@ -128,6 +131,16 @@
         AlignmentIsInBytes(true) {
     }
 
+    /// SwitchSection - Switch to the specified section of the executable if we
+    /// are not already in it!  If GV is non-null and if the global has an
+    /// explicitly requested section, we switch to the section indicated for the
+    /// global instead of NewSection.
+    ///
+    /// If the new section is an empty string, this method forgets what the
+    /// current section is, but does not emit a .section directive.
+    ///
+    void SwitchSection(const char *NewSection, const GlobalValue *GV);
+      
     /// doInitialization - Set up the AsmPrinter when we are working on a new
     /// module.  If your pass overrides this, it must make sure to explicitly
     /// call this implementation.






More information about the llvm-commits mailing list