[llvm] r238102 - [AArch64] Clean up the ELF streamer a bit.
Benjamin Kramer
benny.kra at googlemail.com
Sat May 23 09:39:10 PDT 2015
Author: d0k
Date: Sat May 23 11:39:10 2015
New Revision: 238102
URL: http://llvm.org/viewvc/llvm-project?rev=238102&view=rev
Log:
[AArch64] Clean up the ELF streamer a bit.
Modified:
llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp
llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
llvm/trunk/test/MC/AArch64/inst-directive.s
llvm/trunk/test/MC/ARM/inst-directive-emit.s
Modified: llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp?rev=238102&r1=238101&r2=238102&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp Sat May 23 11:39:10 2015
@@ -60,7 +60,7 @@ AArch64TargetAsmStreamer::AArch64TargetA
: AArch64TargetStreamer(S), OS(OS) {}
void AArch64TargetAsmStreamer::emitInst(uint32_t Inst) {
- OS << "\t.inst\t0x" << utohexstr(Inst) << "\n";
+ OS << "\t.inst\t0x" << Twine::utohexstr(Inst) << "\n";
}
class AArch64TargetELFStreamer : public AArch64TargetStreamer {
@@ -95,8 +95,6 @@ public:
: MCELFStreamer(Context, TAB, OS, Emitter), MappingSymbolCounter(0),
LastEMS(EMS_None) {}
- ~AArch64ELFStreamer() override {}
-
void ChangeSection(MCSection *Section, const MCExpr *Subsection) override {
// We have to keep track of the mapping symbol state of any sections we
// use. Each one should start off as EMS_None, which is provided as the
@@ -117,15 +115,8 @@ public:
}
void emitInst(uint32_t Inst) {
- char Buffer[4];
- const bool LittleEndian = getContext().getAsmInfo()->isLittleEndian();
-
EmitA64MappingSymbol();
- for (unsigned II = 0; II != 4; ++II) {
- const unsigned I = LittleEndian ? (4 - II - 1) : II;
- Buffer[4 - II - 1] = uint8_t(Inst >> I * CHAR_BIT);
- }
- MCELFStreamer::EmitBytes(StringRef(Buffer, 4));
+ MCELFStreamer::EmitIntValue(Inst, 4);
}
/// This is one of the functions used to emit data into an ELF section, so the
@@ -189,8 +180,6 @@ private:
DenseMap<const MCSection *, ElfMappingSymbol> LastMappingSymbols;
ElfMappingSymbol LastEMS;
-
- /// @}
};
} // end anonymous namespace
Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp?rev=238102&r1=238101&r2=238102&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp (original)
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp Sat May 23 11:39:10 2015
@@ -223,7 +223,7 @@ void ARMTargetAsmStreamer::emitInst(uint
OS << "\t.inst";
if (Suffix)
OS << "." << Suffix;
- OS << "\t0x" << utohexstr(Inst) << "\n";
+ OS << "\t0x" << Twine::utohexstr(Inst) << "\n";
}
void ARMTargetAsmStreamer::emitUnwindRaw(int64_t Offset,
@@ -232,7 +232,7 @@ void ARMTargetAsmStreamer::emitUnwindRaw
for (SmallVectorImpl<uint8_t>::const_iterator OCI = Opcodes.begin(),
OCE = Opcodes.end();
OCI != OCE; ++OCI)
- OS << ", 0x" << utohexstr(*OCI);
+ OS << ", 0x" << Twine::utohexstr(*OCI);
OS << '\n';
}
Modified: llvm/trunk/test/MC/AArch64/inst-directive.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/AArch64/inst-directive.s?rev=238102&r1=238101&r2=238102&view=diff
==============================================================================
--- llvm/trunk/test/MC/AArch64/inst-directive.s (original)
+++ llvm/trunk/test/MC/AArch64/inst-directive.s Sat May 23 11:39:10 2015
@@ -15,7 +15,7 @@ aarch64_inst:
// CHECK-ASM: .globl aarch64_inst
// CHECK-ASM: .type aarch64_inst, at function
// CHECK-ASM: aarch64_inst:
-// CHECK-ASM: .inst 0x5E104020
+// CHECK-ASM: .inst 0x5e104020
// CHECK-OBJ: Section {
// CHECK-OBJ: Name: .inst.aarch64_inst
Modified: llvm/trunk/test/MC/ARM/inst-directive-emit.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/inst-directive-emit.s?rev=238102&r1=238101&r2=238102&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/inst-directive-emit.s (original)
+++ llvm/trunk/test/MC/ARM/inst-directive-emit.s Sat May 23 11:39:10 2015
@@ -15,6 +15,6 @@ emit_asm:
@ CHECK: .globl emit_asm
@ CHECK: .type emit_asm,%function
@ CHECK: emit_asm:
-@ CHECK: inst.w 0xF2400000
-@ CHECK: inst.w 0xF2C00000
+@ CHECK: inst.w 0xf2400000
+@ CHECK: inst.w 0xf2c00000
More information about the llvm-commits
mailing list