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