[cfe-commits] r93405 - /cfe/trunk/tools/CIndex/CIndex.cpp

Ted Kremenek kremenek at apple.com
Wed Jan 13 17:51:23 PST 2010


Author: kremenek
Date: Wed Jan 13 19:51:23 2010
New Revision: 93405

URL: http://llvm.org/viewvc/llvm-project?rev=93405&view=rev
Log:
Switch return site to use clang_getNullCursor().

Modified:
    cfe/trunk/tools/CIndex/CIndex.cpp

Modified: cfe/trunk/tools/CIndex/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndex.cpp?rev=93405&r1=93404&r2=93405&view=diff

==============================================================================
--- cfe/trunk/tools/CIndex/CIndex.cpp (original)
+++ cfe/trunk/tools/CIndex/CIndex.cpp Wed Jan 13 19:51:23 2010
@@ -971,17 +971,17 @@
   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);
 





More information about the cfe-commits mailing list