aboutsummaryrefslogtreecommitdiff
path: root/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
commit9c6cd67ea416bace666d614c84d5531124287653 (patch)
tree4a781c989c0e881e09234318323621094046e2b2 /lib/Checker/GRExprEngine.cpp
parentc09265a5fd94af5dcfd7325d0cb4f04197d65afc (diff)
Add skeleton for handling other kinds of CFGElements.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119135 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/GRExprEngine.cpp')
-rw-r--r--lib/Checker/GRExprEngine.cpp33
1 files changed, 30 insertions, 3 deletions
diff --git a/lib/Checker/GRExprEngine.cpp b/lib/Checker/GRExprEngine.cpp
index 4a1df68e5b..d57bbc2dc1 100644
--- a/lib/Checker/GRExprEngine.cpp
+++ b/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(),