From 621c44d3606307a3e9e56add33539c78c0009ab9 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 22 Aug 2009 20:48:53 +0000 Subject: Rename TargetAsmInfo (and its subclasses) to MCAsmInfo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79763 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/ARMBaseInstrInfo.cpp | 4 +- lib/Target/ARM/ARMInstrInfo.cpp | 2 +- lib/Target/ARM/ARMMCAsmInfo.cpp | 72 +++++++++++++++++++++++++++++ lib/Target/ARM/ARMMCAsmInfo.h | 31 +++++++++++++ lib/Target/ARM/ARMTargetAsmInfo.cpp | 72 ----------------------------- lib/Target/ARM/ARMTargetAsmInfo.h | 31 ------------- lib/Target/ARM/ARMTargetMachine.cpp | 12 ++--- lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp | 6 +-- 8 files changed, 115 insertions(+), 115 deletions(-) create mode 100644 lib/Target/ARM/ARMMCAsmInfo.cpp create mode 100644 lib/Target/ARM/ARMMCAsmInfo.h delete mode 100644 lib/Target/ARM/ARMTargetAsmInfo.cpp delete mode 100644 lib/Target/ARM/ARMTargetAsmInfo.h (limited to 'lib/Target/ARM') diff --git a/lib/Target/ARM/ARMBaseInstrInfo.cpp b/lib/Target/ARM/ARMBaseInstrInfo.cpp index 44e5c68..2362e77 100644 --- a/lib/Target/ARM/ARMBaseInstrInfo.cpp +++ b/lib/Target/ARM/ARMBaseInstrInfo.cpp @@ -21,7 +21,7 @@ #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineJumpTableInfo.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/ErrorHandling.h" using namespace llvm; @@ -405,7 +405,7 @@ static unsigned getNumJTEntries(const std::vector &JT, unsigned ARMBaseInstrInfo::GetInstSizeInBytes(const MachineInstr *MI) const { const MachineBasicBlock &MBB = *MI->getParent(); const MachineFunction *MF = MBB.getParent(); - const TargetAsmInfo *TAI = MF->getTarget().getTargetAsmInfo(); + const MCAsmInfo *TAI = MF->getTarget().getMCAsmInfo(); // Basic size info comes from the TSFlags field. const TargetInstrDesc &TID = MI->getDesc(); diff --git a/lib/Target/ARM/ARMInstrInfo.cpp b/lib/Target/ARM/ARMInstrInfo.cpp index 71fce8c..4c92891 100644 --- a/lib/Target/ARM/ARMInstrInfo.cpp +++ b/lib/Target/ARM/ARMInstrInfo.cpp @@ -21,7 +21,7 @@ #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineJumpTableInfo.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Support/CommandLine.h" using namespace llvm; diff --git a/lib/Target/ARM/ARMMCAsmInfo.cpp b/lib/Target/ARM/ARMMCAsmInfo.cpp new file mode 100644 index 0000000..ed6f6b2 --- /dev/null +++ b/lib/Target/ARM/ARMMCAsmInfo.cpp @@ -0,0 +1,72 @@ +//===-- ARMMCAsmInfo.cpp - ARM asm properties -------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declarations of the ARMMCAsmInfo properties. +// +//===----------------------------------------------------------------------===// + +#include "ARMMCAsmInfo.h" +using namespace llvm; + +static const char *const arm_asm_table[] = { + "{r0}", "r0", + "{r1}", "r1", + "{r2}", "r2", + "{r3}", "r3", + "{r4}", "r4", + "{r5}", "r5", + "{r6}", "r6", + "{r7}", "r7", + "{r8}", "r8", + "{r9}", "r9", + "{r10}", "r10", + "{r11}", "r11", + "{r12}", "r12", + "{r13}", "r13", + "{r14}", "r14", + "{lr}", "lr", + "{sp}", "sp", + "{ip}", "ip", + "{fp}", "fp", + "{sl}", "sl", + "{memory}", "memory", + "{cc}", "cc", + 0,0 +}; + +ARMDarwinMCAsmInfo::ARMDarwinMCAsmInfo() { + AsmTransCBE = arm_asm_table; + Data64bitsDirective = 0; + CommentString = "@"; + COMMDirectiveTakesAlignment = false; + SupportsDebugInformation = true; + + // Exceptions handling + ExceptionsType = ExceptionHandling::SjLj; + AbsoluteEHSectionOffsets = false; +} + +ARMELFMCAsmInfo::ARMELFMCAsmInfo() { + AlignmentIsInBytes = false; + Data64bitsDirective = 0; + CommentString = "@"; + COMMDirectiveTakesAlignment = false; + + NeedsSet = false; + HasLEB128 = true; + AbsoluteDebugSectionOffsets = true; + PrivateGlobalPrefix = ".L"; + WeakRefDirective = "\t.weak\t"; + SetDirective = "\t.set\t"; + LCOMMDirective = "\t.lcomm\t"; + + DwarfRequiresFrameSection = false; + + SupportsDebugInformation = true; +} diff --git a/lib/Target/ARM/ARMMCAsmInfo.h b/lib/Target/ARM/ARMMCAsmInfo.h new file mode 100644 index 0000000..e263ece --- /dev/null +++ b/lib/Target/ARM/ARMMCAsmInfo.h @@ -0,0 +1,31 @@ +//=====-- ARMMCAsmInfo.h - ARM asm properties -------------*- C++ -*--====// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file contains the declaration of the ARMMCAsmInfo class. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_ARMTARGETASMINFO_H +#define LLVM_ARMTARGETASMINFO_H + +#include "llvm/MC/MCAsmInfoDarwin.h" + +namespace llvm { + + struct ARMDarwinMCAsmInfo : public DarwinMCAsmInfo { + explicit ARMDarwinMCAsmInfo(); + }; + + struct ARMELFMCAsmInfo : public MCAsmInfo { + explicit ARMELFMCAsmInfo(); + }; + +} // namespace llvm + +#endif diff --git a/lib/Target/ARM/ARMTargetAsmInfo.cpp b/lib/Target/ARM/ARMTargetAsmInfo.cpp deleted file mode 100644 index 0c3df82..0000000 --- a/lib/Target/ARM/ARMTargetAsmInfo.cpp +++ /dev/null @@ -1,72 +0,0 @@ -//===-- ARMTargetAsmInfo.cpp - ARM asm properties ---------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declarations of the ARMTargetAsmInfo properties. -// -//===----------------------------------------------------------------------===// - -#include "ARMTargetAsmInfo.h" -using namespace llvm; - -static const char *const arm_asm_table[] = { - "{r0}", "r0", - "{r1}", "r1", - "{r2}", "r2", - "{r3}", "r3", - "{r4}", "r4", - "{r5}", "r5", - "{r6}", "r6", - "{r7}", "r7", - "{r8}", "r8", - "{r9}", "r9", - "{r10}", "r10", - "{r11}", "r11", - "{r12}", "r12", - "{r13}", "r13", - "{r14}", "r14", - "{lr}", "lr", - "{sp}", "sp", - "{ip}", "ip", - "{fp}", "fp", - "{sl}", "sl", - "{memory}", "memory", - "{cc}", "cc", - 0,0 -}; - -ARMDarwinTargetAsmInfo::ARMDarwinTargetAsmInfo() { - AsmTransCBE = arm_asm_table; - Data64bitsDirective = 0; - CommentString = "@"; - COMMDirectiveTakesAlignment = false; - SupportsDebugInformation = true; - - // Exceptions handling - ExceptionsType = ExceptionHandling::SjLj; - AbsoluteEHSectionOffsets = false; -} - -ARMELFTargetAsmInfo::ARMELFTargetAsmInfo() { - AlignmentIsInBytes = false; - Data64bitsDirective = 0; - CommentString = "@"; - COMMDirectiveTakesAlignment = false; - - NeedsSet = false; - HasLEB128 = true; - AbsoluteDebugSectionOffsets = true; - PrivateGlobalPrefix = ".L"; - WeakRefDirective = "\t.weak\t"; - SetDirective = "\t.set\t"; - LCOMMDirective = "\t.lcomm\t"; - - DwarfRequiresFrameSection = false; - - SupportsDebugInformation = true; -} diff --git a/lib/Target/ARM/ARMTargetAsmInfo.h b/lib/Target/ARM/ARMTargetAsmInfo.h deleted file mode 100644 index 3fde8ba..0000000 --- a/lib/Target/ARM/ARMTargetAsmInfo.h +++ /dev/null @@ -1,31 +0,0 @@ -//=====-- ARMTargetAsmInfo.h - ARM asm properties -------------*- C++ -*--====// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains the declaration of the ARMTargetAsmInfo class. -// -//===----------------------------------------------------------------------===// - -#ifndef LLVM_ARMTARGETASMINFO_H -#define LLVM_ARMTARGETASMINFO_H - -#include "llvm/Target/DarwinTargetAsmInfo.h" - -namespace llvm { - - struct ARMDarwinTargetAsmInfo : public DarwinTargetAsmInfo { - explicit ARMDarwinTargetAsmInfo(); - }; - - struct ARMELFTargetAsmInfo : public TargetAsmInfo { - explicit ARMELFTargetAsmInfo(); - }; - -} // namespace llvm - -#endif diff --git a/lib/Target/ARM/ARMTargetMachine.cpp b/lib/Target/ARM/ARMTargetMachine.cpp index fdfa3a3..ae5107a 100644 --- a/lib/Target/ARM/ARMTargetMachine.cpp +++ b/lib/Target/ARM/ARMTargetMachine.cpp @@ -11,7 +11,7 @@ //===----------------------------------------------------------------------===// #include "ARMTargetMachine.h" -#include "ARMTargetAsmInfo.h" +#include "ARMMCAsmInfo.h" #include "ARMFrameInfo.h" #include "ARM.h" #include "llvm/PassManager.h" @@ -27,14 +27,14 @@ static cl::opt DisableLdStOpti("disable-arm-loadstore-opti", cl::Hidden, static cl::opt DisableIfConversion("disable-arm-if-conversion",cl::Hidden, cl::desc("Disable if-conversion pass")); -static const TargetAsmInfo *createTargetAsmInfo(const Target &T, +static const MCAsmInfo *createMCAsmInfo(const Target &T, const StringRef &TT) { Triple TheTriple(TT); switch (TheTriple.getOS()) { case Triple::Darwin: - return new ARMDarwinTargetAsmInfo(); + return new ARMDarwinMCAsmInfo(); default: - return new ARMELFTargetAsmInfo(); + return new ARMELFMCAsmInfo(); } } @@ -45,8 +45,8 @@ extern "C" void LLVMInitializeARMTarget() { RegisterTargetMachine Y(TheThumbTarget); // Register the target asm info. - RegisterAsmInfoFn A(TheARMTarget, createTargetAsmInfo); - RegisterAsmInfoFn B(TheThumbTarget, createTargetAsmInfo); + RegisterAsmInfoFn A(TheARMTarget, createMCAsmInfo); + RegisterAsmInfoFn B(TheThumbTarget, createMCAsmInfo); } /// TargetMachine ctor - Create an ARM architecture model. diff --git a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp index 4b0f92f..1b36b21 100644 --- a/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp @@ -29,7 +29,7 @@ #include "llvm/CodeGen/MachineJumpTableInfo.h" #include "llvm/MC/MCSectionMachO.h" #include "llvm/MC/MCStreamer.h" -#include "llvm/Target/TargetAsmInfo.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetMachine.h" @@ -111,7 +111,7 @@ namespace { bool InCPMode; public: explicit ARMAsmPrinter(formatted_raw_ostream &O, TargetMachine &TM, - const TargetAsmInfo *T, bool V) + const MCAsmInfo *T, bool V) : AsmPrinter(O, TM, T, V), DW(0), AFI(NULL), MCP(NULL), InCPMode(false) { Subtarget = &TM.getSubtarget(); @@ -423,7 +423,7 @@ void ARMAsmPrinter::printOperand(const MachineInstr *MI, int OpNum, } static void printSOImm(formatted_raw_ostream &O, int64_t V, bool VerboseAsm, - const TargetAsmInfo *TAI) { + const MCAsmInfo *TAI) { // Break it up into two parts that make up a shifter immediate. V = ARM_AM::getSOImmVal(V); assert(V != -1 && "Not a valid so_imm value!"); -- cgit v1.1