diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-07-02 20:21:52 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-07-02 20:21:52 +0000 |
commit | de21a1c964a0afc9846baeca4b1cb1c85d223708 (patch) | |
tree | 859939fcd767602985b4227e4490c9c18c81739f /clang/lib/Analysis/LiveVariables.cpp | |
parent | 146ef384da1428eaab5c0979418aa0daef3ed45e (diff) | |
download | bcm5719-llvm-de21a1c964a0afc9846baeca4b1cb1c85d223708.tar.gz bcm5719-llvm-de21a1c964a0afc9846baeca4b1cb1c85d223708.zip |
Bail out the LiveVariables analysis when the CFG is very large, as
we are encountering some scalability issues with memory usage. The
appropriate long term fix is to make the analysis more scalable, but
this will at least prevent the analyzer swapping when
analyzing very large functions.
llvm-svn: 159578
Diffstat (limited to 'clang/lib/Analysis/LiveVariables.cpp')
-rw-r--r-- | clang/lib/Analysis/LiveVariables.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Analysis/LiveVariables.cpp b/clang/lib/Analysis/LiveVariables.cpp index ff6607d51aa..6e10ac10927 100644 --- a/clang/lib/Analysis/LiveVariables.cpp +++ b/clang/lib/Analysis/LiveVariables.cpp @@ -486,6 +486,11 @@ LiveVariables::computeLiveness(AnalysisDeclContext &AC, if (!cfg) return 0; + // The analysis currently has scalability issues for very large CFGs. + // Bail out if it looks too large. + if (cfg->getNumBlockIDs() > 300000) + return 0; + LiveVariablesImpl *LV = new LiveVariablesImpl(AC, killAtAssign); // Construct the dataflow worklist. Enqueue the exit block as the |