diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-04-30 17:54:04 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-04-30 17:54:04 +0000 |
commit | f47bb7851edac9919f632271fb7dc96b17e1dae0 (patch) | |
tree | 211d7d886075ea4899f44b42ea7ebe554624ebd1 /lib/Analysis/GRExprEngine.cpp | |
parent | c3b7f0ec5db97dcc43cac83496a00ff1adcc9b5a (diff) |
Add conjured symbols for decl initializations.
Add db_error as panic function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@50489 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/GRExprEngine.cpp')
-rw-r--r-- | lib/Analysis/GRExprEngine.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp index d9a2313aa1..770a133ba7 100644 --- a/lib/Analysis/GRExprEngine.cpp +++ b/lib/Analysis/GRExprEngine.cpp @@ -1046,6 +1046,10 @@ void GRExprEngine::VisitCall(CallExpr* CE, NodeTy* Pred, if (!memcmp(s, "assfail", 7)) Builder->BuildSinks = true; break; + case 8: + if (!memcmp(s ,"db_error", 8)) Builder->BuildSinks = true; + break; + case 14: if (!memcmp(s, "dtrace_assfail", 14)) Builder->BuildSinks = true; break; @@ -1375,9 +1379,24 @@ void GRExprEngine::VisitDeclStmtAux(DeclStmt* DS, ScopedDecl* D, QualType T = VD->getType(); - if (T->isPointerType() || T->isIntegerType()) - St = SetRVal(St, lval::DeclVal(VD), - Ex ? GetRVal(St, Ex) : UndefinedVal()); + if (T->isPointerType() || T->isIntegerType()) { + + RVal V = Ex ? GetRVal(St, Ex) : UndefinedVal(); + + if (Ex && V.isUnknown()) { + + // EXPERIMENTAL: "Conjured" symbols. + + unsigned Count = Builder->getCurrentBlockCount(); + SymbolID Sym = SymMgr.getConjuredSymbol(Ex, Count); + + V = Ex->getType()->isPointerType() + ? cast<RVal>(lval::SymbolVal(Sym)) + : cast<RVal>(nonlval::SymbolVal(Sym)); + } + + St = SetRVal(St, lval::DeclVal(VD), V); + } } // Create a new node. We don't really need to create a new NodeSet |