fix a minor fixme. When building with SL and later tools, the ".eh" symbols
authorChris Lattner <sabre@nondot.org>
Thu, 13 Aug 2009 05:30:22 +0000 (05:30 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 13 Aug 2009 05:30:22 +0000 (05:30 +0000)
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

include/llvm/Target/DarwinTargetAsmInfo.h
lib/Target/ARM/ARMTargetAsmInfo.cpp
lib/Target/ARM/ARMTargetAsmInfo.h
lib/Target/ARM/ARMTargetMachine.cpp
lib/Target/DarwinTargetAsmInfo.cpp
lib/Target/PowerPC/PPCTargetAsmInfo.cpp
lib/Target/PowerPC/PPCTargetAsmInfo.h
lib/Target/PowerPC/PPCTargetMachine.cpp
lib/Target/X86/X86TargetAsmInfo.cpp
lib/Target/X86/X86TargetAsmInfo.h

index 0834390600f6d96c061fefeffe24f99d18551993..2b5bf7c9314911447c2ba17432c735c8742fee5b 100644 (file)
 namespace llvm {
   class GlobalValue;
   class GlobalVariable;
+  class Triple;
   class Type;
   class Mangler;
 
   struct DarwinTargetAsmInfo : public TargetAsmInfo {
-    explicit DarwinTargetAsmInfo();
+    explicit DarwinTargetAsmInfo(const Triple &Triple);
   };
 }
 
index 0c3df82bfe26f6f043aa07a37e55144c7bf1db92..b3aa3bd9d51527ea37e9059065c4e12dbbb395db 100644 (file)
@@ -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 = "@";
index 3fde8ba63078874e3edd552b0c25b073880c113b..745f3c6ceac35d6ca84be081c0345593651f36dd 100644 (file)
@@ -19,7 +19,7 @@
 namespace llvm {
 
   struct ARMDarwinTargetAsmInfo : public DarwinTargetAsmInfo {
-    explicit ARMDarwinTargetAsmInfo();
+    explicit ARMDarwinTargetAsmInfo(const Triple &Triple);
   };
 
   struct ARMELFTargetAsmInfo : public TargetAsmInfo {
index fbc5f38efea074308bb5284c496f38d53065ea00..1198aa94b56c2aca3ad53d2d2063f896d93ba204 100644 (file)
@@ -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();
   }
index c37b41b7001743c098b220d9d94e0d05749f04dc..a37bf18a97a03f47939523c65d00f3604ca24a30 100644 (file)
 //===----------------------------------------------------------------------===//
 
 #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;
-
 }
 
index 36cf2a5570ddb2f96785c850be38db0814a90a9b..25920da0fe900fc91be18489dc75569b2992017d 100644 (file)
 //===----------------------------------------------------------------------===//
 
 #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.
index c7f8862e7ff4a8a0df20756d287fb9cc757ecea1..1e7e3d3745b30d4cc8261d9cefc5ed79316e0559 100644 (file)
 #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
index 41f4699fc061d4f7cf778107fdec53e8db02a25f..a0d4fdb776b4282070d587bf2e19e7f9cb816f11 100644 (file)
@@ -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);
   
 }
 
index d978eb179de823116e5466dce0c54061b9a36f9b..b6270108da236e98b9363c14d02a1a5099153f68 100644 (file)
@@ -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";
index 91de36825910e649eb7d24f2ffdd53eb0656b514..592d5e3396d76e7eaf82ebc7cef5e70492278bfe 100644 (file)
@@ -19,8 +19,6 @@
 #include "llvm/Target/DarwinTargetAsmInfo.h"
 
 namespace llvm {
-  class Triple;
-
   struct X86DarwinTargetAsmInfo : public DarwinTargetAsmInfo {
     explicit X86DarwinTargetAsmInfo(const Triple &Triple);
   };