summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-23 07:21:06 +0000
committerChris Lattner <sabre@nondot.org>2010-01-23 07:21:06 +0000
commitf9f93e4388962b678fd59b7af5212d4cc0d38be2 (patch)
tree7533118fbe3bf30c1f6291cf882a8936a59e78f3 /include
parent74670b26fc62dce36a9d1d78caa1d481cec5b2eb (diff)
resolve a fixme: the "nonexecutable stack directive" is actually
a .section. Switch to it with SwitchSection. However, I think that this directive should be safe on any ELF target. If so, we should hoist it up out of the X86 and SystemZ targets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94298 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/MC/MCAsmInfo.h29
-rw-r--r--include/llvm/MC/MCSectionELF.h2
2 files changed, 17 insertions, 14 deletions
diff --git a/include/llvm/MC/MCAsmInfo.h b/include/llvm/MC/MCAsmInfo.h
index 1a93d75201b..22939b52cf4 100644
--- a/include/llvm/MC/MCAsmInfo.h
+++ b/include/llvm/MC/MCAsmInfo.h
@@ -20,6 +20,9 @@
#include <cassert>
namespace llvm {
+ class MCSection;
+ class MCContext;
+
/// MCAsmInfo - This class is intended to be used as a base class for asm
/// properties and features specific to the target.
namespace ExceptionHandling { enum ExceptionsType { None, Dwarf, SjLj }; }
@@ -30,11 +33,10 @@ namespace llvm {
// Properties to be set by the target writer, used to configure asm printer.
//
- /// NonexecutableStackDirective - Directive for declaring to the
- /// linker and beyond that the emitted code does not require stack
- /// memory to be executable.
- const char *NonexecutableStackDirective; // Default is null.
-
+ /// HasSubsectionsViaSymbols - True if this target has the MachO
+ /// .subsections_via_symbols directive.
+ bool HasSubsectionsViaSymbols; // Default is false.
+
/// HasMachoZeroFillDirective - True if this is a MachO target that supports
/// the macho-specific .zerofill directive for emitting BSS Symbols.
bool HasMachoZeroFillDirective; // Default is false.
@@ -288,14 +290,12 @@ namespace llvm {
explicit MCAsmInfo();
virtual ~MCAsmInfo();
- /// getSLEB128Size - Compute the number of bytes required for a signed
- /// leb128 value.
+ // FIXME: move these methods to DwarfPrinter when the JIT stops using them.
static unsigned getSLEB128Size(int Value);
-
- /// getULEB128Size - Compute the number of bytes required for an unsigned
- /// leb128 value.
static unsigned getULEB128Size(unsigned Value);
+ bool hasSubsectionsViaSymbols() const { return HasSubsectionsViaSymbols; }
+
// Data directive accessors.
//
const char *getData8bitsDirective(unsigned AS = 0) const {
@@ -311,6 +311,12 @@ namespace llvm {
return AS == 0 ? Data64bitsDirective : getDataASDirective(64, AS);
}
+ /// getNonexecutableStackSection - Targets can implement this method to
+ /// specify a section to switch to if the translation unit doesn't have any
+ /// trampolines that require an executable stack.
+ virtual MCSection *getNonexecutableStackSection(MCContext &Ctx) const {
+ return 0;
+ }
bool usesSunStyleELFSectionSwitchSyntax() const {
return SunStyleELFSectionSwitchSyntax;
@@ -326,9 +332,6 @@ namespace llvm {
bool hasStaticCtorDtorReferenceInStaticMode() const {
return HasStaticCtorDtorReferenceInStaticMode;
}
- const char *getNonexecutableStackDirective() const {
- return NonexecutableStackDirective;
- }
bool needsSet() const {
return NeedsSet;
}
diff --git a/include/llvm/MC/MCSectionELF.h b/include/llvm/MC/MCSectionELF.h
index c48ff03e6d7..2dccf5c5728 100644
--- a/include/llvm/MC/MCSectionELF.h
+++ b/include/llvm/MC/MCSectionELF.h
@@ -31,7 +31,7 @@ class MCSectionELF : public MCSection {
unsigned Flags;
/// IsExplicit - Indicates that this section comes from globals with an
- /// explicit section specfied.
+ /// explicit section specified.
bool IsExplicit;
protected: