blob: 34f4dd5136cdc78767003211c318306d8676ecb0 [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 {
Chris Lattner7dd4ffc2009-08-02 04:27:24 +000027 explicit PPCTargetAsmInfo(const PPCTargetMachine &TM) {
Anton Korobeynikov3829e8a2008-09-25 21:00:33 +000028 const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
29 bool isPPC64 = Subtarget->isPPC64();
Anton Korobeynikov248e9c52008-08-08 18:23:25 +000030
Anton Korobeynikov3829e8a2008-09-25 21:00:33 +000031 BaseTAI::ZeroDirective = "\t.space\t";
32 BaseTAI::SetDirective = "\t.set";
33 BaseTAI::Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0;
34 BaseTAI::AlignmentIsInBytes = false;
35 BaseTAI::LCOMMDirective = "\t.lcomm\t";
36 BaseTAI::InlineAsmStart = "# InlineAsm Start";
37 BaseTAI::InlineAsmEnd = "# InlineAsm End";
38 BaseTAI::AssemblerDialect = Subtarget->getAsmFlavor();
39 }
Dan Gohmanf17a25c2007-07-18 16:29:46 +000040 };
41
Anton Korobeynikov3829e8a2008-09-25 21:00:33 +000042 typedef PPCTargetAsmInfo<TargetAsmInfo> PPCGenericTargetAsmInfo;
43
44 EXTERN_TEMPLATE_INSTANTIATION(class PPCTargetAsmInfo<TargetAsmInfo>);
45
46 struct PPCDarwinTargetAsmInfo : public PPCTargetAsmInfo<DarwinTargetAsmInfo> {
Anton Korobeynikovd15bc312008-07-19 21:44:57 +000047 explicit PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM);
Dan Gohmanf17a25c2007-07-18 16:29:46 +000048 };
49
Chris Lattner7dd4ffc2009-08-02 04:27:24 +000050 struct PPCLinuxTargetAsmInfo : public PPCTargetAsmInfo<TargetAsmInfo> {
Anton Korobeynikovd15bc312008-07-19 21:44:57 +000051 explicit PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM);
Dan Gohmanf17a25c2007-07-18 16:29:46 +000052 };
53
54} // namespace llvm
55
56#endif