aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis/LazyValueInfo.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/Analysis/LazyValueInfo.h')
-rw-r--r--include/llvm/Analysis/LazyValueInfo.h35
1 files changed, 28 insertions, 7 deletions
diff --git a/include/llvm/Analysis/LazyValueInfo.h b/include/llvm/Analysis/LazyValueInfo.h
index 29f8180..0553e9e 100644
--- a/include/llvm/Analysis/LazyValueInfo.h
+++ b/include/llvm/Analysis/LazyValueInfo.h
@@ -18,23 +18,44 @@
#include "llvm/Pass.h"
namespace llvm {
-
+ class Constant;
+ class TargetData;
+ class Value;
+
/// LazyValueInfo - This pass computes, caches, and vends lazy value constraint
/// information.
class LazyValueInfo : public FunctionPass {
+ class TargetData *TD;
+ void *PImpl;
public:
static char ID;
- LazyValueInfo();
+ LazyValueInfo() : FunctionPass(&ID), PImpl(0) {}
+
+ /// Tristate - This is used to return yes/no/dunno results.
+ enum Tristate {
+ Unknown = -1, No = 0, Yes = 1
+ };
+
+
+ // Public query interface.
+
+
+ /// isEqual - Determine whether the specified value is known to be equal or
+ /// not-equal to the specified constant at the end of the specified block.
+ Tristate isEqual(Value *V, Constant *C, BasicBlock *BB);
+ /// getConstant - Determine whether the specified value is known to be a
+ /// constant at the end of the specified block. Return null if not.
+ Constant *getConstant(Value *V, BasicBlock *BB);
+
+
+ // Implementation boilerplate.
+
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
}
virtual void releaseMemory();
-
- virtual bool runOnFunction(Function &F) {
- // Fully lazy.
- return false;
- }
+ virtual bool runOnFunction(Function &F);
};
} // end namespace llvm