summaryrefslogtreecommitdiff
path: root/include/llvm
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 /include/llvm
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 'include/llvm')
-rw-r--r--include/llvm/Analysis/LiveVar/FunctionLiveVarInfo.h29
-rw-r--r--include/llvm/Analysis/LiveVar/LiveVarMap.h24
-rw-r--r--include/llvm/CodeGen/FunctionLiveVarInfo.h29
3 files changed, 26 insertions, 56 deletions
diff --git a/include/llvm/Analysis/LiveVar/FunctionLiveVarInfo.h b/include/llvm/Analysis/LiveVar/FunctionLiveVarInfo.h
index d126b6e03e..05723748d8 100644
--- a/include/llvm/Analysis/LiveVar/FunctionLiveVarInfo.h
+++ b/include/llvm/Analysis/LiveVar/FunctionLiveVarInfo.h
@@ -67,19 +67,20 @@
static const int DEBUG_LV = 0;
-#include "llvm/Analysis/LiveVar/BBLiveVar.h"
#include "llvm/Pass.h"
+class BBLiveVar;
+class MachineInstr;
+class LiveVarSet;
class MethodLiveVarInfo : public MethodPass {
-
- // A map betwn the BasicBlock and BBLiveVar
- BBToBBLiveVarMapType BB2BBLVMap;
+ // A map between the BasicBlock and BBLiveVar
+ std::map<const BasicBlock *, BBLiveVar *> BB2BBLVMap;
// Machine Instr to LiveVarSet Map for providing LVset BEFORE each inst
- MInstToLiveVarSetMapType MInst2LVSetBI;
+ std::map<const MachineInstr *, const LiveVarSet *> MInst2LVSetBI;
// Machine Instr to LiveVarSet Map for providing LVset AFTER each inst
- MInstToLiveVarSetMapType MInst2LVSetAI;
+ std::map<const MachineInstr *, const LiveVarSet *> MInst2LVSetAI;
// --------- private methods -----------------------------------------
@@ -118,22 +119,18 @@ public:
// --------- Functions to access analysis results -------------------
// gets OutSet of a BB
- inline const LiveVarSet *getOutSetOfBB( const BasicBlock *BB) const {
- return BB2BBLVMap.find(BB)->second->getOutSet();
- }
+ const LiveVarSet *getOutSetOfBB(const BasicBlock *BB) const;
// gets InSet of a BB
- inline const LiveVarSet *getInSetOfBB( const BasicBlock *BB) const {
- return BB2BBLVMap.find(BB)->second->getInSet();
- }
+ const LiveVarSet *getInSetOfBB(const BasicBlock *BB) const;
// gets the Live var set BEFORE an instruction
- const LiveVarSet * getLiveVarSetBeforeMInst(const MachineInstr *Inst,
- const BasicBlock *CurBB);
+ const LiveVarSet *getLiveVarSetBeforeMInst(const MachineInstr *MI,
+ const BasicBlock *BB);
// gets the Live var set AFTER an instruction
- const LiveVarSet * getLiveVarSetAfterMInst(const MachineInstr *MInst,
- const BasicBlock *CurBB);
+ const LiveVarSet *getLiveVarSetAfterMInst(const MachineInstr *MI,
+ const BasicBlock *BB);
};
#endif
diff --git a/include/llvm/Analysis/LiveVar/LiveVarMap.h b/include/llvm/Analysis/LiveVar/LiveVarMap.h
index a9e170170f..e69de29bb2 100644
--- a/include/llvm/Analysis/LiveVar/LiveVarMap.h
+++ b/include/llvm/Analysis/LiveVar/LiveVarMap.h
@@ -1,24 +0,0 @@
-/* Title: LiveVarMap.h -*- C++ -*-
- Author: Ruchira Sasanka
- Date: Jun 30, 01
- Purpose: This file contains the class for a map between the BasicBlock class
- and the BBLiveVar class, which is a wrapper class of BasicBlock
- used for the live variable analysis. The reverse mapping can
- be found in the BBLiveVar class (It has a pointer to the
- corresponding BasicBlock)
-*/
-
-#ifndef LIVE_VAR_MAP_H
-#define LIVE_VAR_MAP_H
-
-#include "Support/HashExtras.h"
-
-class MachineInstr;
-class BasicBlock;
-class BBLiveVar;
-class LiveVarSet;
-
-typedef std::hash_map<const BasicBlock *, BBLiveVar *> BBToBBLiveVarMapType;
-typedef std::hash_map<const MachineInstr *, const LiveVarSet *> MInstToLiveVarSetMapType;
-
-#endif
diff --git a/include/llvm/CodeGen/FunctionLiveVarInfo.h b/include/llvm/CodeGen/FunctionLiveVarInfo.h
index d126b6e03e..05723748d8 100644
--- a/include/llvm/CodeGen/FunctionLiveVarInfo.h
+++ b/include/llvm/CodeGen/FunctionLiveVarInfo.h
@@ -67,19 +67,20 @@
static const int DEBUG_LV = 0;
-#include "llvm/Analysis/LiveVar/BBLiveVar.h"
#include "llvm/Pass.h"
+class BBLiveVar;
+class MachineInstr;
+class LiveVarSet;
class MethodLiveVarInfo : public MethodPass {
-
- // A map betwn the BasicBlock and BBLiveVar
- BBToBBLiveVarMapType BB2BBLVMap;
+ // A map between the BasicBlock and BBLiveVar
+ std::map<const BasicBlock *, BBLiveVar *> BB2BBLVMap;
// Machine Instr to LiveVarSet Map for providing LVset BEFORE each inst
- MInstToLiveVarSetMapType MInst2LVSetBI;
+ std::map<const MachineInstr *, const LiveVarSet *> MInst2LVSetBI;
// Machine Instr to LiveVarSet Map for providing LVset AFTER each inst
- MInstToLiveVarSetMapType MInst2LVSetAI;
+ std::map<const MachineInstr *, const LiveVarSet *> MInst2LVSetAI;
// --------- private methods -----------------------------------------
@@ -118,22 +119,18 @@ public:
// --------- Functions to access analysis results -------------------
// gets OutSet of a BB
- inline const LiveVarSet *getOutSetOfBB( const BasicBlock *BB) const {
- return BB2BBLVMap.find(BB)->second->getOutSet();
- }
+ const LiveVarSet *getOutSetOfBB(const BasicBlock *BB) const;
// gets InSet of a BB
- inline const LiveVarSet *getInSetOfBB( const BasicBlock *BB) const {
- return BB2BBLVMap.find(BB)->second->getInSet();
- }
+ const LiveVarSet *getInSetOfBB(const BasicBlock *BB) const;
// gets the Live var set BEFORE an instruction
- const LiveVarSet * getLiveVarSetBeforeMInst(const MachineInstr *Inst,
- const BasicBlock *CurBB);
+ const LiveVarSet *getLiveVarSetBeforeMInst(const MachineInstr *MI,
+ const BasicBlock *BB);
// gets the Live var set AFTER an instruction
- const LiveVarSet * getLiveVarSetAfterMInst(const MachineInstr *MInst,
- const BasicBlock *CurBB);
+ const LiveVarSet *getLiveVarSetAfterMInst(const MachineInstr *MI,
+ const BasicBlock *BB);
};
#endif