aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-08-13 05:30:22 +0000
committerChris Lattner <sabre@nondot.org>2009-08-13 05:30:22 +0000
commitb2d3169d96ee780e6b8f43230e36e41d97ed3140 (patch)
tree3d2eb4e18adac3e51f6d742691da1f4a7865d429
parent7c4efa6808b737b2bfc7c79872b9c16f566a7d8a (diff)
fix a minor fixme. When building with SL and later tools, the ".eh" symbols
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
-rw-r--r--include/llvm/Target/DarwinTargetAsmInfo.h3
-rw-r--r--lib/Target/ARM/ARMTargetAsmInfo.cpp3
-rw-r--r--lib/Target/ARM/ARMTargetAsmInfo.h2
-rw-r--r--lib/Target/ARM/ARMTargetMachine.cpp2
-rw-r--r--lib/Target/DarwinTargetAsmInfo.cpp18
-rw-r--r--lib/Target/PowerPC/PPCTargetAsmInfo.cpp14
-rw-r--r--lib/Target/PowerPC/PPCTargetAsmInfo.h5
-rw-r--r--lib/Target/PowerPC/PPCTargetMachine.cpp5
-rw-r--r--lib/Target/X86/X86TargetAsmInfo.cpp6
-rw-r--r--lib/Target/X86/X86TargetAsmInfo.h2
10 files changed, 32 insertions, 28 deletions
diff --git a/include/llvm/Target/DarwinTargetAsmInfo.h b/include/llvm/Target/DarwinTargetAsmInfo.h
index 0834390600..2b5bf7c931 100644
--- a/include/llvm/Target/DarwinTargetAsmInfo.h
+++ b/include/llvm/Target/DarwinTargetAsmInfo.h
@@ -20,11 +20,12 @@
namespace llvm {
class GlobalValue;
class GlobalVariable;
+ class Triple;
class Type;
class Mangler;
struct DarwinTargetAsmInfo : public TargetAsmInfo {
- explicit DarwinTargetAsmInfo();
+ explicit DarwinTargetAsmInfo(const Triple &Triple);
};
}
diff --git a/lib/Target/ARM/ARMTargetAsmInfo.cpp b/lib/Target/ARM/ARMTargetAsmInfo.cpp
index 0c3df82bfe..b3aa3bd9d5 100644
--- a/lib/Target/ARM/ARMTargetAsmInfo.cpp
+++ b/lib/Target/ARM/ARMTargetAsmInfo.cpp
@@ -40,7 +40,8 @@ static const char *const arm_asm_table[] = {
0,0
};
-ARMDarwinTargetAsmInfo::ARMDarwinTargetAsmInfo() {
+ARMDarwinTargetAsmInfo::ARMDarwinTargetAsmInfo(const Triple &Triple)
+ : DarwinTargetAsmInfo(Triple) {
AsmTransCBE = arm_asm_table;
Data64bitsDirective = 0;
CommentString = "@";
diff --git a/lib/Target/ARM/ARMTargetAsmInfo.h b/lib/Target/ARM/ARMTargetAsmInfo.h
index 3fde8ba630..745f3c6cea 100644
--- a/lib/Target/ARM/ARMTargetAsmInfo.h
+++ b/lib/Target/ARM/ARMTargetAsmInfo.h
@@ -19,7 +19,7 @@
namespace llvm {
struct ARMDarwinTargetAsmInfo : public DarwinTargetAsmInfo {
- explicit ARMDarwinTargetAsmInfo();
+ explicit ARMDarwinTargetAsmInfo(const Triple &Triple);
};
struct ARMELFTargetAsmInfo : public TargetAsmInfo {
diff --git a/lib/Target/ARM/ARMTargetMachine.cpp b/lib/Target/ARM/ARMTargetMachine.cpp
index fbc5f38efe..1198aa94b5 100644
--- a/lib/Target/ARM/ARMTargetMachine.cpp
+++ b/lib/Target/ARM/ARMTargetMachine.cpp
@@ -32,7 +32,7 @@ static const TargetAsmInfo *createTargetAsmInfo(const Target &T,
Triple TheTriple(TT);
switch (TheTriple.getOS()) {
case Triple::Darwin:
- return new ARMDarwinTargetAsmInfo();
+ return new ARMDarwinTargetAsmInfo(TheTriple);
default:
return new ARMELFTargetAsmInfo();
}
diff --git a/lib/Target/DarwinTargetAsmInfo.cpp b/lib/Target/DarwinTargetAsmInfo.cpp
index c37b41b700..a37bf18a97 100644
--- a/lib/Target/DarwinTargetAsmInfo.cpp
+++ b/lib/Target/DarwinTargetAsmInfo.cpp
@@ -13,9 +13,10 @@
//===----------------------------------------------------------------------===//
#include "llvm/Target/DarwinTargetAsmInfo.h"
+#include "llvm/ADT/Triple.h"
using namespace llvm;
-DarwinTargetAsmInfo::DarwinTargetAsmInfo() {
+DarwinTargetAsmInfo::DarwinTargetAsmInfo(const Triple &Triple) {
// Common settings for all Darwin targets.
// Syntax:
GlobalPrefix = "_";
@@ -47,13 +48,16 @@ DarwinTargetAsmInfo::DarwinTargetAsmInfo() {
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;
-
}
diff --git a/lib/Target/PowerPC/PPCTargetAsmInfo.cpp b/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
index 36cf2a5570..25920da0fe 100644
--- a/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
+++ b/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
@@ -12,19 +12,21 @@
//===----------------------------------------------------------------------===//
#include "PPCTargetAsmInfo.h"
+#include "llvm/ADT/Triple.h"
using namespace llvm;
-PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(bool is64Bit) {
+PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const Triple &TheTriple)
+ : DarwinTargetAsmInfo(TheTriple) {
PCSymbol = ".";
CommentString = ";";
ExceptionsType = ExceptionHandling::Dwarf;
- if (!is64Bit)
+ if (TheTriple.getArch() != Triple::ppc64)
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";
@@ -41,13 +43,15 @@ PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(bool is64Bit) {
HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
// Exceptions handling
- if (!is64Bit)
+ if (TheTriple.getArch() != Triple::ppc64) {
ExceptionsType = ExceptionHandling::Dwarf;
+ Data64bitsDirective = 0;
+ }
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.
diff --git a/lib/Target/PowerPC/PPCTargetAsmInfo.h b/lib/Target/PowerPC/PPCTargetAsmInfo.h
index c7f8862e7f..1e7e3d3745 100644
--- a/lib/Target/PowerPC/PPCTargetAsmInfo.h
+++ b/lib/Target/PowerPC/PPCTargetAsmInfo.h
@@ -14,17 +14,16 @@
#ifndef PPCTARGETASMINFO_H
#define PPCTARGETASMINFO_H
-#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/DarwinTargetAsmInfo.h"
namespace llvm {
struct PPCDarwinTargetAsmInfo : public DarwinTargetAsmInfo {
- explicit PPCDarwinTargetAsmInfo(bool is64Bit);
+ explicit PPCDarwinTargetAsmInfo(const Triple &TheTriple);
};
struct PPCLinuxTargetAsmInfo : public TargetAsmInfo {
- explicit PPCLinuxTargetAsmInfo(bool is64Bit);
+ explicit PPCLinuxTargetAsmInfo(const Triple &TheTriple);
};
} // namespace llvm
diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp
index 41f4699fc0..a0d4fdb776 100644
--- a/lib/Target/PowerPC/PPCTargetMachine.cpp
+++ b/lib/Target/PowerPC/PPCTargetMachine.cpp
@@ -23,10 +23,9 @@ using namespace llvm;
static const TargetAsmInfo *createTargetAsmInfo(const Target &T,
const StringRef &TT) {
Triple TheTriple(TT);
- bool isPPC64 = TheTriple.getArch() == Triple::ppc64;
if (TheTriple.getOS() == Triple::Darwin)
- return new PPCDarwinTargetAsmInfo(isPPC64);
- return new PPCLinuxTargetAsmInfo(isPPC64);
+ return new PPCDarwinTargetAsmInfo(TheTriple);
+ return new PPCLinuxTargetAsmInfo(TheTriple);
}
diff --git a/lib/Target/X86/X86TargetAsmInfo.cpp b/lib/Target/X86/X86TargetAsmInfo.cpp
index d978eb179d..b6270108da 100644
--- a/lib/Target/X86/X86TargetAsmInfo.cpp
+++ b/lib/Target/X86/X86TargetAsmInfo.cpp
@@ -43,7 +43,8 @@ static const char *const x86_asm_table[] = {
"{cc}", "cc",
0,0};
-X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const Triple &Triple) {
+X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const Triple &Triple)
+ : DarwinTargetAsmInfo(Triple) {
AsmTransCBE = x86_asm_table;
AssemblerDialect = AsmWriterFlavor;
@@ -54,9 +55,6 @@ X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const Triple &Triple) {
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";
diff --git a/lib/Target/X86/X86TargetAsmInfo.h b/lib/Target/X86/X86TargetAsmInfo.h
index 91de368259..592d5e3396 100644
--- a/lib/Target/X86/X86TargetAsmInfo.h
+++ b/lib/Target/X86/X86TargetAsmInfo.h
@@ -19,8 +19,6 @@
#include "llvm/Target/DarwinTargetAsmInfo.h"
namespace llvm {
- class Triple;
-
struct X86DarwinTargetAsmInfo : public DarwinTargetAsmInfo {
explicit X86DarwinTargetAsmInfo(const Triple &Triple);
};