add two more config directives, add method for printing constant pool
authorChris Lattner <sabre@nondot.org>
Mon, 21 Nov 2005 08:24:11 +0000 (08:24 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 21 Nov 2005 08:24:11 +0000 (08:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24463 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/AsmPrinter.h

index 6a8333857cd71c145d3643f960160b1cb748f7db..b6ed3a5254c6e19fe5ababfe818c3909469a56ab 100644 (file)
@@ -85,6 +85,8 @@ namespace llvm {
     const char *FunctionAddrPrefix;       // Defaults to ""
     const char *FunctionAddrSuffix;       // Defaults to ""
 
+    //===--- Data Emission Directives -------------------------------------===//
+
     /// ZeroDirective - this should be set to the directive used to get some
     /// number of zero bytes emitted to the current section.  Common cases are
     /// "\t.zero\t" and "\t.space\t".  If this is set to null, the
@@ -108,6 +110,8 @@ namespace llvm {
     const char *Data32bitsDirective;  // Defaults to "\t.long\t"
     const char *Data64bitsDirective;  // Defaults to "\t.quad\t"
 
+    //===--- Alignment Information ----------------------------------------===//
+
     /// AlignDirective - The directive used to emit round up to an alignment
     /// boundary.
     ///
@@ -118,6 +122,17 @@ namespace llvm {
     /// Otherwise, it emits ".align log2(N)", e.g. 3 to align to an 8 byte
     /// boundary.
     bool AlignmentIsInBytes;          // Defaults to true
+    
+    //===--- Section Switching Directives ---------------------------------===//
+    
+    /// SwitchToSectionDirective - This is the directive used when we want to
+    /// emit a global to an arbitrary section.  The section name is emited after
+    /// this.
+    const char *SwitchToSectionDirective;  // Defaults to "\t.section\t"
+    
+    /// ConstantPoolSection - This is the section that we SwitchToSection right
+    /// before emitting the constant pool for a function.
+    const char *ConstantPoolSection;     // Defaults to "\t.section .rodata\n"
 
     AsmPrinter(std::ostream &o, TargetMachine &tm)
       : FunctionNumber(0), O(o), TM(tm),
@@ -136,7 +151,9 @@ namespace llvm {
         Data32bitsDirective("\t.long\t"),
         Data64bitsDirective("\t.quad\t"),
         AlignDirective("\t.align\t"),
-        AlignmentIsInBytes(true) {
+        AlignmentIsInBytes(true),
+        SwitchToSectionDirective("\t.section\t"),
+        ConstantPoolSection("\t.section .rodata\n") {
     }
 
     /// SwitchSection - Switch to the specified section of the executable if we
@@ -170,6 +187,8 @@ namespace llvm {
     /// SetupMachineFunction - This should be called when a new MachineFunction
     /// is being processed from runOnMachineFunction.
     void SetupMachineFunction(MachineFunction &MF);
+    
+    void EmitConstantPool(MachineConstantPool *MCP);
 
     /// EmitAlignment - Emit an alignment directive to the specified power of
     /// two boundary.  For example, if you pass in 3 here, you will get an 8