//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_TARGET_ASM_INFO_H
-#define LLVM_TARGET_ASM_INFO_H
+#ifndef LLVM_MC_MCASMINFO_H
+#define LLVM_MC_MCASMINFO_H
#include "llvm/MC/MCDirectives.h"
+#include "llvm/MC/MCDwarf.h"
#include "llvm/MC/MachineLocation.h"
#include <cassert>
#include <vector>
/// Default is 4.
unsigned PointerSize;
+ /// CalleeSaveStackSlotSize - Size of the stack slot reserved for
+ /// callee-saved registers, in bytes.
+ /// Default is same as pointer size.
+ unsigned CalleeSaveStackSlotSize;
+
/// IsLittleEndian - True if target is little endian.
/// Default is true.
bool IsLittleEndian;
/// which is needed to compute the size of an inline asm.
unsigned MaxInstLength; // Defaults to 4.
+ /// MinInstAlignment - Every possible instruction length is a multiple of
+ /// this value. Factored out in .debug_frame and .debug_line.
+ unsigned MinInstAlignment; // Defaults to 1.
+
/// PCSymbol - The symbol used to represent the current PC. Used in PC
/// relative expressions.
const char *PCSymbol; // Defaults to "$".
/// convention.
bool HasMicrosoftFastStdCallMangling; // Defaults to false.
+ bool NeedsDwarfSectionOffsetDirective;
+
//===--- Alignment Information ----------------------------------------===//
/// AlignDirective - The directive used to emit round up to an alignment
/// encode inline subroutine information.
bool DwarfUsesInlineInfoSection; // Defaults to false.
- /// DwarfSectionOffsetDirective - Special section offset directive.
- const char* DwarfSectionOffsetDirective; // Defaults to NULL
-
/// DwarfUsesRelocationsAcrossSections - True if Dwarf2 output generally
/// uses relocations for references to other .debug_* sections.
bool DwarfUsesRelocationsAcrossSections;
//===--- Prologue State ----------------------------------------------===//
- std::vector<MachineMove> InitialFrameState;
+ std::vector<MCCFIInstruction> InitialFrameState;
public:
explicit MCAsmInfo();
virtual ~MCAsmInfo();
// FIXME: move these methods to DwarfPrinter when the JIT stops using them.
- static unsigned getSLEB128Size(int Value);
- static unsigned getULEB128Size(unsigned Value);
+ static unsigned getSLEB128Size(int64_t Value);
+ static unsigned getULEB128Size(uint64_t Value);
/// getPointerSize - Get the pointer size in bytes.
unsigned getPointerSize() const {
return PointerSize;
}
- /// islittleendian - True if the target is little endian.
+ /// getCalleeSaveStackSlotSize - Get the callee-saved register stack slot
+ /// size in bytes.
+ unsigned getCalleeSaveStackSlotSize() const {
+ return CalleeSaveStackSlotSize;
+ }
+
+ /// isLittleEndian - True if the target is little endian.
bool isLittleEndian() const {
return IsLittleEndian;
}
return HasMicrosoftFastStdCallMangling;
}
+ bool needsDwarfSectionOffsetDirective() const {
+ return NeedsDwarfSectionOffsetDirective;
+ }
+
// Accessors.
//
bool hasMachoZeroFillDirective() const { return HasMachoZeroFillDirective; }
unsigned getMaxInstLength() const {
return MaxInstLength;
}
+ unsigned getMinInstAlignment() const {
+ return MinInstAlignment;
+ }
const char *getPCSymbol() const {
return PCSymbol;
}
bool doesDwarfUseInlineInfoSection() const {
return DwarfUsesInlineInfoSection;
}
- const char *getDwarfSectionOffsetDirective() const {
- return DwarfSectionOffsetDirective;
- }
bool doesDwarfUseRelocationsAcrossSections() const {
return DwarfUsesRelocationsAcrossSections;
}
return DwarfRegNumForCFI;
}
- void addInitialFrameState(MCSymbol *label, const MachineLocation &D,
- const MachineLocation &S) {
- InitialFrameState.push_back(MachineMove(label, D, S));
+ void addInitialFrameState(const MCCFIInstruction &Inst) {
+ InitialFrameState.push_back(Inst);
}
- const std::vector<MachineMove> &getInitialFrameState() const {
+
+ const std::vector<MCCFIInstruction> &getInitialFrameState() const {
return InitialFrameState;
}
};