summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCObjectStreamer.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2016-10-14 05:47:37 +0000
committerEric Christopher <echristo@gmail.com>2016-10-14 05:47:37 +0000
commit445c952bd0a3b35244476ba7ef9ff44b5483dfea (patch)
tree0fe105aeff7cb9bd6434e8ed59147df7183cadc3 /llvm/lib/MC/MCObjectStreamer.cpp
parentb2437da9688c2aa30f6a0a6c13d08b4245d5fce7 (diff)
downloadbcm5719-llvm-445c952bd0a3b35244476ba7ef9ff44b5483dfea.tar.gz
bcm5719-llvm-445c952bd0a3b35244476ba7ef9ff44b5483dfea.zip
Tidy the calls to getCurrentSection().first -> getCurrentSectionOnly to help
readability a bit. llvm-svn: 284202
Diffstat (limited to 'llvm/lib/MC/MCObjectStreamer.cpp')
-rw-r--r--llvm/lib/MC/MCObjectStreamer.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/MC/MCObjectStreamer.cpp b/llvm/lib/MC/MCObjectStreamer.cpp
index f4cb09494d0..123295da15a 100644
--- a/llvm/lib/MC/MCObjectStreamer.cpp
+++ b/llvm/lib/MC/MCObjectStreamer.cpp
@@ -128,7 +128,7 @@ void MCObjectStreamer::EmitValueImpl(const MCExpr *Value, unsigned Size,
flushPendingLabels(DF, DF->getContents().size());
MCCVLineEntry::Make(this);
- MCDwarfLineEntry::Make(this, getCurrentSection().first);
+ MCDwarfLineEntry::Make(this, getCurrentSectionOnly());
// Avoid fixups when possible.
int64_t AbsValue;
@@ -236,7 +236,7 @@ void MCObjectStreamer::EmitInstruction(const MCInst &Inst,
// Now that a machine instruction has been assembled into this section, make
// a line entry for any .loc directive that has been seen.
MCCVLineEntry::Make(this);
- MCDwarfLineEntry::Make(this, getCurrentSection().first);
+ MCDwarfLineEntry::Make(this, getCurrentSectionOnly());
// If this instruction doesn't need relaxation, just emit it as data.
MCAssembler &Assembler = getAssembler();
@@ -305,7 +305,7 @@ void MCObjectStreamer::EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
StringRef FileName) {
// In case we see two .loc directives in a row, make sure the
// first one gets a line entry.
- MCDwarfLineEntry::Make(this, getCurrentSection().first);
+ MCDwarfLineEntry::Make(this, getCurrentSectionOnly());
this->MCStreamer::EmitDwarfLocDirective(FileNo, Line, Column, Flags,
Isa, Discriminator, FileName);
@@ -413,7 +413,7 @@ void MCObjectStreamer::EmitCVFileChecksumsDirective() {
void MCObjectStreamer::EmitBytes(StringRef Data) {
MCCVLineEntry::Make(this);
- MCDwarfLineEntry::Make(this, getCurrentSection().first);
+ MCDwarfLineEntry::Make(this, getCurrentSectionOnly());
MCDataFragment *DF = getOrCreateDataFragment();
flushPendingLabels(DF, DF->getContents().size());
DF->getContents().append(Data.begin(), Data.end());
@@ -428,7 +428,7 @@ void MCObjectStreamer::EmitValueToAlignment(unsigned ByteAlignment,
insert(new MCAlignFragment(ByteAlignment, Value, ValueSize, MaxBytesToEmit));
// Update the maximum alignment on the current section if necessary.
- MCSection *CurSec = getCurrentSection().first;
+ MCSection *CurSec = getCurrentSectionOnly();
if (ByteAlignment > CurSec->getAlignment())
CurSec->setAlignment(ByteAlignment);
}
@@ -530,9 +530,7 @@ bool MCObjectStreamer::EmitRelocDirective(const MCExpr &Offset, StringRef Name,
}
void MCObjectStreamer::emitFill(uint64_t NumBytes, uint8_t FillValue) {
- const MCSection *Sec = getCurrentSection().first;
- (void)Sec;
- assert(Sec && "need a section");
+ assert(getCurrentSectionOnly() && "need a section");
insert(new MCFillFragment(FillValue, NumBytes));
}
OpenPOWER on IntegriCloud