ARM64MachineFunctionInfo.h [plain text]
#ifndef ARM64MACHINEFUNCTIONINFO_H
#define ARM64MACHINEFUNCTIONINFO_H
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/MC/MCLinkerOptimizationHint.h"
namespace llvm {
class ARM64FunctionInfo : public MachineFunctionInfo {
bool HasStackFrame;
unsigned LocalStackSize;
unsigned NumLocalDynamicTLSAccesses;
int VarArgsStackIndex;
int VarArgsGPRIndex;
unsigned VarArgsGPRSize;
int VarArgsFPRIndex;
unsigned VarArgsFPRSize;
public:
ARM64FunctionInfo() :
HasStackFrame(false), NumLocalDynamicTLSAccesses(0),
VarArgsStackIndex(0), VarArgsGPRIndex(0),
VarArgsGPRSize(0), VarArgsFPRIndex(0), VarArgsFPRSize(0) {}
explicit ARM64FunctionInfo(MachineFunction &MF) :
HasStackFrame(false), NumLocalDynamicTLSAccesses(0),
VarArgsStackIndex(0), VarArgsGPRIndex(0),
VarArgsGPRSize(0), VarArgsFPRIndex(0), VarArgsFPRSize(0) { (void)MF; }
bool hasStackFrame() const { return HasStackFrame; }
void setHasStackFrame(bool s) { HasStackFrame = s; }
void setLocalStackSize(unsigned Size) { LocalStackSize = Size; }
unsigned getLocalStackSize() const { return LocalStackSize; }
void incNumLocalDynamicTLSAccesses() { ++NumLocalDynamicTLSAccesses; }
unsigned getNumLocalDynamicTLSAccesses() const {
return NumLocalDynamicTLSAccesses;
}
int getVarArgsStackIndex() const { return VarArgsStackIndex; }
void setVarArgsStackIndex(int Index) { VarArgsStackIndex = Index; }
int getVarArgsGPRIndex() const { return VarArgsGPRIndex; }
void setVarArgsGPRIndex(int Index) { VarArgsGPRIndex = Index; }
unsigned getVarArgsGPRSize() const { return VarArgsGPRSize; }
void setVarArgsGPRSize(unsigned Size) { VarArgsGPRSize = Size; }
int getVarArgsFPRIndex() const { return VarArgsFPRIndex; }
void setVarArgsFPRIndex(int Index) { VarArgsFPRIndex = Index; }
unsigned getVarArgsFPRSize() const { return VarArgsFPRSize; }
void setVarArgsFPRSize(unsigned Size) { VarArgsFPRSize = Size; }
typedef SmallPtrSet<const MachineInstr *, 16> SetOfInstructions;
const SetOfInstructions &getLOHRelated() const {
return LOHRelated;
}
typedef LOHDirective<const MachineInstr> MILOHDirective;
typedef MILOHDirective::LOHArgs MILOHArgs;
typedef LOHContainer<const MachineInstr> MILOHContainer;
typedef MILOHContainer::LOHDirectives MILOHDirectives;
const MILOHContainer & getLOHContainer() const { return LOHContainerSet; }
void addLOHDirective(MCLOHType Kind, const MILOHArgs &Args) {
LOHContainerSet.addDirective(Kind, Args);
for (MILOHArgs::const_iterator It = Args.begin(),
EndIt = Args.end(); It != EndIt; ++It)
LOHRelated.insert(*It);
}
private:
MILOHContainer LOHContainerSet;
SetOfInstructions LOHRelated;
};
}
#endif // ARM64MACHINEFUNCTIONINFO_H