don't need to be exported from the .o files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78892
91177308-0d34-0410-b5e6-
96231b3b80d8
namespace llvm {
class GlobalValue;
class GlobalVariable;
namespace llvm {
class GlobalValue;
class GlobalVariable;
class Type;
class Mangler;
struct DarwinTargetAsmInfo : public TargetAsmInfo {
class Type;
class Mangler;
struct DarwinTargetAsmInfo : public TargetAsmInfo {
- explicit DarwinTargetAsmInfo();
+ explicit DarwinTargetAsmInfo(const Triple &Triple);
-ARMDarwinTargetAsmInfo::ARMDarwinTargetAsmInfo() {
+ARMDarwinTargetAsmInfo::ARMDarwinTargetAsmInfo(const Triple &Triple)
+ : DarwinTargetAsmInfo(Triple) {
AsmTransCBE = arm_asm_table;
Data64bitsDirective = 0;
CommentString = "@";
AsmTransCBE = arm_asm_table;
Data64bitsDirective = 0;
CommentString = "@";
namespace llvm {
struct ARMDarwinTargetAsmInfo : public DarwinTargetAsmInfo {
namespace llvm {
struct ARMDarwinTargetAsmInfo : public DarwinTargetAsmInfo {
- explicit ARMDarwinTargetAsmInfo();
+ explicit ARMDarwinTargetAsmInfo(const Triple &Triple);
};
struct ARMELFTargetAsmInfo : public TargetAsmInfo {
};
struct ARMELFTargetAsmInfo : public TargetAsmInfo {
Triple TheTriple(TT);
switch (TheTriple.getOS()) {
case Triple::Darwin:
Triple TheTriple(TT);
switch (TheTriple.getOS()) {
case Triple::Darwin:
- return new ARMDarwinTargetAsmInfo();
+ return new ARMDarwinTargetAsmInfo(TheTriple);
default:
return new ARMELFTargetAsmInfo();
}
default:
return new ARMELFTargetAsmInfo();
}
//===----------------------------------------------------------------------===//
#include "llvm/Target/DarwinTargetAsmInfo.h"
//===----------------------------------------------------------------------===//
#include "llvm/Target/DarwinTargetAsmInfo.h"
+#include "llvm/ADT/Triple.h"
-DarwinTargetAsmInfo::DarwinTargetAsmInfo() {
+DarwinTargetAsmInfo::DarwinTargetAsmInfo(const Triple &Triple) {
// Common settings for all Darwin targets.
// Syntax:
GlobalPrefix = "_";
// Common settings for all Darwin targets.
// Syntax:
GlobalPrefix = "_";
HasDotTypeDotSizeDirective = false;
UsedDirective = "\t.no_dead_strip\t";
HasDotTypeDotSizeDirective = false;
UsedDirective = "\t.no_dead_strip\t";
- // _foo.eh symbols are currently always exported so that the linker knows
- // about them. This is not necessary on 10.6 and later, but it
- // doesn't hurt anything.
- // FIXME: I need to get this from Triple.
- Is_EHSymbolPrivate = false;
+ // On Leoaprd (10.5 aka darwin9) and earlier, _foo.eh symbols must be exported
+ // so that the linker knows about them. This is not necessary on 10.6 and
+ // later, but it doesn't hurt anything.
+ if (Triple.getDarwinMajorNumber() >= 10)
+ Is_EHSymbolPrivate = false;
+
+ // Leopard (10.5 aka darwin9) and later support aligned common symbols.
+ COMMDirectiveTakesAlignment = Triple.getDarwinMajorNumber() >= 9;
+
GlobalEHDirective = "\t.globl\t";
SupportsWeakOmittedEHFrame = false;
GlobalEHDirective = "\t.globl\t";
SupportsWeakOmittedEHFrame = false;
//===----------------------------------------------------------------------===//
#include "PPCTargetAsmInfo.h"
//===----------------------------------------------------------------------===//
#include "PPCTargetAsmInfo.h"
+#include "llvm/ADT/Triple.h"
-PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(bool is64Bit) {
+PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const Triple &TheTriple)
+ : DarwinTargetAsmInfo(TheTriple) {
PCSymbol = ".";
CommentString = ";";
ExceptionsType = ExceptionHandling::Dwarf;
PCSymbol = ".";
CommentString = ";";
ExceptionsType = ExceptionHandling::Dwarf;
+ if (TheTriple.getArch() != Triple::ppc64)
Data64bitsDirective = 0; // We can't emit a 64-bit unit in PPC32 mode.
AssemblerDialect = 1; // New-Style mnemonics.
}
Data64bitsDirective = 0; // We can't emit a 64-bit unit in PPC32 mode.
AssemblerDialect = 1; // New-Style mnemonics.
}
-PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(bool is64Bit) {
+PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const Triple &TheTriple) {
CommentString = "#";
GlobalPrefix = "";
PrivateGlobalPrefix = ".L";
CommentString = "#";
GlobalPrefix = "";
PrivateGlobalPrefix = ".L";
HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
// Exceptions handling
HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
// Exceptions handling
+ if (TheTriple.getArch() != Triple::ppc64) {
ExceptionsType = ExceptionHandling::Dwarf;
ExceptionsType = ExceptionHandling::Dwarf;
+ Data64bitsDirective = 0;
+ }
AbsoluteEHSectionOffsets = false;
ZeroDirective = "\t.space\t";
SetDirective = "\t.set";
AbsoluteEHSectionOffsets = false;
ZeroDirective = "\t.space\t";
SetDirective = "\t.set";
- Data64bitsDirective = is64Bit ? "\t.quad\t" : 0;
AlignmentIsInBytes = false;
LCOMMDirective = "\t.lcomm\t";
AssemblerDialect = 0; // Old-Style mnemonics.
AlignmentIsInBytes = false;
LCOMMDirective = "\t.lcomm\t";
AssemblerDialect = 0; // Old-Style mnemonics.
#ifndef PPCTARGETASMINFO_H
#define PPCTARGETASMINFO_H
#ifndef PPCTARGETASMINFO_H
#define PPCTARGETASMINFO_H
-#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/DarwinTargetAsmInfo.h"
namespace llvm {
struct PPCDarwinTargetAsmInfo : public DarwinTargetAsmInfo {
#include "llvm/Target/DarwinTargetAsmInfo.h"
namespace llvm {
struct PPCDarwinTargetAsmInfo : public DarwinTargetAsmInfo {
- explicit PPCDarwinTargetAsmInfo(bool is64Bit);
+ explicit PPCDarwinTargetAsmInfo(const Triple &TheTriple);
};
struct PPCLinuxTargetAsmInfo : public TargetAsmInfo {
};
struct PPCLinuxTargetAsmInfo : public TargetAsmInfo {
- explicit PPCLinuxTargetAsmInfo(bool is64Bit);
+ explicit PPCLinuxTargetAsmInfo(const Triple &TheTriple);
static const TargetAsmInfo *createTargetAsmInfo(const Target &T,
const StringRef &TT) {
Triple TheTriple(TT);
static const TargetAsmInfo *createTargetAsmInfo(const Target &T,
const StringRef &TT) {
Triple TheTriple(TT);
- bool isPPC64 = TheTriple.getArch() == Triple::ppc64;
if (TheTriple.getOS() == Triple::Darwin)
if (TheTriple.getOS() == Triple::Darwin)
- return new PPCDarwinTargetAsmInfo(isPPC64);
- return new PPCLinuxTargetAsmInfo(isPPC64);
+ return new PPCDarwinTargetAsmInfo(TheTriple);
+ return new PPCLinuxTargetAsmInfo(TheTriple);
-X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const Triple &Triple) {
+X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const Triple &Triple)
+ : DarwinTargetAsmInfo(Triple) {
AsmTransCBE = x86_asm_table;
AssemblerDialect = AsmWriterFlavor;
AsmTransCBE = x86_asm_table;
AssemblerDialect = AsmWriterFlavor;
if (!is64Bit)
Data64bitsDirective = 0; // we can't emit a 64-bit unit
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";
if (is64Bit) {
PersonalityPrefix = "";
PersonalitySuffix = "+4@GOTPCREL";
#include "llvm/Target/DarwinTargetAsmInfo.h"
namespace llvm {
#include "llvm/Target/DarwinTargetAsmInfo.h"
namespace llvm {
struct X86DarwinTargetAsmInfo : public DarwinTargetAsmInfo {
explicit X86DarwinTargetAsmInfo(const Triple &Triple);
};
struct X86DarwinTargetAsmInfo : public DarwinTargetAsmInfo {
explicit X86DarwinTargetAsmInfo(const Triple &Triple);
};