summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/AnalysisContext.cpp
diff options
context:
space:
mode:
authorTom Care <tom.care@uqconnect.edu.au>2010-08-27 22:30:10 +0000
committerTom Care <tom.care@uqconnect.edu.au>2010-08-27 22:30:10 +0000
commite5aa30c722a7e5ffec1372c2a863a54bfd558850 (patch)
tree4c56e05e1237f2eeec27c9d499c4bfe646a84cbd /clang/lib/Analysis/AnalysisContext.cpp
parentf2855b147fc5015c11d950f7be9b777727be0468 (diff)
downloadbcm5719-llvm-e5aa30c722a7e5ffec1372c2a863a54bfd558850.tar.gz
bcm5719-llvm-e5aa30c722a7e5ffec1372c2a863a54bfd558850.zip
Add alternate version of LiveVariables analysis that does not kill liveness at assignments. This 'relaxed' liveness is useful in path sensitive analysis for situations where the resulting extended liveness allows us to find some bugs.
- Added killAtAssign flag to LiveVariables - Added relaxed LiveVariables to AnalysisContext with an accessor llvm-svn: 112306
Diffstat (limited to 'clang/lib/Analysis/AnalysisContext.cpp')
-rw-r--r--clang/lib/Analysis/AnalysisContext.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/lib/Analysis/AnalysisContext.cpp b/clang/lib/Analysis/AnalysisContext.cpp
index 2c337f07c3c..884cbc65f4b 100644
--- a/clang/lib/Analysis/AnalysisContext.cpp
+++ b/clang/lib/Analysis/AnalysisContext.cpp
@@ -104,6 +104,20 @@ LiveVariables *AnalysisContext::getLiveVariables() {
return liveness;
}
+LiveVariables *AnalysisContext::getRelaxedLiveVariables() {
+ if (!relaxedLiveness) {
+ CFG *c = getCFG();
+ if (!c)
+ return 0;
+
+ relaxedLiveness = new LiveVariables(*this, false);
+ relaxedLiveness->runOnCFG(*c);
+ relaxedLiveness->runOnAllBlocks(*c, 0, true);
+ }
+
+ return relaxedLiveness;
+}
+
AnalysisContext *AnalysisContextManager::getContext(const Decl *D,
idx::TranslationUnit *TU) {
AnalysisContext *&AC = Contexts[D];
OpenPOWER on IntegriCloud