aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis/LiveVar/BBLiveVar.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-02-05 06:52:25 +0000
committerChris Lattner <sabre@nondot.org>2002-02-05 06:52:25 +0000
commit6357a3f42d13dd9d67340ba165a13ba26ed2b10b (patch)
tree6a163d2147da5178add5415d8acfdc645f4cb76d /lib/Analysis/LiveVar/BBLiveVar.h
parent2f898d207466bf233b55607e404baca302bc7b5e (diff)
downloadexternal_llvm-6357a3f42d13dd9d67340ba165a13ba26ed2b10b.zip
external_llvm-6357a3f42d13dd9d67340ba165a13ba26ed2b10b.tar.gz
external_llvm-6357a3f42d13dd9d67340ba165a13ba26ed2b10b.tar.bz2
Convert BBLiveVar to be a BasicBlock annotation, this removes the BB2BBLVMap from MethodLiveVarInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1721 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LiveVar/BBLiveVar.h')
-rw-r--r--lib/Analysis/LiveVar/BBLiveVar.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/Analysis/LiveVar/BBLiveVar.h b/lib/Analysis/LiveVar/BBLiveVar.h
index 442eb22..db5ac8f 100644
--- a/lib/Analysis/LiveVar/BBLiveVar.h
+++ b/lib/Analysis/LiveVar/BBLiveVar.h
@@ -1,6 +1,7 @@
//===-- BBLiveVar.h - Live Variable Analysis for a BasicBlock ----*- C++ -*--=//
//
-// This is a wrapper class for BasicBlock which is used by live var analysis.
+// This is a BasicBlock annotation class that is used by live var analysis to
+// hold data flow information for a basic block.
//
//===----------------------------------------------------------------------===//
@@ -8,17 +9,18 @@
#define LIVE_VAR_BB_H
#include "llvm/Analysis/LiveVar/ValueSet.h"
+#include "llvm/Annotation.h"
#include <map>
class Method;
class BasicBlock;
class Value;
-class BBLiveVar {
+class BBLiveVar : public Annotation {
const BasicBlock *BB; // pointer to BasicBlock
unsigned POID; // Post-Order ID
- ValueSet DefSet; // Def set for LV analysis
- ValueSet InSet, OutSet; // In & Out for LV analysis
+ ValueSet DefSet; // Def set for LV analysis
+ ValueSet InSet, OutSet; // In & Out for LV analysis
bool InSetChanged, OutSetChanged; // set if the InSet/OutSet is modified
// map that contains phi args->BB they came
@@ -37,8 +39,13 @@ class BBLiveVar {
void addUse(const Value *Op);
void calcDefUseSets(); // calculates the Def & Use sets for this BB
- public:
+
BBLiveVar(const BasicBlock *BB, unsigned POID);
+ ~BBLiveVar() {} // make dtor private
+ public:
+ static BBLiveVar *CreateOnBB(const BasicBlock *BB, 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; }
@@ -48,7 +55,7 @@ class BBLiveVar {
bool applyTransferFunc(); // calcultes the In in terms of Out
// calculates Out set using In sets of the predecessors
- bool applyFlowFunc(std::map<const BasicBlock *, BBLiveVar *> &LVMap);
+ bool applyFlowFunc();
inline const ValueSet &getOutSet() const { return OutSet; }
inline const ValueSet &getInSet() const { return InSet; }