aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86/X86TargetAsmInfo.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-12 07:22:17 +0000
committerChris Lattner <sabre@nondot.org>2009-08-12 07:22:17 +0000
commita7ac47cee1a0b3f4c798ecaa22ecf9d1be9c07e6 (patch)
treeac43fb9b39f3a7abe8aa7cb217860e4d29329963 /lib/Target/X86/X86TargetAsmInfo.cpp
parent54d26fa799e2a43793b94afdf077fab2412e46ea (diff)
downloadexternal_llvm-a7ac47cee1a0b3f4c798ecaa22ecf9d1be9c07e6.tar.gz
external_llvm-a7ac47cee1a0b3f4c798ecaa22ecf9d1be9c07e6.tar.bz2
external_llvm-a7ac47cee1a0b3f4c798ecaa22ecf9d1be9c07e6.zip
Change TargetAsmInfo to be constructed via TargetRegistry from a Target+Triple
pair instead of from a virtual method on TargetMachine. This cuts the final ties of TargetAsmInfo to TargetMachine, meaning that MC can now use TargetAsmInfo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78802 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86TargetAsmInfo.cpp')
-rw-r--r--lib/Target/X86/X86TargetAsmInfo.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Target/X86/X86TargetAsmInfo.cpp b/lib/Target/X86/X86TargetAsmInfo.cpp
index 859ced7728..d978eb179d 100644
--- a/lib/Target/X86/X86TargetAsmInfo.cpp
+++ b/lib/Target/X86/X86TargetAsmInfo.cpp
@@ -13,6 +13,7 @@
#include "X86TargetAsmInfo.h"
#include "X86TargetMachine.h"
+#include "llvm/ADT/Triple.h"
#include "llvm/Support/CommandLine.h"
using namespace llvm;
@@ -42,12 +43,11 @@ static const char *const x86_asm_table[] = {
"{cc}", "cc",
0,0};
-X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM) {
+X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const Triple &Triple) {
AsmTransCBE = x86_asm_table;
AssemblerDialect = AsmWriterFlavor;
- const X86Subtarget *Subtarget = &TM.getSubtarget<X86Subtarget>();
- bool is64Bit = Subtarget->is64Bit();
+ bool is64Bit = Triple.getArch() == Triple::x86_64;
TextAlignFillValue = 0x90;
@@ -55,7 +55,7 @@ X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM) {
Data64bitsDirective = 0; // we can't emit a 64-bit unit
// Leopard and above support aligned common symbols.
- COMMDirectiveTakesAlignment = (Subtarget->getDarwinVers() >= 9);
+ COMMDirectiveTakesAlignment = Triple.getDarwinMajorNumber() >= 9;
if (is64Bit) {
PersonalityPrefix = "";
@@ -76,7 +76,7 @@ X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const X86TargetMachine &TM) {
AbsoluteEHSectionOffsets = false;
}
-X86ELFTargetAsmInfo::X86ELFTargetAsmInfo(const X86TargetMachine &TM) {
+X86ELFTargetAsmInfo::X86ELFTargetAsmInfo(const Triple &Triple) {
AsmTransCBE = x86_asm_table;
AssemblerDialect = AsmWriterFlavor;
@@ -97,17 +97,17 @@ X86ELFTargetAsmInfo::X86ELFTargetAsmInfo(const X86TargetMachine &TM) {
AbsoluteEHSectionOffsets = false;
// On Linux we must declare when we can use a non-executable stack.
- if (TM.getSubtarget<X86Subtarget>().isLinux())
+ if (Triple.getOS() == Triple::Linux)
NonexecutableStackDirective = "\t.section\t.note.GNU-stack,\"\",@progbits";
}
-X86COFFTargetAsmInfo::X86COFFTargetAsmInfo(const X86TargetMachine &TM) {
+X86COFFTargetAsmInfo::X86COFFTargetAsmInfo(const Triple &Triple) {
AsmTransCBE = x86_asm_table;
AssemblerDialect = AsmWriterFlavor;
}
-X86WinTargetAsmInfo::X86WinTargetAsmInfo(const X86TargetMachine &TM) {
+X86WinTargetAsmInfo::X86WinTargetAsmInfo(const Triple &Triple) {
AsmTransCBE = x86_asm_table;
AssemblerDialect = AsmWriterFlavor;