summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/GRExprEngine.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-04-30 17:54:04 +0000
committerTed Kremenek <kremenek@apple.com>2008-04-30 17:54:04 +0000
commit5ce35cc51402b4c0114d0960165fe6b9d0e89ac9 (patch)
tree05b72bc12c654a4bdc3e5b9afeefb1912567947b /clang/lib/Analysis/GRExprEngine.cpp
parent39a736f7231198b4dd811f17b7324d893c550f2e (diff)
downloadbcm5719-llvm-5ce35cc51402b4c0114d0960165fe6b9d0e89ac9.tar.gz
bcm5719-llvm-5ce35cc51402b4c0114d0960165fe6b9d0e89ac9.zip
Add conjured symbols for decl initializations.
Add db_error as panic function. llvm-svn: 50489
Diffstat (limited to 'clang/lib/Analysis/GRExprEngine.cpp')
-rw-r--r--clang/lib/Analysis/GRExprEngine.cpp25
1 files changed, 22 insertions, 3 deletions
diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp
index d9a2313aa18..770a133ba73 100644
--- a/clang/lib/Analysis/GRExprEngine.cpp
+++ b/clang/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
OpenPOWER on IntegriCloud