X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FMC%2FMCSection.cpp;h=dbd544a44ce32afd56ae34891ecd5f975c65e1b4;hb=edc7ba5cabb73ad0375a10e60b187b6cd41ccf31;hp=adfc6b35abb2ff5157143e77c8c1ca16b68c6af9;hpb=b16799681930016c6df3adc26c667ad55975f959;p=oota-llvm.git diff --git a/lib/MC/MCSection.cpp b/lib/MC/MCSection.cpp index adfc6b35abb..dbd544a44ce 100644 --- a/lib/MC/MCSection.cpp +++ b/lib/MC/MCSection.cpp @@ -20,7 +20,8 @@ using namespace llvm; //===----------------------------------------------------------------------===// MCSection::MCSection(SectionVariant V, SectionKind K, MCSymbol *Begin) - : Begin(Begin), HasInstructions(false), Data(*this), Variant(V), Kind(K) {} + : Begin(Begin), BundleGroupBeforeFirstInst(false), HasInstructions(false), + IsRegistered(false), DummyFragment(this), Variant(V), Kind(K) {} MCSymbol *MCSection::getEndSymbol(MCContext &Ctx) { if (!End) @@ -52,31 +53,31 @@ void MCSection::setBundleLockState(BundleLockStateType NewState) { ++BundleLockNestingDepth; } -MCSectionData::iterator +MCSection::iterator MCSection::getSubsectionInsertionPoint(unsigned Subsection) { - if (Subsection == 0 && Data.SubsectionFragmentMap.empty()) + if (Subsection == 0 && SubsectionFragmentMap.empty()) return end(); SmallVectorImpl>::iterator MI = - std::lower_bound(Data.SubsectionFragmentMap.begin(), - Data.SubsectionFragmentMap.end(), + std::lower_bound(SubsectionFragmentMap.begin(), + SubsectionFragmentMap.end(), std::make_pair(Subsection, (MCFragment *)nullptr)); bool ExactMatch = false; - if (MI != Data.SubsectionFragmentMap.end()) { + if (MI != SubsectionFragmentMap.end()) { ExactMatch = MI->first == Subsection; if (ExactMatch) ++MI; } - MCSectionData::iterator IP; - if (MI == Data.SubsectionFragmentMap.end()) + iterator IP; + if (MI == SubsectionFragmentMap.end()) IP = end(); else - IP = MI->second; + IP = MI->second->getIterator(); 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)); + SubsectionFragmentMap.insert(MI, std::make_pair(Subsection, F)); getFragmentList().insert(IP, F); F->setParent(this); } @@ -84,24 +85,25 @@ MCSection::getSubsectionInsertionPoint(unsigned Subsection) { return IP; } -MCSectionData::iterator MCSection::begin() { return Data.begin(); } +#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) +void MCSection::dump() { + raw_ostream &OS = llvm::errs(); -MCSectionData::iterator MCSection::end() { return Data.end(); } - -MCSectionData::reverse_iterator MCSection::rbegin() { return Data.rbegin(); } - -MCSectionData::FragmentListType &MCSection::getFragmentList() { - return Data.getFragmentList(); + OS << "dump(); + } + OS << "]>"; } +#endif -MCSectionData::iterator MCSectionData::begin() { return Fragments.begin(); } +MCSection::iterator MCSection::begin() { return Fragments.begin(); } -MCSectionData::iterator MCSectionData::end() { return Fragments.end(); } +MCSection::iterator MCSection::end() { return Fragments.end(); } -MCSectionData::reverse_iterator MCSectionData::rbegin() { - return Fragments.rbegin(); -} +MCSection::reverse_iterator MCSection::rbegin() { return Fragments.rbegin(); } -MCSectionData::reverse_iterator MCSectionData::rend() { - return Fragments.rend(); -} +MCSection::reverse_iterator MCSection::rend() { return Fragments.rend(); }