2006-09-07 22:05:02 +00:00
|
|
|
//=====-- X86TargetAsmInfo.h - X86 asm properties -------------*- C++ -*--====//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 20:36:04 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2006-09-07 22:05:02 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file contains the declaration of the X86TargetAsmInfo class.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef X86TARGETASMINFO_H
|
|
|
|
#define X86TARGETASMINFO_H
|
|
|
|
|
2008-09-25 21:00:33 +00:00
|
|
|
#include "X86TargetMachine.h"
|
2006-09-07 22:05:02 +00:00
|
|
|
#include "llvm/Target/TargetAsmInfo.h"
|
2008-07-19 13:15:21 +00:00
|
|
|
#include "llvm/Target/ELFTargetAsmInfo.h"
|
|
|
|
#include "llvm/Target/DarwinTargetAsmInfo.h"
|
2008-09-25 21:00:33 +00:00
|
|
|
#include "llvm/Support/Compiler.h"
|
2006-09-07 22:05:02 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
2007-01-16 03:42:04 +00:00
|
|
|
|
2008-09-25 21:00:33 +00:00
|
|
|
extern const char *const x86_asm_table[];
|
2006-09-07 22:05:02 +00:00
|
|
|
|
2008-09-25 21:00:33 +00:00
|
|
|
template <class BaseTAI>
|
|
|
|
struct X86TargetAsmInfo : public BaseTAI {
|
2009-07-20 17:59:32 +00:00
|
|
|
explicit X86TargetAsmInfo(const X86TargetMachine &TM) : BaseTAI(TM) {
|
2008-09-25 21:00:33 +00:00
|
|
|
BaseTAI::AsmTransCBE = x86_asm_table;
|
2009-07-20 17:59:32 +00:00
|
|
|
BaseTAI::AssemblerDialect =TM.getSubtarget<X86Subtarget>().getAsmFlavor();
|
2008-09-25 21:00:33 +00:00
|
|
|
}
|
2008-07-09 13:20:48 +00:00
|
|
|
};
|
|
|
|
|
2008-09-25 21:00:33 +00:00
|
|
|
typedef X86TargetAsmInfo<TargetAsmInfo> X86GenericTargetAsmInfo;
|
|
|
|
|
|
|
|
EXTERN_TEMPLATE_INSTANTIATION(class X86TargetAsmInfo<TargetAsmInfo>);
|
|
|
|
|
|
|
|
struct X86DarwinTargetAsmInfo : public X86TargetAsmInfo<DarwinTargetAsmInfo> {
|
2008-07-09 13:20:48 +00:00
|
|
|
explicit X86DarwinTargetAsmInfo(const X86TargetMachine &TM);
|
2008-07-09 13:21:08 +00:00
|
|
|
virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
|
|
|
|
bool Global) const;
|
2008-12-19 10:55:56 +00:00
|
|
|
virtual const char *getEHGlobalPrefix() const;
|
2008-07-09 13:20:48 +00:00
|
|
|
};
|
|
|
|
|
2008-09-25 21:00:33 +00:00
|
|
|
struct X86ELFTargetAsmInfo : public X86TargetAsmInfo<ELFTargetAsmInfo> {
|
2008-07-09 13:20:48 +00:00
|
|
|
explicit X86ELFTargetAsmInfo(const X86TargetMachine &TM);
|
2008-07-09 13:21:08 +00:00
|
|
|
virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
|
|
|
|
bool Global) const;
|
2008-07-09 13:20:48 +00:00
|
|
|
};
|
|
|
|
|
2008-09-25 21:00:33 +00:00
|
|
|
struct X86COFFTargetAsmInfo : public X86GenericTargetAsmInfo {
|
2008-07-09 13:20:48 +00:00
|
|
|
explicit X86COFFTargetAsmInfo(const X86TargetMachine &TM);
|
2008-07-09 13:21:08 +00:00
|
|
|
virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
|
|
|
|
bool Global) const;
|
2008-07-09 13:21:29 +00:00
|
|
|
virtual std::string UniqueSectionForGlobal(const GlobalValue* GV,
|
|
|
|
SectionKind::Kind kind) const;
|
2008-08-16 12:57:07 +00:00
|
|
|
virtual std::string printSectionFlags(unsigned flags) const;
|
2008-07-09 13:20:48 +00:00
|
|
|
};
|
|
|
|
|
2008-09-25 21:00:33 +00:00
|
|
|
struct X86WinTargetAsmInfo : public X86GenericTargetAsmInfo {
|
2008-07-09 13:20:48 +00:00
|
|
|
explicit X86WinTargetAsmInfo(const X86TargetMachine &TM);
|
2006-09-07 22:05:02 +00:00
|
|
|
};
|
2008-09-25 21:00:33 +00:00
|
|
|
|
2006-09-07 22:05:02 +00:00
|
|
|
} // namespace llvm
|
|
|
|
|
|
|
|
#endif
|