blob: a84db460d28e3d85b86200e478fb90807cc27d18 [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 Korobeynikov3829e8a2008-09-25 21:00:33 +000020#include "llvm/Support/Compiler.h"
Dan Gohmanf17a25c2007-07-18 16:29:46 +000021
22namespace llvm {
23
Anton Korobeynikov3829e8a2008-09-25 21:00:33 +000024 template <class BaseTAI>
25 struct PPCTargetAsmInfo : public BaseTAI {
Chris Lattner7dd4ffc2009-08-02 04:27:24 +000026 explicit PPCTargetAsmInfo(const PPCTargetMachine &TM) {
Anton Korobeynikov3829e8a2008-09-25 21:00:33 +000027 const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
28 bool isPPC64 = Subtarget->isPPC64();
Anton Korobeynikov248e9c52008-08-08 18:23:25 +000029
Anton Korobeynikov3829e8a2008-09-25 21:00:33 +000030 BaseTAI::ZeroDirective = "\t.space\t";
31 BaseTAI::SetDirective = "\t.set";
32 BaseTAI::Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0;
33 BaseTAI::AlignmentIsInBytes = false;
34 BaseTAI::LCOMMDirective = "\t.lcomm\t";
35 BaseTAI::InlineAsmStart = "# InlineAsm Start";
36 BaseTAI::InlineAsmEnd = "# InlineAsm End";
37 BaseTAI::AssemblerDialect = Subtarget->getAsmFlavor();
38 }
Dan Gohmanf17a25c2007-07-18 16:29:46 +000039 };
40
Anton Korobeynikov3829e8a2008-09-25 21:00:33 +000041 typedef PPCTargetAsmInfo<TargetAsmInfo> PPCGenericTargetAsmInfo;
42
43 EXTERN_TEMPLATE_INSTANTIATION(class PPCTargetAsmInfo<TargetAsmInfo>);
44
45 struct PPCDarwinTargetAsmInfo : public PPCTargetAsmInfo<DarwinTargetAsmInfo> {
Anton Korobeynikovd15bc312008-07-19 21:44:57 +000046 explicit PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM);
Dan Gohmanf17a25c2007-07-18 16:29:46 +000047 };
48
Chris Lattner7dd4ffc2009-08-02 04:27:24 +000049 struct PPCLinuxTargetAsmInfo : public PPCTargetAsmInfo<TargetAsmInfo> {
Anton Korobeynikovd15bc312008-07-19 21:44:57 +000050 explicit PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM);
Dan Gohmanf17a25c2007-07-18 16:29:46 +000051 };
52
53} // namespace llvm
54
55#endif