blob: 9e6f8568f76aea5dc7d0475cdde572ab5d338698 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001//=====-- ARMTargetAsmInfo.h - ARM 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 ARMTargetAsmInfo class.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef ARMTARGETASMINFO_H
15#define ARMTARGETASMINFO_H
16
Anton Korobeynikov3829e8a2008-09-25 21:00:33 +000017#include "ARMTargetMachine.h"
Dan Gohmanf17a25c2007-07-18 16:29:46 +000018#include "llvm/Target/TargetAsmInfo.h"
Anton Korobeynikov3cc6efa2008-08-07 09:54:23 +000019#include "llvm/Target/ELFTargetAsmInfo.h"
20#include "llvm/Target/DarwinTargetAsmInfo.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 extern const char *const arm_asm_table[];
Dan Gohmanf17a25c2007-07-18 16:29:46 +000026
Anton Korobeynikov3829e8a2008-09-25 21:00:33 +000027 template <class BaseTAI>
28 struct ARMTargetAsmInfo : public BaseTAI {
29 explicit ARMTargetAsmInfo(const ARMTargetMachine &TM):
30 BaseTAI(TM) {
31 BaseTAI::AsmTransCBE = arm_asm_table;
32
33 BaseTAI::AlignmentIsInBytes = false;
34 BaseTAI::Data64bitsDirective = 0;
35 BaseTAI::CommentString = "@";
36 BaseTAI::ConstantPoolSection = "\t.text\n";
37 BaseTAI::COMMDirectiveTakesAlignment = false;
38 BaseTAI::InlineAsmStart = "@ InlineAsm Start";
39 BaseTAI::InlineAsmEnd = "@ InlineAsm End";
40 BaseTAI::LCOMMDirective = "\t.lcomm\t";
41 }
Dan Gohmanf17a25c2007-07-18 16:29:46 +000042
43 const ARMSubtarget *Subtarget;
44
45 virtual unsigned getInlineAsmLength(const char *Str) const;
46 unsigned countArguments(const char *p) const;
47 unsigned countString(const char *p) const;
48 };
49
Anton Korobeynikov3829e8a2008-09-25 21:00:33 +000050 typedef ARMTargetAsmInfo<TargetAsmInfo> ARMGenericTargetAsmInfo;
51
52 EXTERN_TEMPLATE_INSTANTIATION(class ARMTargetAsmInfo<TargetAsmInfo>);
53
54 struct ARMDarwinTargetAsmInfo : public ARMTargetAsmInfo<DarwinTargetAsmInfo> {
Anton Korobeynikov3cc6efa2008-08-07 09:54:23 +000055 explicit ARMDarwinTargetAsmInfo(const ARMTargetMachine &TM);
56 };
57
Anton Korobeynikov3829e8a2008-09-25 21:00:33 +000058 struct ARMELFTargetAsmInfo : public ARMTargetAsmInfo<ELFTargetAsmInfo> {
Anton Korobeynikov3cc6efa2008-08-07 09:54:23 +000059 explicit ARMELFTargetAsmInfo(const ARMTargetMachine &TM);
60 };
Dan Gohmanf17a25c2007-07-18 16:29:46 +000061
62} // namespace llvm
63
64#endif