forked from OSchip/llvm-project
AnalysisManager can now be used to for analyses over TranslationUnits.
llvm-svn: 58766
This commit is contained in:
parent
f53d7ff870
commit
b4ebbc5a86
|
@ -112,8 +112,11 @@ namespace {
|
||||||
|
|
||||||
|
|
||||||
class VISIBILITY_HIDDEN AnalysisManager : public BugReporterData {
|
class VISIBILITY_HIDDEN AnalysisManager : public BugReporterData {
|
||||||
Decl* D;
|
Decl* D; Stmt* Body;
|
||||||
Stmt* Body;
|
TranslationUnit* TU;
|
||||||
|
|
||||||
|
enum AnalysisScope { ScopeTU, ScopeDecl } AScope;
|
||||||
|
|
||||||
AnalysisConsumer& C;
|
AnalysisConsumer& C;
|
||||||
bool DisplayedFunction;
|
bool DisplayedFunction;
|
||||||
|
|
||||||
|
@ -123,11 +126,25 @@ namespace {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AnalysisManager(AnalysisConsumer& c, Decl* d, Stmt* b)
|
AnalysisManager(AnalysisConsumer& c, Decl* d, Stmt* b)
|
||||||
: D(d), Body(b), C(c), DisplayedFunction(false) {}
|
: D(d), Body(b), TU(0), AScope(ScopeDecl), C(c), DisplayedFunction(false) {}
|
||||||
|
|
||||||
|
AnalysisManager(AnalysisConsumer& c, TranslationUnit* tu)
|
||||||
|
: D(0), Body(0), TU(tu), AScope(ScopeTU), C(c), DisplayedFunction(false) {}
|
||||||
|
|
||||||
Decl* getCodeDecl() const { return D; }
|
Decl* getCodeDecl() const {
|
||||||
Stmt* getBody() const { return Body; }
|
assert (AScope == ScopeDecl);
|
||||||
|
return D;
|
||||||
|
}
|
||||||
|
|
||||||
|
Stmt* getBody() const {
|
||||||
|
assert (AScope == ScopeDecl);
|
||||||
|
return Body;
|
||||||
|
}
|
||||||
|
|
||||||
|
TranslationUnit* getTranslationUnit() const {
|
||||||
|
assert (AScope == ScopeTU);
|
||||||
|
return TU;
|
||||||
|
}
|
||||||
|
|
||||||
GRStateManager::StoreManagerCreator getStoreManagerCreator() {
|
GRStateManager::StoreManagerCreator getStoreManagerCreator() {
|
||||||
switch (C.SM) {
|
switch (C.SM) {
|
||||||
|
|
Loading…
Reference in New Issue