blob: a533d5fc60e2f00a850f9183980b817f4f74c1ec [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001//=====-- PPCTargetAsmInfo.h - PPC asm properties -------------*- C++ -*--====//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner081ce942007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Dan Gohmanf17a25c2007-07-18 16:29:46 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This file contains the declaration of the DarwinTargetAsmInfo class.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef PPCTARGETASMINFO_H
15#define PPCTARGETASMINFO_H
16
Anton Korobeynikov3829e8a2008-09-25 21:00:33 +000017#include "PPCTargetMachine.h"
Dan Gohmanf17a25c2007-07-18 16:29:46 +000018#include "llvm/Target/TargetAsmInfo.h"
Anton Korobeynikov248e9c52008-08-08 18:23:25 +000019#include "llvm/Target/DarwinTargetAsmInfo.h"
Anton Korobeynikov894be4b2008-08-08 18:23:49 +000020#include "llvm/Target/ELFTargetAsmInfo.h"
Anton Korobeynikov3829e8a2008-09-25 21:00:33 +000021#include "llvm/Support/Compiler.h"
Dan Gohmanf17a25c2007-07-18 16:29:46 +000022
23namespace llvm {
24
Anton Korobeynikov3829e8a2008-09-25 21:00:33 +000025 template <class BaseTAI>
26 struct PPCTargetAsmInfo : public BaseTAI {
27 explicit PPCTargetAsmInfo(const PPCTargetMachine &TM):
28 BaseTAI(TM) {
29 const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
30 bool isPPC64 = Subtarget->isPPC64();
Anton Korobeynikov248e9c52008-08-08 18:23:25 +000031
Anton Korobeynikov3829e8a2008-09-25 21:00:33 +000032 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();
40 }
Dan Gohmanf17a25c2007-07-18 16:29:46 +000041 };
42
Anton Korobeynikov3829e8a2008-09-25 21:00:33 +000043 typedef PPCTargetAsmInfo<TargetAsmInfo> PPCGenericTargetAsmInfo;
44
45 EXTERN_TEMPLATE_INSTANTIATION(class PPCTargetAsmInfo<TargetAsmInfo>);
46
47 struct PPCDarwinTargetAsmInfo : public PPCTargetAsmInfo<DarwinTargetAsmInfo> {
Anton Korobeynikovd15bc312008-07-19 21:44:57 +000048 explicit PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM);
Anton Korobeynikov8750d7c2008-02-29 22:09:08 +000049 virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
50 bool Global) const;
Dan Gohmanf17a25c2007-07-18 16:29:46 +000051 };
52
Anton Korobeynikov3829e8a2008-09-25 21:00:33 +000053 struct PPCLinuxTargetAsmInfo : public PPCTargetAsmInfo<ELFTargetAsmInfo> {
Anton Korobeynikovd15bc312008-07-19 21:44:57 +000054 explicit PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM);
Anton Korobeynikov8750d7c2008-02-29 22:09:08 +000055 virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
56 bool Global) const;
Dan Gohmanf17a25c2007-07-18 16:29:46 +000057 };
58
59} // namespace llvm
60
61#endif