00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef LLVM_ANALYSIS_LIVEVALUES_H
00016 #define LLVM_ANALYSIS_LIVEVALUES_H
00017
00018 #include "llvm/Pass.h"
00019
00020 namespace llvm {
00021 class Constant;
00022 class TargetData;
00023 class Value;
00024
00027 class LazyValueInfo : public FunctionPass {
00028 class TargetData *TD;
00029 void *PImpl;
00030 LazyValueInfo(const LazyValueInfo&);
00031 void operator=(const LazyValueInfo&);
00032 public:
00033 static char ID;
00034 LazyValueInfo() : FunctionPass(&ID), PImpl(0) {}
00035 ~LazyValueInfo() { assert(PImpl == 0 && "releaseMemory not called"); }
00036
00038 enum Tristate {
00039 Unknown = -1, False = 0, True = 1
00040 };
00041
00042
00043
00044
00048 Tristate getPredicateOnEdge(unsigned Pred, Value *V, Constant *C,
00049 BasicBlock *FromBB, BasicBlock *ToBB);
00050
00051
00054 Constant *getConstant(Value *V, BasicBlock *BB);
00055
00058 Constant *getConstantOnEdge(Value *V, BasicBlock *FromBB, BasicBlock *ToBB);
00059
00060
00061
00062
00063 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
00064 AU.setPreservesAll();
00065 }
00066 virtual void releaseMemory();
00067 virtual bool runOnFunction(Function &F);
00068 };
00069
00070 }
00071
00072 #endif
00073