summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-05-27 13:37:28 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-05-27 13:37:28 +0000
commit8c05c6e28bfb05da8971e203233ae993364d6bfb (patch)
tree42c1263099ad8d4b4972e2f475279eb3e9b15b12 /llvm/lib/MC
parent9c9ecce0770b3cc9f2237a28a7080553ec61bcb1 (diff)
downloadbcm5719-llvm-8c05c6e28bfb05da8971e203233ae993364d6bfb.tar.gz
bcm5719-llvm-8c05c6e28bfb05da8971e203233ae993364d6bfb.zip
Move getSubsectionInsertionPoint to MCSection.
llvm-svn: 238320
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r--llvm/lib/MC/MCAssembler.cpp31
-rw-r--r--llvm/lib/MC/MCObjectStreamer.cpp3
-rw-r--r--llvm/lib/MC/MCSection.cpp32
3 files changed, 33 insertions, 33 deletions
diff --git a/llvm/lib/MC/MCAssembler.cpp b/llvm/lib/MC/MCAssembler.cpp
index 187fd1fd547..ec2518c77dd 100644
--- a/llvm/lib/MC/MCAssembler.cpp
+++ b/llvm/lib/MC/MCAssembler.cpp
@@ -290,37 +290,6 @@ MCEncodedFragmentWithFixups::~MCEncodedFragmentWithFixups() {
MCSectionData::MCSectionData(MCSection &Section) : Section(&Section) {}
-MCSectionData::iterator
-MCSectionData::getSubsectionInsertionPoint(unsigned Subsection) {
- if (Subsection == 0 && SubsectionFragmentMap.empty())
- return end();
-
- SmallVectorImpl<std::pair<unsigned, MCFragment *> >::iterator MI =
- std::lower_bound(SubsectionFragmentMap.begin(), SubsectionFragmentMap.end(),
- std::make_pair(Subsection, (MCFragment *)nullptr));
- bool ExactMatch = false;
- if (MI != SubsectionFragmentMap.end()) {
- ExactMatch = MI->first == Subsection;
- if (ExactMatch)
- ++MI;
- }
- iterator IP;
- if (MI == SubsectionFragmentMap.end())
- IP = end();
- else
- IP = MI->second;
- if (!ExactMatch && Subsection != 0) {
- // The GNU as documentation claims that subsections have an alignment of 4,
- // although this appears not to be the case.
- MCFragment *F = new MCDataFragment();
- SubsectionFragmentMap.insert(MI, std::make_pair(Subsection, F));
- getFragmentList().insert(IP, F);
- F->setParent(&getSection());
- }
-
- return IP;
-}
-
/* *** */
MCAssembler::MCAssembler(MCContext &Context_, MCAsmBackend &Backend_,
diff --git a/llvm/lib/MC/MCObjectStreamer.cpp b/llvm/lib/MC/MCObjectStreamer.cpp
index c1b20717db3..18d2b66b2ae 100644
--- a/llvm/lib/MC/MCObjectStreamer.cpp
+++ b/llvm/lib/MC/MCObjectStreamer.cpp
@@ -221,8 +221,7 @@ bool MCObjectStreamer::changeSectionImpl(MCSection *Section,
if (IntSubsection < 0 || IntSubsection > 8192)
report_fatal_error("Subsection number out of range");
CurInsertionPoint =
- CurSectionData->getSectionData().getSubsectionInsertionPoint(
- unsigned(IntSubsection));
+ CurSectionData->getSubsectionInsertionPoint(unsigned(IntSubsection));
return Created;
}
diff --git a/llvm/lib/MC/MCSection.cpp b/llvm/lib/MC/MCSection.cpp
index fca74748641..91df312689c 100644
--- a/llvm/lib/MC/MCSection.cpp
+++ b/llvm/lib/MC/MCSection.cpp
@@ -52,6 +52,38 @@ void MCSection::setBundleLockState(BundleLockStateType NewState) {
++BundleLockNestingDepth;
}
+MCSectionData::iterator
+MCSection::getSubsectionInsertionPoint(unsigned Subsection) {
+ if (Subsection == 0 && Data.SubsectionFragmentMap.empty())
+ return end();
+
+ SmallVectorImpl<std::pair<unsigned, MCFragment *>>::iterator MI =
+ std::lower_bound(Data.SubsectionFragmentMap.begin(),
+ Data.SubsectionFragmentMap.end(),
+ std::make_pair(Subsection, (MCFragment *)nullptr));
+ bool ExactMatch = false;
+ if (MI != Data.SubsectionFragmentMap.end()) {
+ ExactMatch = MI->first == Subsection;
+ if (ExactMatch)
+ ++MI;
+ }
+ MCSectionData::iterator IP;
+ if (MI == Data.SubsectionFragmentMap.end())
+ IP = end();
+ else
+ IP = MI->second;
+ if (!ExactMatch && Subsection != 0) {
+ // The GNU as documentation claims that subsections have an alignment of 4,
+ // although this appears not to be the case.
+ MCFragment *F = new MCDataFragment();
+ Data.SubsectionFragmentMap.insert(MI, std::make_pair(Subsection, F));
+ getFragmentList().insert(IP, F);
+ F->setParent(this);
+ }
+
+ return IP;
+}
+
MCSectionData::iterator MCSection::begin() { return Data.begin(); }
MCSectionData::iterator MCSection::end() { return Data.end(); }
OpenPOWER on IntegriCloud