mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-26 21:32:10 +00:00
Add a MCAsmInfoELF class and factor some code into it.
We had a MCAsmInfoCOFF, but no common class for all the ELF MCAsmInfos before. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192760 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d910c46963
commit
06957f43f6
23
include/llvm/MC/MCAsmInfoELF.h
Normal file
23
include/llvm/MC/MCAsmInfoELF.h
Normal file
@ -0,0 +1,23 @@
|
||||
//===-- llvm/MC/MCAsmInfoELF.h - ELF Asm info -------------------*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_MC_MCASMINFOELF_H
|
||||
#define LLVM_MC_MCASMINFOELF_H
|
||||
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
|
||||
namespace llvm {
|
||||
class MCAsmInfoELF : public MCAsmInfo {
|
||||
virtual void anchor();
|
||||
protected:
|
||||
MCAsmInfoELF();
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
@ -4,6 +4,7 @@ add_llvm_library(LLVMMC
|
||||
MCAsmInfo.cpp
|
||||
MCAsmInfoCOFF.cpp
|
||||
MCAsmInfoDarwin.cpp
|
||||
MCAsmInfoELF.cpp
|
||||
MCAsmStreamer.cpp
|
||||
MCAssembler.cpp
|
||||
MCAtom.cpp
|
||||
|
23
lib/MC/MCAsmInfoELF.cpp
Normal file
23
lib/MC/MCAsmInfoELF.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
//===-- MCAsmInfoELF.cpp - ELF 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 defines target asm properties related what form asm statements
|
||||
// should take in general on ELF-based targets
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/MC/MCAsmInfoELF.h"
|
||||
using namespace llvm;
|
||||
|
||||
void MCAsmInfoELF::anchor() { }
|
||||
|
||||
MCAsmInfoELF::MCAsmInfoELF() {
|
||||
HasIdentDirective = true;
|
||||
WeakRefDirective = "\t.weak\t";
|
||||
}
|
@ -31,8 +31,6 @@ AArch64ELFMCAsmInfo::AArch64ELFMCAsmInfo() {
|
||||
|
||||
UseDataRegionDirectives = true;
|
||||
|
||||
WeakRefDirective = "\t.weak\t";
|
||||
|
||||
HasLEB128 = true;
|
||||
SupportsDebugInformation = true;
|
||||
|
||||
|
@ -14,11 +14,11 @@
|
||||
#ifndef LLVM_AARCH64TARGETASMINFO_H
|
||||
#define LLVM_AARCH64TARGETASMINFO_H
|
||||
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
#include "llvm/MC/MCAsmInfoELF.h"
|
||||
|
||||
namespace llvm {
|
||||
|
||||
struct AArch64ELFMCAsmInfo : public MCAsmInfo {
|
||||
struct AArch64ELFMCAsmInfo : public MCAsmInfoELF {
|
||||
explicit AArch64ELFMCAsmInfo();
|
||||
};
|
||||
|
||||
|
@ -49,8 +49,6 @@ ARMELFMCAsmInfo::ARMELFMCAsmInfo() {
|
||||
Code16Directive = ".code\t16";
|
||||
Code32Directive = ".code\t32";
|
||||
|
||||
WeakRefDirective = "\t.weak\t";
|
||||
|
||||
HasLEB128 = true;
|
||||
SupportsDebugInformation = true;
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
#define LLVM_ARMTARGETASMINFO_H
|
||||
|
||||
#include "llvm/MC/MCAsmInfoDarwin.h"
|
||||
#include "llvm/MC/MCAsmInfoELF.h"
|
||||
|
||||
namespace llvm {
|
||||
|
||||
@ -24,7 +25,7 @@ namespace llvm {
|
||||
explicit ARMMCAsmInfoDarwin();
|
||||
};
|
||||
|
||||
class ARMELFMCAsmInfo : public MCAsmInfo {
|
||||
class ARMELFMCAsmInfo : public MCAsmInfoELF {
|
||||
virtual void anchor();
|
||||
public:
|
||||
explicit ARMELFMCAsmInfo();
|
||||
|
@ -29,7 +29,6 @@ HexagonMCAsmInfo::HexagonMCAsmInfo(StringRef TT) {
|
||||
InlineAsmEnd = "# InlineAsm End";
|
||||
ZeroDirective = "\t.space\t";
|
||||
AscizDirective = "\t.string\t";
|
||||
WeakRefDirective = "\t.weak\t";
|
||||
|
||||
SupportsDebugInformation = true;
|
||||
UsesELFSectionDirectiveForBSS = true;
|
||||
|
@ -15,10 +15,10 @@
|
||||
#define HexagonMCASMINFO_H
|
||||
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
#include "llvm/MC/MCAsmInfoELF.h"
|
||||
|
||||
namespace llvm {
|
||||
class HexagonMCAsmInfo : public MCAsmInfo {
|
||||
class HexagonMCAsmInfo : public MCAsmInfoELF {
|
||||
public:
|
||||
explicit HexagonMCAsmInfo(StringRef TT);
|
||||
};
|
||||
|
@ -21,7 +21,6 @@ MSP430MCAsmInfo::MSP430MCAsmInfo(StringRef TT) {
|
||||
PointerSize = CalleeSaveStackSlotSize = 2;
|
||||
|
||||
PrivateGlobalPrefix = ".L";
|
||||
WeakRefDirective ="\t.weak\t";
|
||||
CommentString = ";";
|
||||
|
||||
AlignmentIsInBytes = false;
|
||||
|
@ -14,12 +14,12 @@
|
||||
#ifndef MSP430TARGETASMINFO_H
|
||||
#define MSP430TARGETASMINFO_H
|
||||
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
#include "llvm/MC/MCAsmInfoELF.h"
|
||||
|
||||
namespace llvm {
|
||||
class StringRef;
|
||||
|
||||
class MSP430MCAsmInfo : public MCAsmInfo {
|
||||
class MSP430MCAsmInfo : public MCAsmInfoELF {
|
||||
virtual void anchor();
|
||||
public:
|
||||
explicit MSP430MCAsmInfo(StringRef TT);
|
||||
|
@ -38,7 +38,6 @@ MipsMCAsmInfo::MipsMCAsmInfo(StringRef TT) {
|
||||
ZeroDirective = "\t.space\t";
|
||||
GPRel32Directive = "\t.gpword\t";
|
||||
GPRel64Directive = "\t.gpdword\t";
|
||||
WeakRefDirective = "\t.weak\t";
|
||||
DebugLabelSuffix = "=.";
|
||||
SupportsDebugInformation = true;
|
||||
ExceptionsType = ExceptionHandling::DwarfCFI;
|
||||
|
@ -14,12 +14,12 @@
|
||||
#ifndef MIPSTARGETASMINFO_H
|
||||
#define MIPSTARGETASMINFO_H
|
||||
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
#include "llvm/MC/MCAsmInfoELF.h"
|
||||
|
||||
namespace llvm {
|
||||
class StringRef;
|
||||
|
||||
class MipsMCAsmInfo : public MCAsmInfo {
|
||||
class MipsMCAsmInfo : public MCAsmInfoELF {
|
||||
virtual void anchor();
|
||||
public:
|
||||
explicit MipsMCAsmInfo(StringRef TT);
|
||||
|
@ -46,8 +46,7 @@ PPCLinuxMCAsmInfo::PPCLinuxMCAsmInfo(bool is64Bit) {
|
||||
CommentString = "#";
|
||||
GlobalPrefix = "";
|
||||
PrivateGlobalPrefix = ".L";
|
||||
WeakRefDirective = "\t.weak\t";
|
||||
|
||||
|
||||
// Uses '.section' before '.bss' directive
|
||||
UsesELFSectionDirectiveForBSS = true;
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
#define PPCTARGETASMINFO_H
|
||||
|
||||
#include "llvm/MC/MCAsmInfoDarwin.h"
|
||||
#include "llvm/MC/MCAsmInfoELF.h"
|
||||
|
||||
namespace llvm {
|
||||
|
||||
@ -24,7 +25,7 @@ namespace llvm {
|
||||
explicit PPCMCAsmInfoDarwin(bool is64Bit);
|
||||
};
|
||||
|
||||
class PPCLinuxMCAsmInfo : public MCAsmInfo {
|
||||
class PPCLinuxMCAsmInfo : public MCAsmInfoELF {
|
||||
virtual void anchor();
|
||||
public:
|
||||
explicit PPCLinuxMCAsmInfo(bool is64Bit);
|
||||
|
@ -41,8 +41,6 @@ SparcELFMCAsmInfo::SparcELFMCAsmInfo(StringRef TT) {
|
||||
SunStyleELFSectionSwitchSyntax = true;
|
||||
UsesELFSectionDirectiveForBSS = true;
|
||||
|
||||
WeakRefDirective = "\t.weak\t";
|
||||
|
||||
PrivateGlobalPrefix = ".L";
|
||||
}
|
||||
|
||||
|
@ -14,12 +14,12 @@
|
||||
#ifndef SPARCTARGETASMINFO_H
|
||||
#define SPARCTARGETASMINFO_H
|
||||
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
#include "llvm/MC/MCAsmInfoELF.h"
|
||||
|
||||
namespace llvm {
|
||||
class StringRef;
|
||||
|
||||
class SparcELFMCAsmInfo : public MCAsmInfo {
|
||||
class SparcELFMCAsmInfo : public MCAsmInfoELF {
|
||||
virtual void anchor();
|
||||
public:
|
||||
explicit SparcELFMCAsmInfo(StringRef TT);
|
||||
|
@ -21,7 +21,6 @@ SystemZMCAsmInfo::SystemZMCAsmInfo(StringRef TT) {
|
||||
CommentString = "#";
|
||||
GlobalPrefix = "";
|
||||
PrivateGlobalPrefix = ".L";
|
||||
WeakRefDirective = "\t.weak\t";
|
||||
ZeroDirective = "\t.space\t";
|
||||
Data64bitsDirective = "\t.quad\t";
|
||||
UsesELFSectionDirectiveForBSS = true;
|
||||
|
@ -10,13 +10,13 @@
|
||||
#ifndef SystemZTARGETASMINFO_H
|
||||
#define SystemZTARGETASMINFO_H
|
||||
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
#include "llvm/MC/MCAsmInfoELF.h"
|
||||
#include "llvm/Support/Compiler.h"
|
||||
|
||||
namespace llvm {
|
||||
class StringRef;
|
||||
|
||||
class SystemZMCAsmInfo : public MCAsmInfo {
|
||||
class SystemZMCAsmInfo : public MCAsmInfoELF {
|
||||
public:
|
||||
explicit SystemZMCAsmInfo(StringRef TT);
|
||||
|
||||
|
@ -90,8 +90,6 @@ X86ELFMCAsmInfo::X86ELFMCAsmInfo(const Triple &T) {
|
||||
TextAlignFillValue = 0x90;
|
||||
|
||||
PrivateGlobalPrefix = ".L";
|
||||
WeakRefDirective = "\t.weak\t";
|
||||
HasIdentDirective = true;
|
||||
|
||||
// Set up DWARF directives
|
||||
HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
#include "llvm/MC/MCAsmInfoCOFF.h"
|
||||
#include "llvm/MC/MCAsmInfoDarwin.h"
|
||||
#include "llvm/MC/MCAsmInfoELF.h"
|
||||
|
||||
namespace llvm {
|
||||
class Triple;
|
||||
@ -35,7 +36,7 @@ namespace llvm {
|
||||
MCStreamer &Streamer) const;
|
||||
};
|
||||
|
||||
class X86ELFMCAsmInfo : public MCAsmInfo {
|
||||
class X86ELFMCAsmInfo : public MCAsmInfoELF {
|
||||
virtual void anchor();
|
||||
public:
|
||||
explicit X86ELFMCAsmInfo(const Triple &Triple);
|
||||
|
@ -23,7 +23,6 @@ XCoreMCAsmInfo::XCoreMCAsmInfo(StringRef TT) {
|
||||
|
||||
PrivateGlobalPrefix = ".L";
|
||||
AscizDirective = ".asciiz";
|
||||
WeakRefDirective = "\t.weak\t";
|
||||
|
||||
HiddenVisibilityAttr = MCSA_Invalid;
|
||||
HiddenDeclarationVisibilityAttr = MCSA_Invalid;
|
||||
|
@ -14,13 +14,13 @@
|
||||
#ifndef XCORETARGETASMINFO_H
|
||||
#define XCORETARGETASMINFO_H
|
||||
|
||||
#include "llvm/MC/MCAsmInfo.h"
|
||||
#include "llvm/MC/MCAsmInfoELF.h"
|
||||
|
||||
namespace llvm {
|
||||
class StringRef;
|
||||
class Target;
|
||||
|
||||
class XCoreMCAsmInfo : public MCAsmInfo {
|
||||
class XCoreMCAsmInfo : public MCAsmInfoELF {
|
||||
virtual void anchor();
|
||||
public:
|
||||
explicit XCoreMCAsmInfo(StringRef TT);
|
||||
|
Loading…
Reference in New Issue
Block a user