1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00

ARM TAI no longer needs a TM, but createTargetAsmInfo() still does.

llvm-svn: 77878
This commit is contained in:
Chris Lattner 2009-08-02 05:23:52 +00:00
parent c388490738
commit bbe55a038a
3 changed files with 11 additions and 22 deletions

View File

@ -12,9 +12,6 @@
//===----------------------------------------------------------------------===//
#include "ARMTargetAsmInfo.h"
#include "ARMTargetMachine.h"
#include <cstring>
#include <cctype>
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<DarwinTargetAsmInfo>(TM) {
Subtarget = &TM.getSubtarget<ARMSubtarget>();
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<TargetAsmInfo>(TM) {
Subtarget = &TM.getSubtarget<ARMSubtarget>();
ARMELFTargetAsmInfo::ARMELFTargetAsmInfo() {
NeedsSet = false;
HasLEB128 = true;
AbsoluteDebugSectionOffsets = true;
@ -82,4 +73,5 @@ ARMELFTargetAsmInfo::ARMELFTargetAsmInfo(const ARMBaseTargetMachine &TM):
}
// Instantiate default implementation.
TEMPLATE_INSTANTIATION(class ARMTargetAsmInfo<DarwinTargetAsmInfo>);
TEMPLATE_INSTANTIATION(class ARMTargetAsmInfo<TargetAsmInfo>);

View File

@ -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 <class BaseTAI>
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<DarwinTargetAsmInfo>);
EXTERN_TEMPLATE_INSTANTIATION(class ARMTargetAsmInfo<TargetAsmInfo>);
struct ARMDarwinTargetAsmInfo : public ARMTargetAsmInfo<DarwinTargetAsmInfo> {
explicit ARMDarwinTargetAsmInfo(const ARMBaseTargetMachine &TM);
explicit ARMDarwinTargetAsmInfo();
};
struct ARMELFTargetAsmInfo : public ARMTargetAsmInfo<TargetAsmInfo> {
explicit ARMELFTargetAsmInfo(const ARMBaseTargetMachine &TM);
explicit ARMELFTargetAsmInfo();
};
} // namespace llvm

View File

@ -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();
}
}