forked from OSchip/llvm-project
parent
88c46d713b
commit
e1084fa2d2
|
@ -224,6 +224,9 @@ public:
|
|||
// Statement visitors
|
||||
bool VisitStmt(Stmt *S);
|
||||
bool VisitDeclStmt(DeclStmt *S);
|
||||
// FIXME: LabelStmt label?
|
||||
bool VisitIfStmt(IfStmt *S);
|
||||
bool VisitSwitchStmt(SwitchStmt *S);
|
||||
};
|
||||
|
||||
} // end anonymous namespace
|
||||
|
@ -677,6 +680,35 @@ bool CursorVisitor::VisitDeclStmt(DeclStmt *S) {
|
|||
return false;
|
||||
}
|
||||
|
||||
bool CursorVisitor::VisitIfStmt(IfStmt *S) {
|
||||
if (VarDecl *Var = S->getConditionVariable()) {
|
||||
if (Visit(MakeCXCursor(Var, TU)))
|
||||
return true;
|
||||
} else if (S->getCond() && Visit(MakeCXCursor(S->getCond(), StmtParent, TU)))
|
||||
return true;
|
||||
|
||||
if (S->getThen() && Visit(MakeCXCursor(S->getThen(), StmtParent, TU)))
|
||||
return true;
|
||||
|
||||
if (S->getElse() && Visit(MakeCXCursor(S->getElse(), StmtParent, TU)))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CursorVisitor::VisitSwitchStmt(SwitchStmt *S) {
|
||||
if (VarDecl *Var = S->getConditionVariable()) {
|
||||
if (Visit(MakeCXCursor(Var, TU)))
|
||||
return true;
|
||||
} else if (S->getCond() && Visit(MakeCXCursor(S->getCond(), StmtParent, TU)))
|
||||
return true;
|
||||
|
||||
if (S->getBody() && Visit(MakeCXCursor(S->getBody(), StmtParent, TU)))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
CXString CIndexer::createCXString(const char *String, bool DupString){
|
||||
CXString Str;
|
||||
if (DupString) {
|
||||
|
|
Loading…
Reference in New Issue