summaryrefslogtreecommitdiffstats
path: root/clang/lib/Checker/GRExprEngine.cpp
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2010-11-15 08:48:43 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2010-11-15 08:48:43 +0000
commit5d30c69813ad18b19337f60c6fadc22508b85d1a (patch)
tree3e76ad74fbf35da9abdfc374093ef775e59abf2e /clang/lib/Checker/GRExprEngine.cpp
parentefacb9ee420add47a1c439a4a522cd0be29e987a (diff)
downloadbcm5719-llvm-5d30c69813ad18b19337f60c6fadc22508b85d1a.tar.gz
bcm5719-llvm-5d30c69813ad18b19337f60c6fadc22508b85d1a.zip
Add skeleton for handling other kinds of CFGElements.
llvm-svn: 119135
Diffstat (limited to 'clang/lib/Checker/GRExprEngine.cpp')
-rw-r--r--clang/lib/Checker/GRExprEngine.cpp33
1 files changed, 30 insertions, 3 deletions
diff --git a/clang/lib/Checker/GRExprEngine.cpp b/clang/lib/Checker/GRExprEngine.cpp
index 4a1df68e5be..d57bbc2dc11 100644
--- a/clang/lib/Checker/GRExprEngine.cpp
+++ b/clang/lib/Checker/GRExprEngine.cpp
@@ -552,8 +552,27 @@ void GRExprEngine::ProcessEndWorklist(bool hasWorkRemaining) {
}
}
-void GRExprEngine::ProcessStmt(const CFGElement CE,GRStmtNodeBuilder& builder) {
- CurrentStmt = CE.getAs<CFGStmt>();
+void GRExprEngine::ProcessElement(const CFGElement E,
+ GRStmtNodeBuilder& builder) {
+ switch (E.getKind()) {
+ case CFGElement::Statement:
+ case CFGElement::StatementAsLValue:
+ ProcessStmt(E.getAs<CFGStmt>(), builder);
+ break;
+ case CFGElement::Initializer:
+ ProcessInitializer(E.getAs<CFGInitializer>(), builder);
+ break;
+ case CFGElement::ImplicitDtor:
+ ProcessImplicitDtor(E.getAs<CFGImplicitDtor>(), builder);
+ break;
+ default:
+ // Suppress compiler warning.
+ llvm_unreachable("Unexpected CFGElement kind.");
+ }
+}
+
+void GRExprEngine::ProcessStmt(const CFGStmt S, GRStmtNodeBuilder& builder) {
+ CurrentStmt = S.getStmt();
PrettyStackTraceLoc CrashInfo(getContext().getSourceManager(),
CurrentStmt->getLocStart(),
"Error evaluating statement");
@@ -636,7 +655,7 @@ void GRExprEngine::ProcessStmt(const CFGElement CE,GRStmtNodeBuilder& builder) {
Builder->SetCleanedState(*I == EntryNode ? CleanedState : GetState(*I));
// Visit the statement.
- if (CE.getAs<CFGStmt>().asLValue())
+ if (S.asLValue())
VisitLValue(cast<Expr>(CurrentStmt), *I, Dst);
else
Visit(CurrentStmt, *I, Dst);
@@ -660,6 +679,14 @@ void GRExprEngine::ProcessStmt(const CFGElement CE,GRStmtNodeBuilder& builder) {
Builder = NULL;
}
+void GRExprEngine::ProcessInitializer(const CFGInitializer I,
+ GRStmtNodeBuilder &builder) {
+}
+
+void GRExprEngine::ProcessImplicitDtor(const CFGImplicitDtor D,
+ GRStmtNodeBuilder &builder) {
+}
+
void GRExprEngine::Visit(const Stmt* S, ExplodedNode* Pred,
ExplodedNodeSet& Dst) {
PrettyStackTraceLoc CrashInfo(getContext().getSourceManager(),
OpenPOWER on IntegriCloud