From: Chris Lattner Date: Mon, 21 Nov 2005 08:24:11 +0000 (+0000) Subject: add two more config directives, add method for printing constant pool X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=97e32e3239c0f065698f8c004b2b3009162f5ed6;p=oota-llvm.git add two more config directives, add method for printing constant pool git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24463 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/CodeGen/AsmPrinter.h b/include/llvm/CodeGen/AsmPrinter.h index 6a8333857cd..b6ed3a5254c 100644 --- a/include/llvm/CodeGen/AsmPrinter.h +++ b/include/llvm/CodeGen/AsmPrinter.h @@ -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