[llvm-commits] [llvm] r78727 - in /llvm/trunk/lib/Target: ARM/ARMTargetAsmInfo.cpp ARM/ARMTargetAsmInfo.h DarwinTargetAsmInfo.cpp PowerPC/PPCTargetAsmInfo.cpp PowerPC/PPCTargetAsmInfo.h X86/X86TargetAsmInfo.cpp
Chris Lattner
sabre at nondot.org
Tue Aug 11 15:06:07 PDT 2009
Author: lattner
Date: Tue Aug 11 17:06:07 2009
New Revision: 78727
URL: http://llvm.org/viewvc/llvm-project?rev=78727&view=rev
Log:
move LCOMMDirective = "\t.lcomm\t" up to DarwinTAI, eliminate
template in PPC backend for TAI.
Modified:
llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp
llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.h
llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp
llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.h
llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp?rev=78727&r1=78726&r2=78727&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.cpp Tue Aug 11 17:06:07 2009
@@ -62,6 +62,8 @@
PrivateGlobalPrefix = ".L";
WeakRefDirective = "\t.weak\t";
SetDirective = "\t.set\t";
+ LCOMMDirective = "\t.lcomm\t";
+
DwarfRequiresFrameSection = false;
SupportsDebugInformation = true;
Modified: llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.h?rev=78727&r1=78726&r2=78727&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.h (original)
+++ llvm/trunk/lib/Target/ARM/ARMTargetAsmInfo.h Tue Aug 11 17:06:07 2009
@@ -32,7 +32,6 @@
BaseTAI::COMMDirectiveTakesAlignment = false;
BaseTAI::InlineAsmStart = "@ InlineAsm Start";
BaseTAI::InlineAsmEnd = "@ InlineAsm End";
- BaseTAI::LCOMMDirective = "\t.lcomm\t";
}
};
Modified: llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp?rev=78727&r1=78726&r2=78727&view=diff
==============================================================================
--- llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/DarwinTargetAsmInfo.cpp Tue Aug 11 17:06:07 2009
@@ -35,7 +35,8 @@
WeakDefDirective = "\t.weak_definition ";
WeakRefDirective = "\t.weak_reference ";
HiddenDirective = "\t.private_extern ";
-
+ LCOMMDirective = "\t.lcomm\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.
Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp?rev=78727&r1=78726&r2=78727&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.cpp Tue Aug 11 17:06:07 2009
@@ -19,8 +19,7 @@
using namespace llvm;
using namespace llvm::dwarf;
-PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM) :
- PPCTargetAsmInfo<DarwinTargetAsmInfo>(TM) {
+PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM) {
PCSymbol = ".";
CommentString = ";";
UsedDirective = "\t.no_dead_strip\t";
@@ -28,10 +27,21 @@
GlobalEHDirective = "\t.globl\t";
SupportsWeakOmittedEHFrame = false;
+
+ const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
+ bool isPPC64 = Subtarget->isPPC64();
+
+ ZeroDirective = "\t.space\t";
+ SetDirective = "\t.set";
+ Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0;
+ AlignmentIsInBytes = false;
+ LCOMMDirective = "\t.lcomm\t";
+ InlineAsmStart = "# InlineAsm Start";
+ InlineAsmEnd = "# InlineAsm End";
+ AssemblerDialect = Subtarget->getAsmFlavor();
}
-PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) :
- PPCTargetAsmInfo<TargetAsmInfo>(TM) {
+PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) {
CommentString = "#";
GlobalPrefix = "";
PrivateGlobalPrefix = ".L";
@@ -47,12 +57,21 @@
// Set up DWARF directives
HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
+ const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
+ bool isPPC64 = Subtarget->isPPC64();
+
// Exceptions handling
- if (!TM.getSubtargetImpl()->isPPC64())
+ if (!isPPC64)
ExceptionsType = ExceptionHandling::Dwarf;
AbsoluteEHSectionOffsets = false;
+
+ ZeroDirective = "\t.space\t";
+ SetDirective = "\t.set";
+ Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0;
+ AlignmentIsInBytes = false;
+ LCOMMDirective = "\t.lcomm\t";
+ InlineAsmStart = "# InlineAsm Start";
+ InlineAsmEnd = "# InlineAsm End";
+ AssemblerDialect = Subtarget->getAsmFlavor();
}
-
-// Instantiate default implementation.
-TEMPLATE_INSTANTIATION(class PPCTargetAsmInfo<TargetAsmInfo>);
Modified: llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.h?rev=78727&r1=78726&r2=78727&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.h (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCTargetAsmInfo.h Tue Aug 11 17:06:07 2009
@@ -21,32 +21,11 @@
namespace llvm {
- template <class BaseTAI>
- struct PPCTargetAsmInfo : public BaseTAI {
- explicit PPCTargetAsmInfo(const PPCTargetMachine &TM) {
- const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
- bool isPPC64 = Subtarget->isPPC64();
-
- BaseTAI::ZeroDirective = "\t.space\t";
- BaseTAI::SetDirective = "\t.set";
- BaseTAI::Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0;
- BaseTAI::AlignmentIsInBytes = false;
- BaseTAI::LCOMMDirective = "\t.lcomm\t";
- BaseTAI::InlineAsmStart = "# InlineAsm Start";
- BaseTAI::InlineAsmEnd = "# InlineAsm End";
- BaseTAI::AssemblerDialect = Subtarget->getAsmFlavor();
- }
- };
-
- typedef PPCTargetAsmInfo<TargetAsmInfo> PPCGenericTargetAsmInfo;
-
- EXTERN_TEMPLATE_INSTANTIATION(class PPCTargetAsmInfo<TargetAsmInfo>);
-
- struct PPCDarwinTargetAsmInfo : public PPCTargetAsmInfo<DarwinTargetAsmInfo> {
+ struct PPCDarwinTargetAsmInfo : public DarwinTargetAsmInfo {
explicit PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM);
};
- struct PPCLinuxTargetAsmInfo : public PPCTargetAsmInfo<TargetAsmInfo> {
+ struct PPCLinuxTargetAsmInfo : public TargetAsmInfo {
explicit PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM);
};
Modified: llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp?rev=78727&r1=78726&r2=78727&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86TargetAsmInfo.cpp Tue Aug 11 17:06:07 2009
@@ -48,12 +48,10 @@
AlignmentIsInBytes = false;
TextAlignFillValue = 0x90;
-
if (!is64Bit)
Data64bitsDirective = 0; // we can't emit a 64-bit unit
ZeroDirective = "\t.space\t"; // ".space N" emits N zeros.
ZeroFillDirective = "\t.zerofill\t"; // Uses .zerofill
- LCOMMDirective = "\t.lcomm\t";
// Leopard and above support aligned common symbols.
COMMDirectiveTakesAlignment = (Subtarget->getDarwinVers() >= 9);
More information about the llvm-commits
mailing list