Switch return site to use clang_getNullCursor().

llvm-svn: 93405
This commit is contained in:
Ted Kremenek 2010-01-14 01:51:23 +00:00
parent e1b5525510
commit e34cbde383
1 changed files with 5 additions and 5 deletions

View File

@ -971,17 +971,17 @@ CXCursor clang_getCursor(CXTranslationUnit CTUnit, const char *source_name,
FileManager &FMgr = CXXUnit->getFileManager();
const FileEntry *File = FMgr.getFile(source_name,
source_name+strlen(source_name));
if (!File) {
CXCursor C = { CXCursor_InvalidFile, 0, 0, 0 };
return C;
}
if (!File)
return clang_getNullCursor();
SourceLocation SLoc =
CXXUnit->getSourceManager().getLocation(File, line, column);
ASTLocation LastLoc = CXXUnit->getLastASTLocation();
ASTLocation ALoc = ResolveLocationInAST(CXXUnit->getASTContext(), SLoc,
&LastLoc);
// FIXME: This doesn't look thread-safe.
if (ALoc.isValid())
CXXUnit->setLastASTLocation(ALoc);