1 //=====-- PPCTargetAsmInfo.h - PPC asm properties -------------*- C++ -*--====//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the declaration of the DarwinTargetAsmInfo class.
12 //===----------------------------------------------------------------------===//
14 #ifndef PPCTARGETASMINFO_H
15 #define PPCTARGETASMINFO_H
17 #include "PPCTargetMachine.h"
18 #include "llvm/Target/TargetAsmInfo.h"
19 #include "llvm/Target/DarwinTargetAsmInfo.h"
20 #include "llvm/Target/ELFTargetAsmInfo.h"
21 #include "llvm/Support/Compiler.h"
25 template <class BaseTAI
>
26 struct PPCTargetAsmInfo
: public BaseTAI
{
27 explicit PPCTargetAsmInfo(const PPCTargetMachine
&TM
):
29 const PPCSubtarget
*Subtarget
= &TM
.getSubtarget
<PPCSubtarget
>();
30 bool isPPC64
= Subtarget
->isPPC64();
32 BaseTAI::ZeroDirective
= "\t.space\t";
33 BaseTAI::SetDirective
= "\t.set";
34 BaseTAI::Data64bitsDirective
= isPPC64
? "\t.quad\t" : 0;
35 BaseTAI::AlignmentIsInBytes
= false;
36 BaseTAI::LCOMMDirective
= "\t.lcomm\t";
37 BaseTAI::InlineAsmStart
= "# InlineAsm Start";
38 BaseTAI::InlineAsmEnd
= "# InlineAsm End";
39 BaseTAI::AssemblerDialect
= Subtarget
->getAsmFlavor();
43 typedef PPCTargetAsmInfo
<TargetAsmInfo
> PPCGenericTargetAsmInfo
;
45 EXTERN_TEMPLATE_INSTANTIATION(class PPCTargetAsmInfo
<TargetAsmInfo
>);
47 struct PPCDarwinTargetAsmInfo
: public PPCTargetAsmInfo
<DarwinTargetAsmInfo
> {
48 explicit PPCDarwinTargetAsmInfo(const PPCTargetMachine
&TM
);
49 virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason
,
51 virtual const char *getEHGlobalPrefix() const;
54 struct PPCLinuxTargetAsmInfo
: public PPCTargetAsmInfo
<ELFTargetAsmInfo
> {
55 explicit PPCLinuxTargetAsmInfo(const PPCTargetMachine
&TM
);
56 virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason
,