aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/ThreadSafety.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-02-23 00:29:34 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-02-23 00:29:34 +0000
commitb07805485c603be3d8011f72611465324c9e664b (patch)
tree2a1bf633a0201b748631fb8fa90fa7c2280990cc /lib/Analysis/ThreadSafety.cpp
parent02fb50d54042982bccc04c276ad2342827c8fcd3 (diff)
Remove the CFGElement "Invalid" state.
Use Optional<CFG*> where invalid states were needed previously. In the one case where that's not possible (beginAutomaticObjDtorsInsert) just use a dummy CFGAutomaticObjDtor. Thanks for the help from Jordan Rose & discussion/feedback from Ted Kremenek and Doug Gregor. Post commit code review feedback on r175796 by Ted Kremenek. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175938 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ThreadSafety.cpp')
-rw-r--r--lib/Analysis/ThreadSafety.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Analysis/ThreadSafety.cpp b/lib/Analysis/ThreadSafety.cpp
index 2e3abc07b7..7bb54d6ad3 100644
--- a/lib/Analysis/ThreadSafety.cpp
+++ b/lib/Analysis/ThreadSafety.cpp
@@ -1397,8 +1397,8 @@ static void findBlockLocations(CFG *CFGraph,
for (CFGBlock::const_reverse_iterator BI = CurrBlock->rbegin(),
BE = CurrBlock->rend(); BI != BE; ++BI) {
// FIXME: Handle other CFGElement kinds.
- if (CFGStmt CS = BI->getAs<CFGStmt>()) {
- CurrBlockInfo->ExitLoc = CS.getStmt()->getLocStart();
+ if (Optional<CFGStmt> CS = BI->getAs<CFGStmt>()) {
+ CurrBlockInfo->ExitLoc = CS->getStmt()->getLocStart();
break;
}
}
@@ -1410,8 +1410,8 @@ static void findBlockLocations(CFG *CFGraph,
for (CFGBlock::const_iterator BI = CurrBlock->begin(),
BE = CurrBlock->end(); BI != BE; ++BI) {
// FIXME: Handle other CFGElement kinds.
- if (CFGStmt CS = BI->getAs<CFGStmt>()) {
- CurrBlockInfo->EntryLoc = CS.getStmt()->getLocStart();
+ if (Optional<CFGStmt> CS = BI->getAs<CFGStmt>()) {
+ CurrBlockInfo->EntryLoc = CS->getStmt()->getLocStart();
break;
}
}
@@ -2234,8 +2234,8 @@ inline bool neverReturns(const CFGBlock* B) {
return false;
CFGElement Last = B->back();
- if (CFGStmt S = Last.getAs<CFGStmt>()) {
- if (isa<CXXThrowExpr>(S.getStmt()))
+ if (Optional<CFGStmt> S = Last.getAs<CFGStmt>()) {
+ if (isa<CXXThrowExpr>(S->getStmt()))
return true;
}
return false;