mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-27 15:29:51 +00:00
x86_64-apple-darwin10. --- Reverse-merging r78895 into '.': U test/CodeGen/PowerPC/2008-12-12-EH.ll U lib/Target/DarwinTargetAsmInfo.cpp --- Reverse-merging r78892 into '.': U include/llvm/Target/DarwinTargetAsmInfo.h U lib/Target/X86/X86TargetAsmInfo.cpp U lib/Target/X86/X86TargetAsmInfo.h U lib/Target/ARM/ARMTargetAsmInfo.h U lib/Target/ARM/ARMTargetMachine.cpp U lib/Target/ARM/ARMTargetAsmInfo.cpp U lib/Target/PowerPC/PPCTargetAsmInfo.cpp U lib/Target/PowerPC/PPCTargetAsmInfo.h U lib/Target/PowerPC/PPCTargetMachine.cpp G lib/Target/DarwinTargetAsmInfo.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78919 91177308-0d34-0410-b5e6-96231b3b80d8
132 lines
3.6 KiB
C++
132 lines
3.6 KiB
C++
//===-- X86TargetAsmInfo.cpp - X86 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 X86TargetAsmInfo properties.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "X86TargetAsmInfo.h"
|
|
#include "X86TargetMachine.h"
|
|
#include "llvm/ADT/Triple.h"
|
|
#include "llvm/Support/CommandLine.h"
|
|
using namespace llvm;
|
|
|
|
enum AsmWriterFlavorTy {
|
|
// Note: This numbering has to match the GCC assembler dialects for inline
|
|
// asm alternatives to work right.
|
|
ATT = 0, Intel = 1
|
|
};
|
|
|
|
static cl::opt<AsmWriterFlavorTy>
|
|
AsmWriterFlavor("x86-asm-syntax", cl::init(ATT),
|
|
cl::desc("Choose style of code to emit from X86 backend:"),
|
|
cl::values(clEnumValN(ATT, "att", "Emit AT&T-style assembly"),
|
|
clEnumValN(Intel, "intel", "Emit Intel-style assembly"),
|
|
clEnumValEnd));
|
|
|
|
|
|
static const char *const x86_asm_table[] = {
|
|
"{si}", "S",
|
|
"{di}", "D",
|
|
"{ax}", "a",
|
|
"{cx}", "c",
|
|
"{memory}", "memory",
|
|
"{flags}", "",
|
|
"{dirflag}", "",
|
|
"{fpsr}", "",
|
|
"{cc}", "cc",
|
|
0,0};
|
|
|
|
X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const Triple &Triple) {
|
|
AsmTransCBE = x86_asm_table;
|
|
AssemblerDialect = AsmWriterFlavor;
|
|
|
|
bool is64Bit = Triple.getArch() == Triple::x86_64;
|
|
|
|
TextAlignFillValue = 0x90;
|
|
|
|
if (!is64Bit)
|
|
Data64bitsDirective = 0; // we can't emit a 64-bit unit
|
|
|
|
// Leopard and above support aligned common symbols.
|
|
COMMDirectiveTakesAlignment = Triple.getDarwinMajorNumber() >= 9;
|
|
|
|
if (is64Bit) {
|
|
PersonalityPrefix = "";
|
|
PersonalitySuffix = "+4@GOTPCREL";
|
|
} else {
|
|
PersonalityPrefix = "L";
|
|
PersonalitySuffix = "$non_lazy_ptr";
|
|
}
|
|
|
|
CommentString = "##";
|
|
PCSymbol = ".";
|
|
|
|
SupportsDebugInformation = true;
|
|
DwarfUsesInlineInfoSection = true;
|
|
|
|
// Exceptions handling
|
|
ExceptionsType = ExceptionHandling::Dwarf;
|
|
AbsoluteEHSectionOffsets = false;
|
|
}
|
|
|
|
X86ELFTargetAsmInfo::X86ELFTargetAsmInfo(const Triple &Triple) {
|
|
AsmTransCBE = x86_asm_table;
|
|
AssemblerDialect = AsmWriterFlavor;
|
|
|
|
PrivateGlobalPrefix = ".L";
|
|
WeakRefDirective = "\t.weak\t";
|
|
SetDirective = "\t.set\t";
|
|
PCSymbol = ".";
|
|
|
|
// Set up DWARF directives
|
|
HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
|
|
|
|
// Debug Information
|
|
AbsoluteDebugSectionOffsets = true;
|
|
SupportsDebugInformation = true;
|
|
|
|
// Exceptions handling
|
|
ExceptionsType = ExceptionHandling::Dwarf;
|
|
AbsoluteEHSectionOffsets = false;
|
|
|
|
// On Linux we must declare when we can use a non-executable stack.
|
|
if (Triple.getOS() == Triple::Linux)
|
|
NonexecutableStackDirective = "\t.section\t.note.GNU-stack,\"\",@progbits";
|
|
}
|
|
|
|
X86COFFTargetAsmInfo::X86COFFTargetAsmInfo(const Triple &Triple) {
|
|
AsmTransCBE = x86_asm_table;
|
|
AssemblerDialect = AsmWriterFlavor;
|
|
}
|
|
|
|
|
|
X86WinTargetAsmInfo::X86WinTargetAsmInfo(const Triple &Triple) {
|
|
AsmTransCBE = x86_asm_table;
|
|
AssemblerDialect = AsmWriterFlavor;
|
|
|
|
GlobalPrefix = "_";
|
|
CommentString = ";";
|
|
|
|
PrivateGlobalPrefix = "$";
|
|
AlignDirective = "\tALIGN\t";
|
|
ZeroDirective = "\tdb\t";
|
|
ZeroDirectiveSuffix = " dup(0)";
|
|
AsciiDirective = "\tdb\t";
|
|
AscizDirective = 0;
|
|
Data8bitsDirective = "\tdb\t";
|
|
Data16bitsDirective = "\tdw\t";
|
|
Data32bitsDirective = "\tdd\t";
|
|
Data64bitsDirective = "\tdq\t";
|
|
HasDotTypeDotSizeDirective = false;
|
|
HasSingleParameterDotFile = false;
|
|
|
|
AlignmentIsInBytes = true;
|
|
}
|