llvm.org GIT mirror llvm / b42dad4
Revert 78892 and 78895, these break generating working executables on x86_64-apple-darwin10. --- Reverse-merging r78895 into '.': U test/CodeGen/PowerPC/2008-12-12-EH.ll U lib/Target/DarwinTargetAsmInfo.cpp --- Reverse-merging r78892 into '.': U include/llvm/Target/DarwinTargetAsmInfo.h U lib/Target/X86/X86TargetAsmInfo.cpp U lib/Target/X86/X86TargetAsmInfo.h U lib/Target/ARM/ARMTargetAsmInfo.h U lib/Target/ARM/ARMTargetMachine.cpp U lib/Target/ARM/ARMTargetAsmInfo.cpp U lib/Target/PowerPC/PPCTargetAsmInfo.cpp U lib/Target/PowerPC/PPCTargetAsmInfo.h U lib/Target/PowerPC/PPCTargetMachine.cpp G lib/Target/DarwinTargetAsmInfo.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78919 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 10 years ago
11 changed file(s) with 28 addition(s) and 33 deletion(s). Raw diff Collapse all Expand all
1919 namespace llvm {
2020 class GlobalValue;
2121 class GlobalVariable;
22 class Triple;
2322 class Type;
2423 class Mangler;
2524
2625 struct DarwinTargetAsmInfo : public TargetAsmInfo {
27 explicit DarwinTargetAsmInfo(const Triple &Triple);
26 explicit DarwinTargetAsmInfo();
2827 };
2928 }
3029
3939 0,0
4040 };
4141
42 ARMDarwinTargetAsmInfo::ARMDarwinTargetAsmInfo(const Triple &Triple)
43 : DarwinTargetAsmInfo(Triple) {
42 ARMDarwinTargetAsmInfo::ARMDarwinTargetAsmInfo() {
4443 AsmTransCBE = arm_asm_table;
4544 Data64bitsDirective = 0;
4645 CommentString = "@";
1818 namespace llvm {
1919
2020 struct ARMDarwinTargetAsmInfo : public DarwinTargetAsmInfo {
21 explicit ARMDarwinTargetAsmInfo(const Triple &Triple);
21 explicit ARMDarwinTargetAsmInfo();
2222 };
2323
2424 struct ARMELFTargetAsmInfo : public TargetAsmInfo {
3131 Triple TheTriple(TT);
3232 switch (TheTriple.getOS()) {
3333 case Triple::Darwin:
34 return new ARMDarwinTargetAsmInfo(TheTriple);
34 return new ARMDarwinTargetAsmInfo();
3535 default:
3636 return new ARMELFTargetAsmInfo();
3737 }
1212 //===----------------------------------------------------------------------===//
1313
1414 #include "llvm/Target/DarwinTargetAsmInfo.h"
15 #include "llvm/ADT/Triple.h"
1615 using namespace llvm;
1716
18 DarwinTargetAsmInfo::DarwinTargetAsmInfo(const Triple &Triple) {
17 DarwinTargetAsmInfo::DarwinTargetAsmInfo() {
1918 // Common settings for all Darwin targets.
2019 // Syntax:
2120 GlobalPrefix = "_";
4746 HasDotTypeDotSizeDirective = false;
4847 UsedDirective = "\t.no_dead_strip\t";
4948
50 // On Leopard (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
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;
5954 GlobalEHDirective = "\t.globl\t";
6055 SupportsWeakOmittedEHFrame = false;
56
6157 }
6258
1111 //===----------------------------------------------------------------------===//
1212
1313 #include "PPCTargetAsmInfo.h"
14 #include "llvm/ADT/Triple.h"
1514 using namespace llvm;
1615
17 PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const Triple &TheTriple)
18 : DarwinTargetAsmInfo(TheTriple) {
16 PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(bool is64Bit) {
1917 PCSymbol = ".";
2018 CommentString = ";";
2119 ExceptionsType = ExceptionHandling::Dwarf;
2220
23 if (TheTriple.getArch() != Triple::ppc64)
21 if (!is64Bit)
2422 Data64bitsDirective = 0; // We can't emit a 64-bit unit in PPC32 mode.
2523 AssemblerDialect = 1; // New-Style mnemonics.
2624 }
2725
28 PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const Triple &TheTriple) {
26 PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(bool is64Bit) {
2927 CommentString = "#";
3028 GlobalPrefix = "";
3129 PrivateGlobalPrefix = ".L";
4240 HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
4341
4442 // Exceptions handling
45 if (TheTriple.getArch() != Triple::ppc64) {
43 if (!is64Bit)
4644 ExceptionsType = ExceptionHandling::Dwarf;
47 Data64bitsDirective = 0;
48 }
4945 AbsoluteEHSectionOffsets = false;
5046
5147 ZeroDirective = "\t.space\t";
5248 SetDirective = "\t.set";
53
49 Data64bitsDirective = is64Bit ? "\t.quad\t" : 0;
5450 AlignmentIsInBytes = false;
5551 LCOMMDirective = "\t.lcomm\t";
5652 AssemblerDialect = 0; // Old-Style mnemonics.
1313 #ifndef PPCTARGETASMINFO_H
1414 #define PPCTARGETASMINFO_H
1515
16 #include "llvm/Target/TargetAsmInfo.h"
1617 #include "llvm/Target/DarwinTargetAsmInfo.h"
1718
1819 namespace llvm {
1920
2021 struct PPCDarwinTargetAsmInfo : public DarwinTargetAsmInfo {
21 explicit PPCDarwinTargetAsmInfo(const Triple &TheTriple);
22 explicit PPCDarwinTargetAsmInfo(bool is64Bit);
2223 };
2324
2425 struct PPCLinuxTargetAsmInfo : public TargetAsmInfo {
25 explicit PPCLinuxTargetAsmInfo(const Triple &TheTriple);
26 explicit PPCLinuxTargetAsmInfo(bool is64Bit);
2627 };
2728
2829 } // 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;
2526 if (TheTriple.getOS() == Triple::Darwin)
26 return new PPCDarwinTargetAsmInfo(TheTriple);
27 return new PPCLinuxTargetAsmInfo(TheTriple);
27 return new PPCDarwinTargetAsmInfo(isPPC64);
28 return new PPCLinuxTargetAsmInfo(isPPC64);
2829
2930 }
3031
4242 "{cc}", "cc",
4343 0,0};
4444
45 X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const Triple &Triple)
46 : DarwinTargetAsmInfo(Triple) {
45 X86DarwinTargetAsmInfo::X86DarwinTargetAsmInfo(const Triple &Triple) {
4746 AsmTransCBE = x86_asm_table;
4847 AssemblerDialect = AsmWriterFlavor;
4948
5352
5453 if (!is64Bit)
5554 Data64bitsDirective = 0; // we can't emit a 64-bit unit
55
56 // Leopard and above support aligned common symbols.
57 COMMDirectiveTakesAlignment = Triple.getDarwinMajorNumber() >= 9;
5658
5759 if (is64Bit) {
5860 PersonalityPrefix = "";
1818 #include "llvm/Target/DarwinTargetAsmInfo.h"
1919
2020 namespace llvm {
21 class Triple;
22
2123 struct X86DarwinTargetAsmInfo : public DarwinTargetAsmInfo {
2224 explicit X86DarwinTargetAsmInfo(const Triple &Triple);
2325 };
0 ; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-unknown-linux-gnu | grep ^.L_Z1fv.eh
11 ; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin9 | grep ^__Z1fv.eh
2 ; RUN: llvm-as < %s | llc -march=ppc32 -mtriple=powerpc-apple-darwin10 | grep ^L__Z1fv.eh
32
43 define void @_Z1fv() {
54 entry: