2010-12-10 07:39:47 +00:00
|
|
|
//===-- llvm/Target/TargetAsmInfo.h -----------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// Interface to provide the information necessary for producing assembly files.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_TARGET_TARGETASMINFO_H
|
|
|
|
#define LLVM_TARGET_TARGETASMINFO_H
|
|
|
|
|
|
|
|
#include "llvm/CodeGen/MachineLocation.h"
|
|
|
|
#include "llvm/Target/TargetLoweringObjectFile.h"
|
2011-01-10 12:39:04 +00:00
|
|
|
#include "llvm/Target/TargetFrameLowering.h"
|
2010-12-10 07:39:47 +00:00
|
|
|
#include "llvm/Target/TargetRegisterInfo.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
class MCSection;
|
|
|
|
class MCContext;
|
|
|
|
class TargetMachine;
|
|
|
|
class TargetLoweringObjectFile;
|
|
|
|
|
|
|
|
class TargetAsmInfo {
|
|
|
|
unsigned PointerSize;
|
|
|
|
bool IsLittleEndian;
|
2011-01-10 12:39:04 +00:00
|
|
|
TargetFrameLowering::StackDirection StackDir;
|
2010-12-10 07:39:47 +00:00
|
|
|
const TargetRegisterInfo *TRI;
|
|
|
|
std::vector<MachineMove> InitialFrameState;
|
|
|
|
const TargetLoweringObjectFile *TLOF;
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit TargetAsmInfo(const TargetMachine &TM);
|
|
|
|
|
|
|
|
/// getPointerSize - Get the pointer size in bytes.
|
|
|
|
unsigned getPointerSize() const {
|
|
|
|
return PointerSize;
|
|
|
|
}
|
|
|
|
|
|
|
|
/// islittleendian - True if the target is little endian.
|
|
|
|
bool isLittleEndian() const {
|
|
|
|
return IsLittleEndian;
|
|
|
|
}
|
|
|
|
|
2011-01-10 12:39:04 +00:00
|
|
|
TargetFrameLowering::StackDirection getStackGrowthDirection() const {
|
2010-12-10 07:39:47 +00:00
|
|
|
return StackDir;
|
|
|
|
}
|
|
|
|
|
|
|
|
const MCSection *getDwarfLineSection() const {
|
|
|
|
return TLOF->getDwarfLineSection();
|
|
|
|
}
|
|
|
|
|
|
|
|
const MCSection *getEHFrameSection() const {
|
|
|
|
return TLOF->getEHFrameSection();
|
|
|
|
}
|
|
|
|
|
2011-05-01 04:49:54 +00:00
|
|
|
unsigned getFDEEncoding(bool CFI) const {
|
|
|
|
return TLOF->getFDEEncoding(CFI);
|
2011-04-22 00:08:43 +00:00
|
|
|
}
|
|
|
|
|
2011-04-28 02:46:42 +00:00
|
|
|
bool isFunctionEHFrameSymbolPrivate() const {
|
|
|
|
return TLOF->isFunctionEHFrameSymbolPrivate();
|
|
|
|
}
|
|
|
|
|
2010-12-10 07:39:47 +00:00
|
|
|
unsigned getDwarfRARegNum(bool isEH) const {
|
|
|
|
return TRI->getDwarfRegNum(TRI->getRARegister(), isEH);
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::vector<MachineMove> &getInitialFrameState() const {
|
|
|
|
return InitialFrameState;
|
|
|
|
}
|
|
|
|
|
|
|
|
int getDwarfRegNum(unsigned RegNum, bool isEH) const {
|
|
|
|
return TRI->getDwarfRegNum(RegNum, isEH);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|