summaryrefslogtreecommitdiff
path: root/lib/Analysis
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-02-05 00:33:19 +0000
committerChris Lattner <sabre@nondot.org>2002-02-05 00:33:19 +0000
commit0174410fd05717bde6b4006385af498083ca280b (patch)
tree328fba061b03614a4c69e2a9eabe6d03d79c0942 /lib/Analysis
parenta51c7a8ef5cd4e87137581c93478c5f0f7ee5501 (diff)
downloadllvm-0174410fd05717bde6b4006385af498083ca280b.tar.gz
llvm-0174410fd05717bde6b4006385af498083ca280b.tar.bz2
llvm-0174410fd05717bde6b4006385af498083ca280b.tar.xz
* Big cleanups.
* Make BBLiveVar.h effectively an internal header file * Prepare LiveVarMap.h for deletion git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1705 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/LiveVar/BBLiveVar.h43
1 files changed, 22 insertions, 21 deletions
diff --git a/lib/Analysis/LiveVar/BBLiveVar.h b/lib/Analysis/LiveVar/BBLiveVar.h
index 08ccd2fe5c..112e8151d9 100644
--- a/lib/Analysis/LiveVar/BBLiveVar.h
+++ b/lib/Analysis/LiveVar/BBLiveVar.h
@@ -1,20 +1,21 @@
-/* Title: BBLiveVar.h -*- C++ -*-
- Author: Ruchira Sasanka
- Date: Jun 30, 01
- Purpose: This is a wrapper class for BasicBlock which is used by live
- variable anaysis.
-*/
+//===-- BBLiveVar.h - Live Variable Analysis for a BasicBlock ----*- C++ -*--=//
+//
+// This is a wrapper class for BasicBlock which is used by live var analysis.
+//
+//===----------------------------------------------------------------------===//
#ifndef LIVE_VAR_BB_H
#define LIVE_VAR_BB_H
#include "LiveVarSet.h"
-#include "LiveVarMap.h"
+#include <map>
class Method;
+class BasicBlock;
+class Value;
class BBLiveVar {
- const BasicBlock* BaseBB; // pointer to BasicBlock
- unsigned POId; // Post-Order ID
+ const BasicBlock *BB; // pointer to BasicBlock
+ unsigned POID; // Post-Order ID
LiveVarSet DefSet; // Def set for LV analysis
LiveVarSet InSet, OutSet; // In & Out for LV analysis
@@ -22,12 +23,12 @@ class BBLiveVar {
// map that contains phi args->BB they came
// set by calcDefUseSets & used by setPropagate
- std::hash_map<const Value *, const BasicBlock *> PhiArgMap;
+ std::map<const Value *, const BasicBlock *> PhiArgMap;
// method to propogate an InSet to OutSet of a predecessor
- bool setPropagate( LiveVarSet *OutSetOfPred,
- const LiveVarSet *InSetOfThisBB,
- const BasicBlock *PredBB);
+ bool setPropagate(LiveVarSet *OutSetOfPred,
+ const LiveVarSet *InSetOfThisBB,
+ const BasicBlock *PredBB);
// To add an operand which is a def
void addDef(const Value *Op);
@@ -36,21 +37,21 @@ class BBLiveVar {
void addUse(const Value *Op);
public:
- BBLiveVar(const BasicBlock* baseBB, unsigned POId);
+ BBLiveVar(const BasicBlock *BB, unsigned POID);
- inline bool isInSetChanged() const { return InSetChanged; }
+ inline bool isInSetChanged() const { return InSetChanged; }
inline bool isOutSetChanged() const { return OutSetChanged; }
- inline unsigned getPOId() const { return POId; }
+ inline unsigned getPOId() const { return POID; }
- void calcDefUseSets() ; // calculates the Def & Use sets for this BB
- bool applyTransferFunc(); // calcultes the In in terms of Out
+ void calcDefUseSets(); // calculates the Def & Use sets for this BB
+ bool applyTransferFunc(); // calcultes the In in terms of Out
// calculates Out set using In sets of the predecessors
- bool applyFlowFunc(BBToBBLiveVarMapType LVMap);
+ bool applyFlowFunc(std::map<const BasicBlock *, BBLiveVar *> &LVMap);
- inline const LiveVarSet* getOutSet() const { return &OutSet; }
- inline const LiveVarSet* getInSet() const { return &InSet; }
+ inline const LiveVarSet *getOutSet() const { return &OutSet; }
+ inline const LiveVarSet *getInSet() const { return &InSet; }
void printAllSets() const; // for printing Def/In/Out sets
void printInOutSets() const; // for printing In/Out sets