From 7fbb0a1d451373a93b58b31f40e4e7c275d5c9eb Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 11 Aug 2009 22:06:07 +0000 Subject: move LCOMMDirective = "\t.lcomm\t" up to DarwinTAI, eliminate template in PPC backend for TAI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78727 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/PowerPC/PPCTargetAsmInfo.cpp | 35 +++++++++++++++++++++++++-------- lib/Target/PowerPC/PPCTargetAsmInfo.h | 25 ++--------------------- 2 files changed, 29 insertions(+), 31 deletions(-) (limited to 'lib/Target/PowerPC') diff --git a/lib/Target/PowerPC/PPCTargetAsmInfo.cpp b/lib/Target/PowerPC/PPCTargetAsmInfo.cpp index 52e2986..41d78dc 100644 --- a/lib/Target/PowerPC/PPCTargetAsmInfo.cpp +++ b/lib/Target/PowerPC/PPCTargetAsmInfo.cpp @@ -19,8 +19,7 @@ using namespace llvm; using namespace llvm::dwarf; -PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM) : - PPCTargetAsmInfo(TM) { +PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM) { PCSymbol = "."; CommentString = ";"; UsedDirective = "\t.no_dead_strip\t"; @@ -28,10 +27,21 @@ PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM) : GlobalEHDirective = "\t.globl\t"; SupportsWeakOmittedEHFrame = false; + + const PPCSubtarget *Subtarget = &TM.getSubtarget(); + 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(TM) { +PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) { CommentString = "#"; GlobalPrefix = ""; PrivateGlobalPrefix = ".L"; @@ -47,12 +57,21 @@ PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) : // Set up DWARF directives HasLEB128 = true; // Target asm supports leb128 directives (little-endian) + const PPCSubtarget *Subtarget = &TM.getSubtarget(); + 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); diff --git a/lib/Target/PowerPC/PPCTargetAsmInfo.h b/lib/Target/PowerPC/PPCTargetAsmInfo.h index a84db46..0d9285a 100644 --- a/lib/Target/PowerPC/PPCTargetAsmInfo.h +++ b/lib/Target/PowerPC/PPCTargetAsmInfo.h @@ -21,32 +21,11 @@ namespace llvm { - template - struct PPCTargetAsmInfo : public BaseTAI { - explicit PPCTargetAsmInfo(const PPCTargetMachine &TM) { - const PPCSubtarget *Subtarget = &TM.getSubtarget(); - 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 PPCGenericTargetAsmInfo; - - EXTERN_TEMPLATE_INSTANTIATION(class PPCTargetAsmInfo); - - struct PPCDarwinTargetAsmInfo : public PPCTargetAsmInfo { + struct PPCDarwinTargetAsmInfo : public DarwinTargetAsmInfo { explicit PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM); }; - struct PPCLinuxTargetAsmInfo : public PPCTargetAsmInfo { + struct PPCLinuxTargetAsmInfo : public TargetAsmInfo { explicit PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM); }; -- cgit v1.1