blob: a533d5fc60e2f00a850f9183980b817f4f74c1ec [file] [log] [blame]
Jim Laskey8e8de8f2006-09-07 22:05:02 +00001//=====-- PPCTargetAsmInfo.h - PPC asm properties -------------*- C++ -*--====//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Jim Laskey8e8de8f2006-09-07 22:05:02 +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 Korobeynikov32b952a2008-09-25 21:00:33 +000017#include "PPCTargetMachine.h"
Jim Laskey8e8de8f2006-09-07 22:05:02 +000018#include "llvm/Target/TargetAsmInfo.h"
Anton Korobeynikovbc331a82008-08-08 18:23:25 +000019#include "llvm/Target/DarwinTargetAsmInfo.h"
Anton Korobeynikov7396e592008-08-08 18:23:49 +000020#include "llvm/Target/ELFTargetAsmInfo.h"
Anton Korobeynikov32b952a2008-09-25 21:00:33 +000021#include "llvm/Support/Compiler.h"
Jim Laskey8e8de8f2006-09-07 22:05:02 +000022
23namespace llvm {
24
Anton Korobeynikov32b952a2008-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 Korobeynikovbc331a82008-08-08 18:23:25 +000031
Anton Korobeynikov32b952a2008-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 }
Jim Laskeybf111822006-12-21 20:26:09 +000041 };
Jim Laskey8e8de8f2006-09-07 22:05:02 +000042
Anton Korobeynikov32b952a2008-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 Korobeynikovbadd8df2008-07-19 21:44:57 +000048 explicit PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM);
Anton Korobeynikov8213f9c2008-02-29 22:09:08 +000049 virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
50 bool Global) const;
Jim Laskey8e8de8f2006-09-07 22:05:02 +000051 };
52
Anton Korobeynikov32b952a2008-09-25 21:00:33 +000053 struct PPCLinuxTargetAsmInfo : public PPCTargetAsmInfo<ELFTargetAsmInfo> {
Anton Korobeynikovbadd8df2008-07-19 21:44:57 +000054 explicit PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM);
Anton Korobeynikov8213f9c2008-02-29 22:09:08 +000055 virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
56 bool Global) const;
Jim Laskeybf111822006-12-21 20:26:09 +000057 };
58
Jim Laskey8e8de8f2006-09-07 22:05:02 +000059} // namespace llvm
60
61#endif