diff options
Diffstat (limited to 'include/clang/Analysis/Analyses/LiveVariables.h')
-rw-r--r-- | include/clang/Analysis/Analyses/LiveVariables.h | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/include/clang/Analysis/Analyses/LiveVariables.h b/include/clang/Analysis/Analyses/LiveVariables.h index 21c3ba255c..0cb500fffb 100644 --- a/include/clang/Analysis/Analyses/LiveVariables.h +++ b/include/clang/Analysis/Analyses/LiveVariables.h @@ -25,7 +25,7 @@ class CFGBlock; class Stmt; class DeclRefExpr; class SourceManager; - + class LiveVariables : public ManagedAnalysis { public: class LivenessValues { @@ -34,7 +34,7 @@ public: llvm::ImmutableSet<const Stmt *> liveStmts; llvm::ImmutableSet<const VarDecl *> liveDecls; llvm::ImmutableSet<const BindingDecl *> liveBindings; - + bool equals(const LivenessValues &V) const; LivenessValues() @@ -48,21 +48,21 @@ public: bool isLive(const Stmt *S) const; bool isLive(const VarDecl *D) const; - - friend class LiveVariables; + + friend class LiveVariables; }; - + class Observer { virtual void anchor(); public: virtual ~Observer() {} - + /// A callback invoked right before invoking the /// liveness transfer function on the given statement. virtual void observeStmt(const Stmt *S, const CFGBlock *currentBlock, const LivenessValues& V) {} - + /// Called when the live variables analysis registers /// that a variable is killed. virtual void observerKill(const DeclRefExpr *DR) {} @@ -73,47 +73,47 @@ public: /// Compute the liveness information for a given CFG. static LiveVariables *computeLiveness(AnalysisDeclContext &analysisContext, bool killAtAssign); - + /// Return true if a variable is live at the end of a /// specified block. bool isLive(const CFGBlock *B, const VarDecl *D); - + /// Returns true if a variable is live at the beginning of the /// the statement. This query only works if liveness information /// has been recorded at the statement level (see runOnAllBlocks), and /// only returns liveness information for block-level expressions. bool isLive(const Stmt *S, const VarDecl *D); - + /// Returns true the block-level expression "value" is live /// before the given block-level expression (see runOnAllBlocks). bool isLive(const Stmt *Loc, const Stmt *StmtVal); - + /// Print to stderr the liveness information associated with /// each basic block. void dumpBlockLiveness(const SourceManager& M); void runOnAllBlocks(Observer &obs); - + static LiveVariables *create(AnalysisDeclContext &analysisContext) { return computeLiveness(analysisContext, true); } - + static const void *getTag(); - + private: LiveVariables(void *impl); void *impl; }; - + class RelaxedLiveVariables : public LiveVariables { public: static LiveVariables *create(AnalysisDeclContext &analysisContext) { return computeLiveness(analysisContext, false); } - + static const void *getTag(); }; - + } // end namespace clang #endif |