aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-11-21 07:05:42 +0000
committerChris Lattner <sabre@nondot.org>2005-11-21 07:05:42 +0000
commite2b1f1188fd8c28977b5cf2a6842fc7bbb008713 (patch)
tree3555db0428af54053a6adc23d474507b69c8cca0 /include
parent62cbf2aab9fd5366281871974ef580fd072309cc (diff)
downloadexternal_llvm-e2b1f1188fd8c28977b5cf2a6842fc7bbb008713.zip
external_llvm-e2b1f1188fd8c28977b5cf2a6842fc7bbb008713.tar.gz
external_llvm-e2b1f1188fd8c28977b5cf2a6842fc7bbb008713.tar.bz2
Add section switching to to common AsmPrinter code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24444 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/AsmPrinter.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/AsmPrinter.h b/include/llvm/CodeGen/AsmPrinter.h
index ce5cf49..2704efc 100644
--- a/include/llvm/CodeGen/AsmPrinter.h
+++ b/include/llvm/CodeGen/AsmPrinter.h
@@ -24,6 +24,9 @@ namespace llvm {
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 @@ namespace llvm {
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.