diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-02-21 22:23:56 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-02-21 22:23:56 +0000 |
commit | 7a95de68c093991047ed8d339479ccad51b88663 (patch) | |
tree | 30fb6ba3d10757a7453dab5e854dc12db3cd1168 /lib/StaticAnalyzer/Checkers/MallocChecker.cpp | |
parent | 94f3f549a7e0c426d5ffda7f25d1983c885dab9c (diff) |
Replace ProgramPoint llvm::cast support to be well-defined.
See r175462 for another example/more details.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175812 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/MallocChecker.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Checkers/MallocChecker.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/lib/StaticAnalyzer/Checkers/MallocChecker.cpp index 38722a2ed5..f412c049c7 100644 --- a/lib/StaticAnalyzer/Checkers/MallocChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/MallocChecker.cpp @@ -1117,9 +1117,9 @@ void MallocChecker::reportLeak(SymbolRef Sym, ExplodedNode *N, ProgramPoint P = AllocNode->getLocation(); const Stmt *AllocationStmt = 0; - if (CallExitEnd *Exit = dyn_cast<CallExitEnd>(&P)) + if (Optional<CallExitEnd> Exit = P.getAs<CallExitEnd>()) AllocationStmt = Exit->getCalleeContext()->getCallSite(); - else if (StmtPoint *SP = dyn_cast<StmtPoint>(&P)) + else if (Optional<StmtPoint> SP = P.getAs<StmtPoint>()) AllocationStmt = SP->getStmt(); if (AllocationStmt) LocUsedForUniqueing = PathDiagnosticLocation::createBegin(AllocationStmt, @@ -1559,11 +1559,11 @@ MallocChecker::MallocBugVisitor::VisitNode(const ExplodedNode *N, // Retrieve the associated statement. ProgramPoint ProgLoc = N->getLocation(); - if (StmtPoint *SP = dyn_cast<StmtPoint>(&ProgLoc)) { + if (Optional<StmtPoint> SP = ProgLoc.getAs<StmtPoint>()) { S = SP->getStmt(); - } else if (CallExitEnd *Exit = dyn_cast<CallExitEnd>(&ProgLoc)) { + } else if (Optional<CallExitEnd> Exit = ProgLoc.getAs<CallExitEnd>()) { S = Exit->getCalleeContext()->getCallSite(); - } else if (BlockEdge *Edge = dyn_cast<BlockEdge>(&ProgLoc)) { + } else if (Optional<BlockEdge> Edge = ProgLoc.getAs<BlockEdge>()) { // If an assumption was made on a branch, it should be caught // here by looking at the state transition. S = Edge->getSrc()->getTerminator(); |