mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-26 21:32:10 +00:00
23ac7c78e4
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98221 91177308-0d34-0410-b5e6-96231b3b80d8
55 lines
1.4 KiB
C++
55 lines
1.4 KiB
C++
//===-- X86AsmBackend.cpp - X86 Assembler Backend -------------------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "llvm/Target/TargetAsmBackend.h"
|
|
#include "X86.h"
|
|
#include "llvm/Target/TargetRegistry.h"
|
|
#include "llvm/Target/TargetAsmBackend.h"
|
|
using namespace llvm;
|
|
|
|
namespace {
|
|
|
|
class X86AsmBackend : public TargetAsmBackend {
|
|
public:
|
|
X86AsmBackend(const Target &T)
|
|
: TargetAsmBackend(T) {}
|
|
};
|
|
|
|
class DarwinX86AsmBackend : public X86AsmBackend {
|
|
public:
|
|
DarwinX86AsmBackend(const Target &T)
|
|
: X86AsmBackend(T) {}
|
|
|
|
virtual bool hasAbsolutizedSet() const { return true; }
|
|
|
|
virtual bool hasScatteredSymbols() const { return true; }
|
|
};
|
|
|
|
}
|
|
|
|
TargetAsmBackend *llvm::createX86_32AsmBackend(const Target &T,
|
|
const std::string &TT) {
|
|
switch (Triple(TT).getOS()) {
|
|
case Triple::Darwin:
|
|
return new DarwinX86AsmBackend(T);
|
|
default:
|
|
return new X86AsmBackend(T);
|
|
}
|
|
}
|
|
|
|
TargetAsmBackend *llvm::createX86_64AsmBackend(const Target &T,
|
|
const std::string &TT) {
|
|
switch (Triple(TT).getOS()) {
|
|
case Triple::Darwin:
|
|
return new DarwinX86AsmBackend(T);
|
|
default:
|
|
return new X86AsmBackend(T);
|
|
}
|
|
}
|