summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCELFStreamer.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-05-26 14:48:11 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-05-26 14:48:11 +0000
commit3d2aeb2e20c1906ac8b607290828917322a14394 (patch)
tree56070685720848ae748891ad7d0ba8a7c2eb1b07 /llvm/lib/MC/MCELFStreamer.cpp
parente6e287df74fa39a2b32a8782fdd86a80350cfcaa (diff)
downloadbcm5719-llvm-3d2aeb2e20c1906ac8b607290828917322a14394.tar.gz
bcm5719-llvm-3d2aeb2e20c1906ac8b607290828917322a14394.zip
Have getCurrentSectionData return a MCSection.
I will fix the name shortly. llvm-svn: 238204
Diffstat (limited to 'llvm/lib/MC/MCELFStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCELFStreamer.cpp21
1 files changed, 7 insertions, 14 deletions
diff --git a/llvm/lib/MC/MCELFStreamer.cpp b/llvm/lib/MC/MCELFStreamer.cpp
index 110dd3338bd..8854866bca7 100644
--- a/llvm/lib/MC/MCELFStreamer.cpp
+++ b/llvm/lib/MC/MCELFStreamer.cpp
@@ -39,7 +39,7 @@
using namespace llvm;
bool MCELFStreamer::isBundleLocked() const {
- return getCurrentSectionData()->getSection().isBundleLocked();
+ return getCurrentSectionData()->isBundleLocked();
}
MCELFStreamer::~MCELFStreamer() {
@@ -146,9 +146,7 @@ static void setSectionAlignmentForBundling(const MCAssembler &Assembler,
void MCELFStreamer::ChangeSection(MCSection *Section,
const MCExpr *Subsection) {
- MCSectionData *CurSectionData = getCurrentSectionData();
- MCSection *CurSection =
- CurSectionData ? &CurSectionData->getSection() : nullptr;
+ MCSection *CurSection = getCurrentSectionData();
if (CurSection && isBundleLocked())
report_fatal_error("Unterminated .bundle_lock when changing a section");
@@ -203,7 +201,7 @@ bool MCELFStreamer::EmitSymbolAttribute(MCSymbol *Symbol,
// important for matching the string table that 'as' generates.
IndirectSymbolData ISD;
ISD.Symbol = Symbol;
- ISD.Section = &getCurrentSectionData()->getSection();
+ ISD.Section = getCurrentSectionData();
getAssembler().getIndirectSymbols().push_back(ISD);
return true;
}
@@ -508,8 +506,7 @@ void MCELFStreamer::EmitInstToData(const MCInst &Inst,
MCDataFragment *DF;
if (Assembler.isBundlingEnabled()) {
- MCSectionData *SD = getCurrentSectionData();
- MCSection &Sec = SD->getSection();
+ MCSection &Sec = *getCurrentSectionData();
if (Assembler.getRelaxAll() && isBundleLocked())
// If the -mc-relax-all flag is used and we are bundle-locked, we re-use
// the current bundle group.
@@ -577,8 +574,7 @@ void MCELFStreamer::EmitBundleAlignMode(unsigned AlignPow2) {
}
void MCELFStreamer::EmitBundleLock(bool AlignToEnd) {
- MCSectionData *SD = getCurrentSectionData();
- MCSection &Sec = SD->getSection();
+ MCSection &Sec = *getCurrentSectionData();
// Sanity checks
//
@@ -599,8 +595,7 @@ void MCELFStreamer::EmitBundleLock(bool AlignToEnd) {
}
void MCELFStreamer::EmitBundleUnlock() {
- MCSectionData *SD = getCurrentSectionData();
- MCSection &Sec = SD->getSection();
+ MCSection &Sec = *getCurrentSectionData();
// Sanity checks
if (!getAssembler().isBundlingEnabled())
@@ -659,9 +654,7 @@ void MCELFStreamer::Flush() {
void MCELFStreamer::FinishImpl() {
// Ensure the last section gets aligned if necessary.
- MCSectionData *CurSectionData = getCurrentSectionData();
- MCSection *CurSection =
- CurSectionData ? &CurSectionData->getSection() : nullptr;
+ MCSection *CurSection = getCurrentSectionData();
setSectionAlignmentForBundling(getAssembler(), CurSection);
EmitFrames(nullptr);
OpenPOWER on IntegriCloud