summaryrefslogtreecommitdiff
path: root/lib/Target/Mips/MipsAsmPrinter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/Mips/MipsAsmPrinter.cpp')
-rw-r--r--lib/Target/Mips/MipsAsmPrinter.cpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/lib/Target/Mips/MipsAsmPrinter.cpp b/lib/Target/Mips/MipsAsmPrinter.cpp
index 24c3b61b01..2f49e74ab8 100644
--- a/lib/Target/Mips/MipsAsmPrinter.cpp
+++ b/lib/Target/Mips/MipsAsmPrinter.cpp
@@ -108,6 +108,7 @@ void MipsAsmPrinter::EmitInstruction(const MachineInstr *MI) {
return;
}
+
MachineBasicBlock::const_instr_iterator I = MI;
MachineBasicBlock::const_instr_iterator E = MI->getParent()->instr_end();
@@ -633,12 +634,8 @@ void MipsAsmPrinter::EmitStartOfAsmFile(Module &M) {
}
-void MipsAsmPrinter::processInitialEFlags() {
- // Not having this check would work too, but would have us chew through
- // code that it doesn't use for RawText.
- if (OutStreamer.hasRawTextSupport())
- return;
-
+static void emitELFHeaderFlagsCG(MipsTargetStreamer &TargetStreamer,
+ const MipsSubtarget &Subtarget) {
// Update e_header flags
unsigned EFlags = 0;
@@ -646,30 +643,30 @@ void MipsAsmPrinter::processInitialEFlags() {
// Currently we assume that -mabicalls is the default.
EFlags |= ELF::EF_MIPS_CPIC;
- if (Subtarget->inMips16Mode())
+ if (Subtarget.inMips16Mode())
EFlags |= ELF::EF_MIPS_ARCH_ASE_M16;
else
EFlags |= ELF::EF_MIPS_NOREORDER;
// Architecture
- if (Subtarget->hasMips64r2())
+ if (Subtarget.hasMips64r2())
EFlags |= ELF::EF_MIPS_ARCH_64R2;
- else if (Subtarget->hasMips64())
+ else if (Subtarget.hasMips64())
EFlags |= ELF::EF_MIPS_ARCH_64;
- else if (Subtarget->hasMips32r2())
+ else if (Subtarget.hasMips32r2())
EFlags |= ELF::EF_MIPS_ARCH_32R2;
else
EFlags |= ELF::EF_MIPS_ARCH_32;
- if (Subtarget->inMicroMipsMode())
+ if (Subtarget.inMicroMipsMode())
EFlags |= ELF::EF_MIPS_MICROMIPS;
// ABI
- if (Subtarget->isABI_O32())
+ if (Subtarget.isABI_O32())
EFlags |= ELF::EF_MIPS_ABI_O32;
// Relocation Model
- Reloc::Model RM = Subtarget->getRelocationModel();
+ Reloc::Model RM = Subtarget.getRelocationModel();
if (RM == Reloc::PIC_ || RM == Reloc::Default)
EFlags |= ELF::EF_MIPS_PIC;
else if (RM == Reloc::Static)
@@ -677,13 +674,14 @@ void MipsAsmPrinter::processInitialEFlags() {
else
llvm_unreachable("Unsupported relocation model for e_flags");
- getTargetStreamer().emitMipsELFFlags(EFlags);
+ TargetStreamer.emitMipsHackELFFlags(EFlags);
}
void MipsAsmPrinter::EmitEndOfAsmFile(Module &M) {
// Emit Mips ELF register info
Subtarget->getMReginfo().emitMipsReginfoSectionCG(
OutStreamer, getObjFileLowering(), *Subtarget);
+ emitELFHeaderFlagsCG(getTargetStreamer(), *Subtarget);
}
void MipsAsmPrinter::PrintDebugValueComment(const MachineInstr *MI,