[llvm-branch-commits] [cfe-branch] r118545 - /cfe/branches/Apple/whitney/tools/libclang/CIndex.cpp

Daniel Dunbar daniel at zuster.org
Tue Nov 9 09:30:54 PST 2010


Author: ddunbar
Date: Tue Nov  9 11:30:54 2010
New Revision: 118545

URL: http://llvm.org/viewvc/llvm-project?rev=118545&view=rev
Log:
Merge r118111:
--
Author: Ted Kremenek <kremenek at apple.com>
Date:   Tue Nov 2 23:17:51 2010 +0000

    Don't add Decls with an invalid location to DeclsInContainer.

Modified:
    cfe/branches/Apple/whitney/tools/libclang/CIndex.cpp

Modified: cfe/branches/Apple/whitney/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/tools/libclang/CIndex.cpp?rev=118545&r1=118544&r2=118545&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/tools/libclang/CIndex.cpp (original)
+++ cfe/branches/Apple/whitney/tools/libclang/CIndex.cpp Tue Nov  9 11:30:54 2010
@@ -868,7 +868,8 @@
   for (DeclContext::decl_iterator I = D->decls_begin(), E = D->decls_end();
        I!=E; ++I) {
     Decl *subDecl = *I;
-    if (!subDecl || subDecl->getLexicalDeclContext() != D)
+    if (!subDecl || subDecl->getLexicalDeclContext() != D ||
+        subDecl->getLocStart().isInvalid())
       continue;
     DeclsInContainer.push_back(subDecl);
   }





More information about the llvm-branch-commits mailing list