#define LIVE_VAR_BB_H
#include "llvm/CodeGen/ValueSet.h"
-#include "Support/Annotation.h"
-#include <map>
+#include "Support/hash_map"
class BasicBlock;
class Value;
class MachineBasicBlock;
extern LiveVarDebugLevel_t DEBUG_LV;
-class BBLiveVar : public Annotation {
+class BBLiveVar {
const BasicBlock &BB; // pointer to BasicBlock
MachineBasicBlock &MBB; // Pointer to MachineBasicBlock
unsigned POID; // Post-Order ID
// map that contains PredBB -> Phi arguments
// coming in on that edge. such uses have to be
// treated differently from ordinary uses.
- std::map<const BasicBlock *, ValueSet> PredToEdgeInSetMap;
+ hash_map<const BasicBlock *, ValueSet> PredToEdgeInSetMap;
// method to propagate an InSet to OutSet of a predecessor
bool setPropagate(ValueSet *OutSetOfPred,
void addUse(const Value *Op);
void calcDefUseSets(); // calculates the Def & Use sets for this BB
+public:
BBLiveVar(const BasicBlock &BB, MachineBasicBlock &MBB, unsigned POID);
- ~BBLiveVar() {} // make dtor private
- public:
- static BBLiveVar *CreateOnBB(const BasicBlock &BB, MachineBasicBlock &MBB,
- unsigned POID);
- static BBLiveVar *GetFromBB(const BasicBlock &BB);
- static void RemoveFromBB(const BasicBlock &BB);
inline bool isInSetChanged() const { return InSetChanged; }
inline bool isOutSetChanged() const { return OutSetChanged; }
bool applyTransferFunc(); // calcultes the In in terms of Out
// calculates Out set using In sets of the predecessors
- bool applyFlowFunc();
+ bool applyFlowFunc(hash_map<const BasicBlock*, BBLiveVar*> &BBLiveVarInfo);
inline const ValueSet &getOutSet() const { return OutSet; }
inline ValueSet &getOutSet() { return OutSet; }