summaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis/SparsePropagation.h
diff options
context:
space:
mode:
authorrdivacky <rdivacky@FreeBSD.org>2009-10-14 17:57:32 +0000
committerrdivacky <rdivacky@FreeBSD.org>2009-10-14 17:57:32 +0000
commitcd749a9c07f1de2fb8affde90537efa4bc3e7c54 (patch)
treeb21f6de4e08b89bb7931806bab798fc2a5e3a686 /include/llvm/Analysis/SparsePropagation.h
parent72621d11de5b873f1695f391eb95f0b336c3d2d4 (diff)
downloadFreeBSD-src-cd749a9c07f1de2fb8affde90537efa4bc3e7c54.zip
FreeBSD-src-cd749a9c07f1de2fb8affde90537efa4bc3e7c54.tar.gz
Update llvm to r84119.
Diffstat (limited to 'include/llvm/Analysis/SparsePropagation.h')
-rw-r--r--include/llvm/Analysis/SparsePropagation.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/include/llvm/Analysis/SparsePropagation.h b/include/llvm/Analysis/SparsePropagation.h
index c75531a..820e1bd1 100644
--- a/include/llvm/Analysis/SparsePropagation.h
+++ b/include/llvm/Analysis/SparsePropagation.h
@@ -17,7 +17,6 @@
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallPtrSet.h"
-#include <iosfwd>
#include <vector>
#include <set>
@@ -31,6 +30,8 @@ namespace llvm {
class BasicBlock;
class Function;
class SparseSolver;
+ class LLVMContext;
+ class raw_ostream;
template<typename T> class SmallVectorImpl;
@@ -71,6 +72,12 @@ public:
virtual LatticeVal ComputeConstant(Constant *C) {
return getOverdefinedVal(); // always safe
}
+
+ /// IsSpecialCasedPHI - Given a PHI node, determine whether this PHI node is
+ /// one that the we want to handle through ComputeInstructionState.
+ virtual bool IsSpecialCasedPHI(PHINode *PN) {
+ return false;
+ }
/// GetConstant - If the specified lattice value is representable as an LLVM
/// constant value, return it. Otherwise return null. The returned value
@@ -99,7 +106,7 @@ public:
}
/// PrintValue - Render the specified lattice value to the specified stream.
- virtual void PrintValue(LatticeVal V, std::ostream &OS);
+ virtual void PrintValue(LatticeVal V, raw_ostream &OS);
};
@@ -113,6 +120,8 @@ class SparseSolver {
/// compute transfer functions.
AbstractLatticeFunction *LatticeFunc;
+ LLVMContext *Context;
+
DenseMap<Value*, LatticeVal> ValueState; // The state each value is in.
SmallPtrSet<BasicBlock*, 16> BBExecutable; // The bbs that are executable.
@@ -128,8 +137,8 @@ class SparseSolver {
SparseSolver(const SparseSolver&); // DO NOT IMPLEMENT
void operator=(const SparseSolver&); // DO NOT IMPLEMENT
public:
- explicit SparseSolver(AbstractLatticeFunction *Lattice)
- : LatticeFunc(Lattice) {}
+ explicit SparseSolver(AbstractLatticeFunction *Lattice, LLVMContext *C)
+ : LatticeFunc(Lattice), Context(C) {}
~SparseSolver() {
delete LatticeFunc;
}
@@ -138,7 +147,7 @@ public:
///
void Solve(Function &F);
- void Print(Function &F, std::ostream &OS) const;
+ void Print(Function &F, raw_ostream &OS) const;
/// getLatticeState - Return the LatticeVal object that corresponds to the
/// value. If an value is not in the map, it is returned as untracked,
OpenPOWER on IntegriCloud