diff options
author | Chris Lattner <sabre@nondot.org> | 2010-11-17 05:41:32 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-11-17 05:41:32 +0000 |
commit | b75c651e22a63907b727664f044283bf9c9fb885 (patch) | |
tree | 532e53f22daf7c5f4da284da1acfbd5fb2fa11ad /lib | |
parent | 2567eec4233d58a2a0cbdcafca9420452689b395 (diff) | |
download | external_llvm-b75c651e22a63907b727664f044283bf9c9fb885.zip external_llvm-b75c651e22a63907b727664f044283bf9c9fb885.tar.gz external_llvm-b75c651e22a63907b727664f044283bf9c9fb885.tar.bz2 |
tidy up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119462 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/ARM/ARMAsmBackend.cpp | 13 | ||||
-rw-r--r-- | lib/Target/ARM/ARMTargetMachine.cpp | 29 |
2 files changed, 16 insertions, 26 deletions
diff --git a/lib/Target/ARM/ARMAsmBackend.cpp b/lib/Target/ARM/ARMAsmBackend.cpp index 86b1e06..75a5511 100644 --- a/lib/Target/ARM/ARMAsmBackend.cpp +++ b/lib/Target/ARM/ARMAsmBackend.cpp @@ -22,15 +22,12 @@ #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetRegistry.h" -#include "llvm/Target/TargetAsmBackend.h" using namespace llvm; namespace { class ARMAsmBackend : public TargetAsmBackend { public: - ARMAsmBackend(const Target &T) - : TargetAsmBackend(T) { - } + ARMAsmBackend(const Target &T) : TargetAsmBackend(T) {} bool MayNeedRelaxation(const MCInst &Inst) const; @@ -42,6 +39,7 @@ public: return 4; } }; +} // end anonymous namespace bool ARMAsmBackend::MayNeedRelaxation(const MCInst &Inst) const { // FIXME: Thumb targets, different move constant targets.. @@ -64,7 +62,6 @@ bool ARMAsmBackend::WriteNopData(uint64_t Count, MCObjectWriter *OW) const { OW->Write8(0); return true; } -} // end anonymous namespace namespace { // FIXME: This should be in a separate file. @@ -105,13 +102,12 @@ void ELFARMAsmBackend::ApplyFixup(const MCFixup &Fixup, MCDataFragment &DF, assert(0 && "ELFARMAsmBackend::ApplyFixup() unimplemented"); } +namespace { // FIXME: This should be in a separate file. class DarwinARMAsmBackend : public ARMAsmBackend { MCMachOObjectFormat Format; - public: - DarwinARMAsmBackend(const Target &T) - : ARMAsmBackend(T) { + DarwinARMAsmBackend(const Target &T) : ARMAsmBackend(T) { HasScatteredSymbols = true; } @@ -140,6 +136,7 @@ public: return false; } }; +} // end anonymous namespace static unsigned getFixupKindNumBytes(unsigned Kind) { switch (Kind) { diff --git a/lib/Target/ARM/ARMTargetMachine.cpp b/lib/Target/ARM/ARMTargetMachine.cpp index 9aa7c1f..1c05ab5 100644 --- a/lib/Target/ARM/ARMTargetMachine.cpp +++ b/lib/Target/ARM/ARMTargetMachine.cpp @@ -34,13 +34,12 @@ static MCAsmInfo *createMCAsmInfo(const Target &T, StringRef TT) { // This is duplicated code. Refactor this. static MCStreamer *createMCStreamer(const Target &T, const std::string &TT, MCContext &Ctx, TargetAsmBackend &TAB, - raw_ostream &_OS, - MCCodeEmitter *_Emitter, + raw_ostream &OS, + MCCodeEmitter *Emitter, bool RelaxAll) { - Triple TheTriple(TT); - switch (TheTriple.getOS()) { + switch (Triple(TT).getOS()) { case Triple::Darwin: - return createMachOStreamer(Ctx, TAB, _OS, _Emitter, RelaxAll); + return createMachOStreamer(Ctx, TAB, OS, Emitter, RelaxAll); case Triple::MinGW32: case Triple::MinGW64: case Triple::Cygwin: @@ -48,7 +47,7 @@ static MCStreamer *createMCStreamer(const Target &T, const std::string &TT, llvm_unreachable("ARM does not support Windows COFF format"); return NULL; default: - return createELFStreamer(Ctx, TAB, _OS, _Emitter, RelaxAll); + return createELFStreamer(Ctx, TAB, OS, Emitter, RelaxAll); } } @@ -62,22 +61,16 @@ extern "C" void LLVMInitializeARMTarget() { RegisterAsmInfoFn B(TheThumbTarget, createMCAsmInfo); // Register the MC Code Emitter - TargetRegistry::RegisterCodeEmitter(TheARMTarget, - createARMMCCodeEmitter); - TargetRegistry::RegisterCodeEmitter(TheThumbTarget, - createARMMCCodeEmitter); + TargetRegistry::RegisterCodeEmitter(TheARMTarget, createARMMCCodeEmitter); + TargetRegistry::RegisterCodeEmitter(TheThumbTarget, createARMMCCodeEmitter); // Register the asm backend. - TargetRegistry::RegisterAsmBackend(TheARMTarget, - createARMAsmBackend); - TargetRegistry::RegisterAsmBackend(TheThumbTarget, - createARMAsmBackend); + TargetRegistry::RegisterAsmBackend(TheARMTarget, createARMAsmBackend); + TargetRegistry::RegisterAsmBackend(TheThumbTarget, createARMAsmBackend); // Register the object streamer. - TargetRegistry::RegisterObjectStreamer(TheARMTarget, - createMCStreamer); - TargetRegistry::RegisterObjectStreamer(TheThumbTarget, - createMCStreamer); + TargetRegistry::RegisterObjectStreamer(TheARMTarget, createMCStreamer); + TargetRegistry::RegisterObjectStreamer(TheThumbTarget, createMCStreamer); } |