diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-01-24 03:54:40 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-01-24 03:54:40 +0000 |
commit | a1f7c26cc8028c73842065e33f0acdee40cf868d (patch) | |
tree | e39b50ca509276861f81630b2a870f4ac6f964e5 /include | |
parent | b385559db946cf0838494409dc98183f3989f8a8 (diff) | |
download | llvm-a1f7c26cc8028c73842065e33f0acdee40cf868d.tar.gz llvm-a1f7c26cc8028c73842065e33f0acdee40cf868d.tar.bz2 llvm-a1f7c26cc8028c73842065e33f0acdee40cf868d.tar.xz |
Simplify the logic for deciding when to initialize the sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199971 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/MC/MCELFStreamer.h | 2 | ||||
-rw-r--r-- | include/llvm/MC/MCStreamer.h | 20 |
2 files changed, 6 insertions, 16 deletions
diff --git a/include/llvm/MC/MCELFStreamer.h b/include/llvm/MC/MCELFStreamer.h index c24119c330..7090022d69 100644 --- a/include/llvm/MC/MCELFStreamer.h +++ b/include/llvm/MC/MCELFStreamer.h @@ -45,7 +45,7 @@ public: /// @name MCStreamer Interface /// @{ - virtual void InitSections(); + virtual void InitSections(bool Force); virtual void ChangeSection(const MCSection *Section, const MCExpr *Subsection); virtual void EmitLabel(MCSymbol *Symbol); diff --git a/include/llvm/MC/MCStreamer.h b/include/llvm/MC/MCStreamer.h index 78491e85bc..1538a41149 100644 --- a/include/llvm/MC/MCStreamer.h +++ b/include/llvm/MC/MCStreamer.h @@ -157,8 +157,6 @@ class MCStreamer { /// values saved by PushSection. SmallVector<std::pair<MCSectionSubPair, MCSectionSubPair>, 4> SectionStack; - bool AutoInitSections; - protected: MCStreamer(MCContext &Ctx, MCTargetStreamer *TargetStreamer); @@ -330,19 +328,11 @@ public: SectionStack.back().first = MCSectionSubPair(Section, Subsection); } - /// Initialize the streamer. - void InitStreamer() { - if (AutoInitSections) - InitSections(); - } - - /// Tell this MCStreamer to call InitSections upon initialization. - void setAutoInitSections(bool AutoInitSections) { - this->AutoInitSections = AutoInitSections; - } - - /// InitSections - Create the default sections and set the initial one. - virtual void InitSections(); + /// Create the default sections and set the initial one. + /// + /// @param Force - If false, a text streamer implementation can be a nop. + /// Used by CodeGen to avoid starting every file with '.text'. + virtual void InitSections(bool Force = true); /// AssignSection - Sets the symbol's section. /// |