From 24def37c85cad01845e5fb2efc87e4d5471a2a6a Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 2 Aug 2009 05:23:52 +0000 Subject: [PATCH] ARM TAI no longer needs a TM, but createTargetAsmInfo() still does. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77878 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/ARMTargetAsmInfo.cpp | 14 +++----------- lib/Target/ARM/ARMTargetAsmInfo.h | 15 ++++++--------- lib/Target/ARM/ARMTargetMachine.cpp | 4 ++-- 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/lib/Target/ARM/ARMTargetAsmInfo.cpp b/lib/Target/ARM/ARMTargetAsmInfo.cpp index b1ae524bba3..3ff777c73d3 100644 --- a/lib/Target/ARM/ARMTargetAsmInfo.cpp +++ b/lib/Target/ARM/ARMTargetAsmInfo.cpp @@ -12,9 +12,6 @@ //===----------------------------------------------------------------------===// #include "ARMTargetAsmInfo.h" -#include "ARMTargetMachine.h" -#include -#include using namespace llvm; const char *const llvm::arm_asm_table[] = { @@ -43,10 +40,7 @@ const char *const llvm::arm_asm_table[] = { 0,0 }; -ARMDarwinTargetAsmInfo::ARMDarwinTargetAsmInfo(const ARMBaseTargetMachine &TM): - ARMTargetAsmInfo(TM) { - Subtarget = &TM.getSubtarget(); - +ARMDarwinTargetAsmInfo::ARMDarwinTargetAsmInfo() { ZeroDirective = "\t.space\t"; ZeroFillDirective = "\t.zerofill\t"; // Uses .zerofill SetDirective = "\t.set\t"; @@ -55,10 +49,7 @@ ARMDarwinTargetAsmInfo::ARMDarwinTargetAsmInfo(const ARMBaseTargetMachine &TM): SupportsDebugInformation = true; } -ARMELFTargetAsmInfo::ARMELFTargetAsmInfo(const ARMBaseTargetMachine &TM): - ARMTargetAsmInfo(TM) { - Subtarget = &TM.getSubtarget(); - +ARMELFTargetAsmInfo::ARMELFTargetAsmInfo() { NeedsSet = false; HasLEB128 = true; AbsoluteDebugSectionOffsets = true; @@ -82,4 +73,5 @@ ARMELFTargetAsmInfo::ARMELFTargetAsmInfo(const ARMBaseTargetMachine &TM): } // Instantiate default implementation. +TEMPLATE_INSTANTIATION(class ARMTargetAsmInfo); TEMPLATE_INSTANTIATION(class ARMTargetAsmInfo); diff --git a/lib/Target/ARM/ARMTargetAsmInfo.h b/lib/Target/ARM/ARMTargetAsmInfo.h index fb46be9140c..9b97cbdc17a 100644 --- a/lib/Target/ARM/ARMTargetAsmInfo.h +++ b/lib/Target/ARM/ARMTargetAsmInfo.h @@ -11,11 +11,9 @@ // //===----------------------------------------------------------------------===// -#ifndef ARMTARGETASMINFO_H -#define ARMTARGETASMINFO_H +#ifndef LLVM_ARMTARGETASMINFO_H +#define LLVM_ARMTARGETASMINFO_H -#include "ARMTargetMachine.h" -#include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/DarwinTargetAsmInfo.h" #include "llvm/Support/Compiler.h" @@ -25,7 +23,7 @@ namespace llvm { template struct ARMTargetAsmInfo : public BaseTAI { - explicit ARMTargetAsmInfo(const ARMBaseTargetMachine &TM) { + explicit ARMTargetAsmInfo() { BaseTAI::AsmTransCBE = arm_asm_table; BaseTAI::AlignmentIsInBytes = false; @@ -36,18 +34,17 @@ namespace llvm { BaseTAI::InlineAsmEnd = "@ InlineAsm End"; BaseTAI::LCOMMDirective = "\t.lcomm\t"; } - - const ARMSubtarget *Subtarget; }; + EXTERN_TEMPLATE_INSTANTIATION(class ARMTargetAsmInfo); EXTERN_TEMPLATE_INSTANTIATION(class ARMTargetAsmInfo); struct ARMDarwinTargetAsmInfo : public ARMTargetAsmInfo { - explicit ARMDarwinTargetAsmInfo(const ARMBaseTargetMachine &TM); + explicit ARMDarwinTargetAsmInfo(); }; struct ARMELFTargetAsmInfo : public ARMTargetAsmInfo { - explicit ARMELFTargetAsmInfo(const ARMBaseTargetMachine &TM); + explicit ARMELFTargetAsmInfo(); }; } // namespace llvm diff --git a/lib/Target/ARM/ARMTargetMachine.cpp b/lib/Target/ARM/ARMTargetMachine.cpp index 9f70ab90059..96552ede201 100644 --- a/lib/Target/ARM/ARMTargetMachine.cpp +++ b/lib/Target/ARM/ARMTargetMachine.cpp @@ -78,9 +78,9 @@ const TargetAsmInfo *ARMBaseTargetMachine::createTargetAsmInfo() const { switch (Subtarget.TargetType) { default: llvm_unreachable("Unknown ARM subtarget kind"); case ARMSubtarget::isDarwin: - return new ARMDarwinTargetAsmInfo(*this); + return new ARMDarwinTargetAsmInfo(); case ARMSubtarget::isELF: - return new ARMELFTargetAsmInfo(*this); + return new ARMELFTargetAsmInfo(); } } -- 2.34.1