diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-01-25 15:06:56 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-01-25 15:06:56 +0000 |
commit | 14d02fe5c8640f1576c7a7b313294cd3fc51b04d (patch) | |
tree | 53904cd2c2ca7175bcef245f35e064946eea51a6 /llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp | |
parent | 48047f5d75b02ef14c48fa2d6ed63faf5c299f74 (diff) | |
download | bcm5719-llvm-14d02fe5c8640f1576c7a7b313294cd3fc51b04d.tar.gz bcm5719-llvm-14d02fe5c8640f1576c7a7b313294cd3fc51b04d.zip |
This reverts commit r200064 and r200051.
r200064 depends on r200051.
r200051 is broken: I tries to replace .mips_hack_elf_flags, which is a good
thing, but what it replaces it with is even worse.
The new emitMipsELFFlags it adds corresponds to no assembly directive, is not
marked as a hack and is not even printed to the .s file.
The patch also introduces more uses of hasRawTextSupport.
The correct way to remove .mips_hack_elf_flags is to have the mips target
streamer handle the default flags (and command line options). That way the
same code path is used for asm and obj. The streamer interface should *really*
correspond to what is printed in the .s file.
llvm-svn: 200078
Diffstat (limited to 'llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp')
-rw-r--r-- | llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp b/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp index d026471d0fd..6b57dff2c83 100644 --- a/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp +++ b/llvm/lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp @@ -21,13 +21,23 @@ using namespace llvm; +static cl::opt<bool> PrintHackDirectives("print-hack-directives", + cl::init(false), cl::Hidden); + // Pin vtable to this file. void MipsTargetStreamer::anchor() {} MipsTargetAsmStreamer::MipsTargetAsmStreamer(formatted_raw_ostream &OS) : OS(OS) {} -void MipsTargetAsmStreamer::emitMipsELFFlags(unsigned Flags) { return; } +void MipsTargetAsmStreamer::emitMipsHackELFFlags(unsigned Flags) { + if (!PrintHackDirectives) + return; + + OS << "\t.mips_hack_elf_flags 0x"; + OS.write_hex(Flags); + OS << '\n'; +} void MipsTargetAsmStreamer::emitDirectiveSetMicroMips() { OS << "\t.set\tmicromips\n"; @@ -75,7 +85,7 @@ MCELFStreamer &MipsTargetELFStreamer::getStreamer() { return static_cast<MCELFStreamer &>(*Streamer); } -void MipsTargetELFStreamer::emitMipsELFFlags(unsigned Flags) { +void MipsTargetELFStreamer::emitMipsHackELFFlags(unsigned Flags) { MCAssembler &MCA = getStreamer().getAssembler(); MCA.setELFHeaderEFlags(Flags); } |