[llvm-commits] [llvm] r78892 - in /llvm/trunk: 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
Chris Lattner
sabre at nondot.org
Wed Aug 12 22:30:25 PDT 2009
Author: lattner
Date: Thu Aug 13 00:30:22 2009
New Revision: 78892
URL: http://llvm.org/viewvc/llvm-project?rev=78892&view=rev
Log:
fix a minor fixme. When building with SL and later tools, the ".eh" symbols
don't need to be exported from the .o files.
Modified:
llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h
llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp
llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.h
llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp
llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp
llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.h
llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp
llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h
Modified: llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h?rev=78892&r1=78891&r2=78892&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h (original)
+++ llvm/trunk/include/llvm/Target/DarwinTargetAsmInfo.h Thu Aug 13 00:30:22 2009
@@ -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);
};
}
Modified: llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp?rev=78892&r1=78891&r2=78892&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp Thu Aug 13 00:30:22 2009
@@ -40,7 +40,8 @@
0,0
};
-ARMDarwinTargetAsmInfo::ARMDarwinTargetAsmInfo() {
+ARMDarwinTargetAsmInfo::ARMDarwinTargetAsmInfo(const Triple &Triple)
+ : DarwinTargetAsmInfo(Triple) {
AsmTransCBE = arm_asm_table;
Data64bitsDirective = 0;
CommentString = "@";
Modified: llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.h?rev=78892&r1=78891&r2=78892&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.h (original)
+++ llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.h Thu Aug 13 00:30:22 2009
@@ -19,7 +19,7 @@
namespace llvm {
struct ARMDarwinTargetAsmInfo : public DarwinTargetAsmInfo {
- explicit ARMDarwinTargetAsmInfo();
+ explicit ARMDarwinTargetAsmInfo(const Triple &Triple);
};
struct ARMELFTargetAsmInfo : public TargetAsmInfo {
Modified: llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp?rev=78892&r1=78891&r2=78892&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMTargetMachine.cpp Thu Aug 13 00:30:22 2009
@@ -32,7 +32,7 @@
Triple TheTriple(TT);
switch (TheTriple.getOS()) {
case Triple::Darwin:
- return new ARMDarwinTargetAsmInfo();
+ return new ARMDarwinTargetAsmInfo(TheTriple);
default:
return new ARMELFTargetAsmInfo();
}
Modified: llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp?rev=78892&r1=78891&r2=78892&view=diff
==============================================================================
--- llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp Thu Aug 13 00:30:22 2009
@@ -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 @@
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;
-
}
Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp?rev=78892&r1=78891&r2=78892&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp Thu Aug 13 00:30:22 2009
@@ -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 @@
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.
Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.h?rev=78892&r1=78891&r2=78892&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.h (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.h Thu Aug 13 00:30:22 2009
@@ -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
Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp?rev=78892&r1=78891&r2=78892&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCTargetMachine.cpp Thu Aug 13 00:30:22 2009
@@ -23,10 +23,9 @@
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);
}
Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp?rev=78892&r1=78891&r2=78892&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Thu Aug 13 00:30:22 2009
@@ -43,7 +43,8 @@
"{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 @@
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 at GOTPCREL";
Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h?rev=78892&r1=78891&r2=78892&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h (original)
+++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.h Thu Aug 13 00:30:22 2009
@@ -19,8 +19,6 @@
#include "llvm/Target/DarwinTargetAsmInfo.h"
namespace llvm {
- class Triple;
-
struct X86DarwinTargetAsmInfo : public DarwinTargetAsmInfo {
explicit X86DarwinTargetAsmInfo(const Triple &Triple);
};
More information about the llvm-commits
mailing list