llvm.org GIT mirror llvm / b2d3169
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 Chris Lattner 10 years ago
10 changed file(s) with 32 addition(s) and 28 deletion(s). Raw diff Collapse all Expand all
1919 namespace llvm {
2020 class GlobalValue;
2121 class GlobalVariable;
22 class Triple;
2223 class Type;
2324 class Mangler;
2425
2526 struct DarwinTargetAsmInfo : public TargetAsmInfo {
26 explicit DarwinTargetAsmInfo();
27 explicit DarwinTargetAsmInfo(const Triple &Triple);
2728 };
2829 }
2930
3939 0,0
4040 };
4141
42 ARMDarwinTargetAsmInfo::ARMDarwinTargetAsmInfo() {
42 ARMDarwinTargetAsmInfo::ARMDarwinTargetAsmInfo(const Triple &Triple)
43 : DarwinTargetAsmInfo(Triple) {
4344 AsmTransCBE = arm_asm_table;
4445 Data64bitsDirective = 0;
4546 CommentString = "@";
1818 namespace llvm {
1919
2020 struct ARMDarwinTargetAsmInfo : public DarwinTargetAsmInfo {
21 explicit ARMDarwinTargetAsmInfo();
21 explicit ARMDarwinTargetAsmInfo(const Triple &Triple);
2222 };
2323
2424 struct ARMELFTargetAsmInfo : public TargetAsmInfo {
3131 Triple TheTriple(TT);
3232 switch (TheTriple.getOS()) {
3333 case Triple::Darwin:
34 return new ARMDarwinTargetAsmInfo();
34 return new ARMDarwinTargetAsmInfo(TheTriple);
3535 default:
3636 return new ARMELFTargetAsmInfo();
3737 }
1212 //===----------------------------------------------------------------------===//
1313
1414 #include "llvm/Target/DarwinTargetAsmInfo.h"
15 #include "llvm/ADT/Triple.h"
1516 using namespace llvm;
1617
17 DarwinTargetAsmInfo::DarwinTargetAsmInfo() {
18 DarwinTargetAsmInfo::DarwinTargetAsmInfo(const Triple &Triple) {
1819 // Common settings for all Darwin targets.
1920 // Syntax:
2021 GlobalPrefix = "_";
4647 HasDotTypeDotSizeDirective = false;
4748 UsedDirective = "\t.no_dead_strip\t";
4849
49 // _foo.eh symbols are currently always exported so that the linker knows
50 // about them. This is not necessary on 10.6 and later, but it
51 // doesn't hurt anything.
52 // FIXME: I need to get this from Triple.
53 Is_EHSymbolPrivate = false;
50 // On Leoaprd (10.5 aka darwin9) and earlier, _foo.eh symbols must be exported
51 // so that the linker knows about them. This is not necessary on 10.6 and
52 // later, but it doesn't hurt anything.
53 if (Triple.getDarwinMajorNumber() >= 10)
54 Is_EHSymbolPrivate = false;
55
56 // Leopard (10.5 aka darwin9) and later support aligned common symbols.
57 COMMDirectiveTakesAlignment = Triple.getDarwinMajorNumber() >= 9;
58
5459 GlobalEHDirective = "\t.globl\t";
5560 SupportsWeakOmittedEHFrame = false;
56
5761 }
5862
1111 //===----------------------------------------------------------------------===//
1212
1313 #include "PPCTargetAsmInfo.h"
14 #include "llvm/ADT/Triple.h"
1415 using namespace llvm;
1516
16 PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(bool is64Bit) {
17 PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const Triple &TheTriple)
18 : DarwinTargetAsmInfo(TheTriple) {
1719 PCSymbol = ".";
1820 CommentString = ";";
1921 ExceptionsType = ExceptionHandling::Dwarf;
2022
21 if (!is64Bit)
23 if (TheTriple.getArch() != Triple::ppc64)
2224 Data64bitsDirective = 0; // We can't emit a 64-bit unit in PPC32 mode.
2325 AssemblerDialect = 1; // New-Style mnemonics.
2426 }
2527
26 PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(bool is64Bit) {
28 PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const Triple &TheTriple) {
2729 CommentString = "#";
2830 GlobalPrefix = "";
2931 PrivateGlobalPrefix = ".L";
4042 HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
4143
4244 // Exceptions handling
43 if (!is64Bit)
45 if (TheTriple.getArch() != Triple::ppc64) {
4446 ExceptionsType = ExceptionHandling::Dwarf;
47 Data64bitsDirective = 0;
48 }
4549 AbsoluteEHSectionOffsets = false;
4650
4751 ZeroDirective = "\t.space\t";
4852 SetDirective = "\t.set";
49 Data64bitsDirective = is64Bit ? "\t.quad\t" : 0;
53
5054 AlignmentIsInBytes = false;
5155 LCOMMDirective = "\t.lcomm\t";
5256 AssemblerDialect = 0; // Old-Style mnemonics.
1313 #ifndef PPCTARGETASMINFO_H
1414 #define PPCTARGETASMINFO_H
1515
16 #include "llvm/Target/TargetAsmInfo.h"
1716 #include "llvm/Target/DarwinTargetAsmInfo.h"
1817
1918 namespace llvm {
2019
2120 struct PPCDarwinTargetAsmInfo : public DarwinTargetAsmInfo {
22 explicit PPCDarwinTargetAsmInfo(bool is64Bit);
21 explicit PPCDarwinTargetAsmInfo(const Triple &TheTriple);
2322 };
2423
2524 struct PPCLinuxTargetAsmInfo : public TargetAsmInfo {
26 explicit PPCLinuxTargetAsmInfo(bool is64Bit);
25 explicit PPCLinuxTargetAsmInfo(const Triple &TheTriple);
2726 };
2827
2928 } // namespace llvm
2222 static const TargetAsmInfo *createTargetAsmInfo(const Target &T,
2323 const StringRef &TT) {
2424 Triple TheTriple(TT);
25 bool isPPC64 = TheTriple.getArch() == Triple::ppc64;
2625 if (TheTriple.getOS() == Triple::Darwin)
27 return new PPCDarwinTargetAsmInfo(isPPC64);
28 return new PPCLinuxTargetAsmInfo(isPPC64);
26 return new PPCDarwinTargetAsmInfo(TheTriple);
27 return new PPCLinuxTargetAsmInfo(TheTriple);
2928
3029 }
3130
4242 "{cc}", "cc",
4343 0,0};
4444
45 X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const Triple &Triple) {
45 X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const Triple &Triple)
46 : DarwinTargetAsmInfo(Triple) {
4647 AsmTransCBE = x86_asm_table;
4748 AssemblerDialect = AsmWriterFlavor;
4849
5253
5354 if (!is64Bit)
5455 Data64bitsDirective = 0; // we can't emit a 64-bit unit
55
56 // Leopard and above support aligned common symbols.
57 COMMDirectiveTakesAlignment = Triple.getDarwinMajorNumber() >= 9;
5856
5957 if (is64Bit) {
6058 PersonalityPrefix = "";
1818 #include "llvm/Target/DarwinTargetAsmInfo.h"
1919
2020 namespace llvm {
21 class Triple;
22
2321 struct X86DarwinTargetAsmInfo : public DarwinTargetAsmInfo {
2422 explicit X86DarwinTargetAsmInfo(const Triple &Triple);
2523 };