diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2011-12-03 23:49:37 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2011-12-03 23:49:37 +0000 |
commit | 0cb2a45cceaefb48ec7efb902c453aaae4e24cb2 (patch) | |
tree | 194dc5e379c84d0f1a061c47fb0dfa186dbb05b4 /include/llvm | |
parent | 80b1ae92922202c197078038c4229045cb1e295f (diff) |
Emit the ctors in the proper order on ARM/EABI.
Maybe some targets should use this as well.
Patch by Evgeniy Stepanov!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145781 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/MC/MCAsmInfo.h | 12 | ||||
-rw-r--r-- | include/llvm/MC/MCObjectFileInfo.h | 19 |
2 files changed, 16 insertions, 15 deletions
diff --git a/include/llvm/MC/MCAsmInfo.h b/include/llvm/MC/MCAsmInfo.h index d7402b3397..5accabcd9f 100644 --- a/include/llvm/MC/MCAsmInfo.h +++ b/include/llvm/MC/MCAsmInfo.h @@ -36,10 +36,6 @@ namespace llvm { enum LCOMMType { None, NoAlignment, ByteAlignment }; } - namespace Structors { - enum OutputOrder { None, PriorityOrder, ReversePriorityOrder }; - } - /// MCAsmInfo - This class is intended to be used as a base class for asm /// properties and features specific to the target. class MCAsmInfo { @@ -72,11 +68,6 @@ namespace llvm { /// the macho-specific .tbss directive for emitting thread local BSS Symbols bool HasMachoTBSSDirective; // Default is false. - /// StructorOutputOrder - Whether the static ctor/dtor list should be output - /// in no particular order, in order of increasing priority or the reverse: - /// in order of decreasing priority (the default). - Structors::OutputOrder StructorOutputOrder; // Default is reverse order. - /// HasStaticCtorDtorReferenceInStaticMode - True if the compiler should /// emit a ".reference .constructors_used" or ".reference .destructors_used" /// directive after the a static ctor/dtor list. This directive is only @@ -428,9 +419,6 @@ namespace llvm { // bool hasMachoZeroFillDirective() const { return HasMachoZeroFillDirective; } bool hasMachoTBSSDirective() const { return HasMachoTBSSDirective; } - Structors::OutputOrder getStructorOutputOrder() const { - return StructorOutputOrder; - } bool hasStaticCtorDtorReferenceInStaticMode() const { return HasStaticCtorDtorReferenceInStaticMode; } diff --git a/include/llvm/MC/MCObjectFileInfo.h b/include/llvm/MC/MCObjectFileInfo.h index 2c5a0a15c3..d91b11b1f7 100644 --- a/include/llvm/MC/MCObjectFileInfo.h +++ b/include/llvm/MC/MCObjectFileInfo.h @@ -19,10 +19,14 @@ #include "llvm/MC/SectionKind.h" namespace llvm { -class MCContext; -class MCSection; -class Triple; + class MCContext; + class MCSection; + class Triple; + namespace Structors { + enum OutputOrder { None, PriorityOrder, ReversePriorityOrder }; + } + class MCObjectFileInfo { protected: /// CommDirectiveSupportsAlignment - True if .comm supports alignment. This @@ -164,6 +168,11 @@ protected: const MCSection *PDataSection; const MCSection *XDataSection; + /// StructorOutputOrder - Whether the static ctor/dtor list should be output + /// in no particular order, in order of increasing priority or the reverse: + /// in order of decreasing priority (the default). + Structors::OutputOrder StructorOutputOrder; // Default is reverse order. + public: void InitMCObjectFileInfo(StringRef TT, Reloc::Model RM, CodeModel::Model CM, MCContext &ctx); @@ -291,6 +300,10 @@ public: return EHFrameSection; } + Structors::OutputOrder getStructorOutputOrder() const { + return StructorOutputOrder; + } + private: enum Environment { IsMachO, IsELF, IsCOFF }; Environment Env; |