mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-23 01:25:32 +00:00
Remove dependency on SSARegMap.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5137 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -10,7 +10,6 @@
|
|||||||
#define LLVM_CODEGEN_MACHINEFUNCTION_H
|
#define LLVM_CODEGEN_MACHINEFUNCTION_H
|
||||||
|
|
||||||
#include "llvm/CodeGen/MachineBasicBlock.h"
|
#include "llvm/CodeGen/MachineBasicBlock.h"
|
||||||
#include "llvm/CodeGen/SSARegMap.h"
|
|
||||||
#include "llvm/Annotation.h"
|
#include "llvm/Annotation.h"
|
||||||
#include "Support/HashExtras.h"
|
#include "Support/HashExtras.h"
|
||||||
#include "Support/hash_set"
|
#include "Support/hash_set"
|
||||||
@@ -22,6 +21,7 @@ class Constant;
|
|||||||
class Type;
|
class Type;
|
||||||
class TargetMachine;
|
class TargetMachine;
|
||||||
class Pass;
|
class Pass;
|
||||||
|
class SSARegMap;
|
||||||
|
|
||||||
Pass *createMachineCodeConstructionPass(TargetMachine &Target);
|
Pass *createMachineCodeConstructionPass(TargetMachine &Target);
|
||||||
Pass *createMachineCodeDestructionPass();
|
Pass *createMachineCodeDestructionPass();
|
||||||
@@ -34,6 +34,9 @@ class MachineFunction : private Annotation {
|
|||||||
// List of machine basic blocks in function
|
// List of machine basic blocks in function
|
||||||
iplist<MachineBasicBlock> BasicBlocks;
|
iplist<MachineBasicBlock> BasicBlocks;
|
||||||
|
|
||||||
|
// Keeping track of mapping from SSA values to registers
|
||||||
|
SSARegMap *SSARegMapping;
|
||||||
|
|
||||||
// FIXME: State should be held elsewhere...
|
// FIXME: State should be held elsewhere...
|
||||||
hash_set<const Constant*> constantsForConstPool;
|
hash_set<const Constant*> constantsForConstPool;
|
||||||
hash_map<const Value*, int> offsets;
|
hash_map<const Value*, int> offsets;
|
||||||
@@ -48,11 +51,9 @@ class MachineFunction : private Annotation {
|
|||||||
bool spillsAreaFrozen;
|
bool spillsAreaFrozen;
|
||||||
bool automaticVarsAreaFrozen;
|
bool automaticVarsAreaFrozen;
|
||||||
|
|
||||||
// Keeping track of mapping from SSA values to registers
|
|
||||||
SSARegMap *SSARegMapping;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MachineFunction(const Function *Fn, const TargetMachine& target);
|
MachineFunction(const Function *Fn, const TargetMachine& target);
|
||||||
|
~MachineFunction();
|
||||||
|
|
||||||
/// getFunction - Return the LLVM function that this machine code represents
|
/// getFunction - Return the LLVM function that this machine code represents
|
||||||
///
|
///
|
||||||
@@ -71,11 +72,6 @@ public:
|
|||||||
///
|
///
|
||||||
void dump() const;
|
void dump() const;
|
||||||
|
|
||||||
/// CalculateArgSize - Call this method to fill in the maxOptionalArgsSize &
|
|
||||||
/// staticStackSize fields...
|
|
||||||
///
|
|
||||||
void CalculateArgSize();
|
|
||||||
|
|
||||||
// The next three methods are used to construct, destruct, and retrieve the
|
// The next three methods are used to construct, destruct, and retrieve the
|
||||||
// MachineFunction object for the given method.
|
// MachineFunction object for the given method.
|
||||||
//
|
//
|
||||||
@@ -90,18 +86,6 @@ public:
|
|||||||
static void destruct(const Function *F);
|
static void destruct(const Function *F);
|
||||||
static MachineFunction& get(const Function *F);
|
static MachineFunction& get(const Function *F);
|
||||||
|
|
||||||
// Getting and storing SSARegMap information
|
|
||||||
const TargetRegisterClass* getRegClass(unsigned Reg) {
|
|
||||||
return SSARegMapping->getRegClass(Reg);
|
|
||||||
}
|
|
||||||
void addRegMap(unsigned Reg, const TargetRegisterClass *RegClass) {
|
|
||||||
SSARegMapping->addRegMap(Reg, RegClass);
|
|
||||||
}
|
|
||||||
void clearSSARegMap() {
|
|
||||||
delete SSARegMapping;
|
|
||||||
SSARegMapping = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Provide accessors for the MachineBasicBlock list...
|
// Provide accessors for the MachineBasicBlock list...
|
||||||
typedef iplist<MachineBasicBlock> BasicBlockListType;
|
typedef iplist<MachineBasicBlock> BasicBlockListType;
|
||||||
typedef BasicBlockListType::iterator iterator;
|
typedef BasicBlockListType::iterator iterator;
|
||||||
@@ -134,10 +118,23 @@ public:
|
|||||||
MachineBasicBlock & back() { return BasicBlocks.back(); }
|
MachineBasicBlock & back() { return BasicBlocks.back(); }
|
||||||
|
|
||||||
//===--------------------------------------------------------------------===//
|
//===--------------------------------------------------------------------===//
|
||||||
|
// SSARegMap Interface... Keep track of information about each SSA virtual
|
||||||
|
// register, such as which register class it belongs to.
|
||||||
//
|
//
|
||||||
// FIXME: Most of the following state should be moved out to passes that use
|
|
||||||
// it, instead of being put here.
|
SSARegMap *getSSARegMap() const { return SSARegMapping; }
|
||||||
|
void clearSSARegMap();
|
||||||
|
|
||||||
|
|
||||||
|
//===--------------------------------------------------------------------===//
|
||||||
//
|
//
|
||||||
|
// FIXME: Most of the following state should be moved into another class!
|
||||||
|
//
|
||||||
|
|
||||||
|
/// CalculateArgSize - Call this method to fill in the maxOptionalArgsSize &
|
||||||
|
/// staticStackSize fields...
|
||||||
|
///
|
||||||
|
void CalculateArgSize();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Accessors for global information about generated code for a method.
|
// Accessors for global information about generated code for a method.
|
||||||
@@ -182,8 +179,6 @@ public:
|
|||||||
|
|
||||||
int getOffset (const Value* val) const;
|
int getOffset (const Value* val) const;
|
||||||
|
|
||||||
// int getOffsetFromFP (const Value* val) const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
inline void incrementAutomaticVarsSize(int incr) {
|
inline void incrementAutomaticVarsSize(int incr) {
|
||||||
automaticVarsSize+= incr;
|
automaticVarsSize+= incr;
|
||||||
|
Reference in New Issue
Block a user