<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Doug,<div>This commit is causing failures on our internal buildbots with the following error:</div><div><span class="Apple-style-span" style="font-family: Times; "><pre style="font-family: 'Courier New', courier, monotype; "><span class="stdout" style="font-family: 'Courier New', courier, monotype; color: black; ">llvm[4]: Compiling IndexingContext.cpp for Release+Asserts build (PIC)
</span><span class="stderr" style="font-family: 'Courier New', courier, monotype; color: red; ">/Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin10-gcc42-RA/llvm/tools/clang/tools/libclang/IndexBody.cpp:109:18: error: no member named 'indexFunctionLocalSymbols' in 'clang::cxindex::IndexingContext'; did you mean 'shouldIndexFunctionLocalSymbols'?
    if (IndexCtx.indexFunctionLocalSymbols())
                 ^~~~~~~~~~~~~~~~~~~~~~~~~
                 shouldIndexFunctionLocalSymbols
/Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin10-gcc42-RA/llvm/tools/clang/tools/libclang/IndexingContext.h:329:8: note: 'shouldIndexFunctionLocalSymbols' declared here
  bool shouldIndexFunctionLocalSymbols() const {
       ^
1 error generated.
make[4]: *** [/Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin10-gcc42-RA/clang-build/tools/clang/tools/libclang/Release+Asserts/IndexBody.o] Error 1</span></pre></span></div><div>See also:</div><div><a href="http://smooshlab.apple.com:8013/builders/clang-x86_64-darwin10-gcc42-RA/builds/11827">http://smooshlab.apple.com:8013/builders/clang-x86_64-darwin10-gcc42-RA/builds/11827</a></div><div><br></div><div>Chad</div><div><br><div><div>On Feb 14, 2012, at 4:54 PM, Douglas Gregor wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Author: dgregor<br>Date: Tue Feb 14 18:54:55 2012<br>New Revision: 150549<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=150549&view=rev">http://llvm.org/viewvc/llvm-project?rev=150549&view=rev</a><br>Log:<br>Implement indexing support for lambdas in libclang (both kinds), as<br>well as improving the RecursiveASTVisitor's walk of lambda<br>expressions.<br><br>Added:<br>    cfe/trunk/test/Index/cxx11-lambdas.cpp<br>Modified:<br>    cfe/trunk/include/clang-c/Index.h<br>    cfe/trunk/include/clang/AST/RecursiveASTVisitor.h<br>    cfe/trunk/tools/libclang/CIndex.cpp<br>    cfe/trunk/tools/libclang/CXCursor.cpp<br>    cfe/trunk/tools/libclang/CXCursor.h<br>    cfe/trunk/tools/libclang/CXType.cpp<br>    cfe/trunk/tools/libclang/CursorVisitor.h<br>    cfe/trunk/tools/libclang/IndexBody.cpp<br>    cfe/trunk/tools/libclang/IndexingContext.cpp<br><br>Modified: cfe/trunk/include/clang-c/Index.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/Index.h?rev=150549&r1=150548&r2=150549&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/Index.h?rev=150549&r1=150548&r2=150549&view=diff</a><br>==============================================================================<br>--- cfe/trunk/include/clang-c/Index.h (original)<br>+++ cfe/trunk/include/clang-c/Index.h Tue Feb 14 18:54:55 2012<br>@@ -1500,7 +1500,13 @@<br>    */<br>   CXCursor_OverloadedDeclRef             = 49,<br><br>-  CXCursor_LastRef                       = CXCursor_OverloadedDeclRef,<br>+  /**<br>+   * \brief A reference to a variable that occurs in some non-expression <br>+   * context, e.g., a C++ lambda capture list.<br>+   */<br>+  CXCursor_VariableRef                   = 50,<br>+  <br>+  CXCursor_LastRef                       = CXCursor_VariableRef,<br><br>   /* Error conditions */<br>   CXCursor_FirstInvalid                  = 70,<br>@@ -1746,7 +1752,21 @@<br>    */<br>   CXCursor_SizeOfPackExpr                = 143,<br><br>-  CXCursor_LastExpr                      = CXCursor_SizeOfPackExpr,<br>+  /* \brief Represents a C++ lambda expression that produces a local function<br>+   * object.<br>+   *<br>+   * \code<br>+   * void abssort(float *x, unsigned N) {<br>+   *   std::sort(x, x + N,<br>+   *             [](float a, float b) {<br>+   *               return std::abs(a) < std::abs(b);<br>+   *             });<br>+   * }<br>+   * \endcode<br>+   */<br>+  CXCursor_LambdaExpr                    = 144,<br>+  <br>+  CXCursor_LastExpr                      = CXCursor_LambdaExpr,<br><br>   /* Statements */<br>   CXCursor_FirstStmt                     = 200,<br><br>Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=150549&r1=150548&r2=150549&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=150549&r1=150548&r2=150549&view=diff</a><br>==============================================================================<br>--- cfe/trunk/include/clang/AST/RecursiveASTVisitor.h (original)<br>+++ cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Tue Feb 14 18:54:55 2012<br>@@ -228,6 +228,11 @@<br>   /// \returns false if the visitation was terminated early, true otherwise.<br>   bool TraverseConstructorInitializer(CXXCtorInitializer *Init);<br><br>+  /// \brief Recursively visit a lambda capture.<br>+  ///<br>+  /// \returns false if the visitation was terminated early, true otherwise.<br>+  bool TraverseLambdaCapture(LambdaExpr::Capture C);<br>+  <br>   // ---- Methods on Stmts ----<br><br>   // Declare Traverse*() for all concrete Stmt classes.<br>@@ -675,6 +680,10 @@<br>   return true;<br> }<br><br>+template<typename Derived><br>+bool RecursiveASTVisitor<Derived>::TraverseLambdaCapture(LambdaExpr::Capture C){<br>+  return true;<br>+}<br><br> // ----------------- Type traversal -----------------<br><br>@@ -1953,9 +1962,36 @@<br>     TRY_TO(TraverseTypeLoc(S->getTypeSourceInfo()->getTypeLoc()));<br>   })<br><br>-DEF_TRAVERSE_STMT(LambdaExpr, {<br>-    TRY_TO(TraverseStmt(S->getBody()));<br>-  })<br>+// Walk only the visible parts of lambda expressions.  <br>+template<typename Derived><br>+bool RecursiveASTVisitor<Derived>::TraverseLambdaExpr(LambdaExpr *S) {<br>+  for (LambdaExpr::capture_iterator C = S->explicit_capture_begin(),<br>+                                 CEnd = S->explicit_capture_end();<br>+       C != CEnd; ++C) {<br>+    TRY_TO(TraverseLambdaCapture(*C));<br>+  }<br>+<br>+  if (S->hasExplicitParameters() || S->hasExplicitResultType()) {<br>+    TypeLoc TL = S->getCallOperator()->getTypeSourceInfo()->getTypeLoc();<br>+    if (S->hasExplicitParameters() && S->hasExplicitResultType()) {<br>+      // Visit the whole type.<br>+      TRY_TO(TraverseTypeLoc(TL));<br>+    } else if (isa<FunctionProtoTypeLoc>(TL)) {<br>+      FunctionProtoTypeLoc Proto = cast<FunctionProtoTypeLoc>(TL);<br>+      if (S->hasExplicitParameters()) {<br>+        // Visit parameters.<br>+        for (unsigned I = 0, N = Proto.getNumArgs(); I != N; ++I) {<br>+          TRY_TO(TraverseDecl(Proto.getArg(I)));<br>+        }<br>+      } else {<br>+        TRY_TO(TraverseTypeLoc(Proto.getResultLoc()));<br>+      }        <br>+    }<br>+  }<br>+<br>+  TRY_TO(TraverseStmt(S->getBody()));<br>+  return true;<br>+}<br><br> DEF_TRAVERSE_STMT(CXXUnresolvedConstructExpr, {<br>     // This is called for code like 'T()', where T is a template argument.<br><br>Added: cfe/trunk/test/Index/cxx11-lambdas.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/cxx11-lambdas.cpp?rev=150549&view=auto">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/cxx11-lambdas.cpp?rev=150549&view=auto</a><br>==============================================================================<br>--- cfe/trunk/test/Index/cxx11-lambdas.cpp (added)<br>+++ cfe/trunk/test/Index/cxx11-lambdas.cpp Tue Feb 14 18:54:55 2012<br>@@ -0,0 +1,33 @@<br>+// Test is line- and column-sensitive; see below.<br>+<br>+typedef int Integer;<br>+struct X {<br>+  void f() {<br>+    int localA, localB;<br>+    auto lambda = [&localA, localB] (Integer x) -> Integer {<br>+      return localA + localB + x;<br>+    };<br>+  }<br>+};<br>+<br>+// RUN: c-index-test -test-load-source all -std=c++11 %s | FileCheck -check-prefix=CHECK-LOAD %s<br>+// CHECK-LOAD: cxx11-lambdas.cpp:7:19: LambdaExpr= Extent=[7:19 - 9:6]<br>+// CHECK-LOAD: cxx11-lambdas.cpp:7:21: VariableRef=localA:6:9 Extent=[7:21 - 7:27]<br>+// CHECK-LOAD: cxx11-lambdas.cpp:7:29: VariableRef=localB:6:17 Extent=[7:29 - 7:35]<br>+// CHECK-LOAD: cxx11-lambdas.cpp:7:52: TypeRef=Integer:3:13 Extent=[7:52 - 7:59]<br>+// CHECK-LOAD: cxx11-lambdas.cpp:7:46: ParmDecl=x:7:46 (Definition) Extent=[7:38 - 7:47]<br>+// CHECK-LOAD: cxx11-lambdas.cpp:7:38: TypeRef=Integer:3:13 Extent=[7:38 - 7:45]<br>+// CHECK-LOAD: cxx11-lambdas.cpp:7:60: CompoundStmt= Extent=[7:60 - 9:6]<br>+// CHECK-LOAD: cxx11-lambdas.cpp:8:7: ReturnStmt= Extent=[8:7 - 8:33]<br>+// CHECK-LOAD: cxx11-lambdas.cpp:8:14: DeclRefExpr=localA:6:9 Extent=[8:14 - 8:20]<br>+// CHECK-LOAD: cxx11-lambdas.cpp:8:23: DeclRefExpr=localB:6:17 Extent=[8:23 - 8:29]<br>+// CHECK-LOAD: cxx11-lambdas.cpp:8:32: DeclRefExpr=x:7:46 Extent=[8:32 - 8:33]<br>+<br>+// RUN: env CINDEXTEST_INDEXLOCALSYMBOLS=1 c-index-test -index-file -std=c++11 %s | FileCheck -check-prefix=CHECK-INDEX %s<br>+// CHECK-INDEX: [indexEntityReference]: kind: variable | name: localA | USR: c:cxx11-lambdas.cpp@100@S@X@F@f#@localA | lang: C | cursor: VariableRef=localA:6:9 | loc: 7:21<br>+// CHECK-INDEX: [indexEntityReference]: kind: variable | name: localB | USR: c:cxx11-lambdas.cpp@100@S@X@F@f#@localB | lang: C | cursor: VariableRef=localB:6:17 | loc: 7:29<br>+// CHECK-INDEX: [indexEntityReference]: kind: typedef | name: Integer | USR: c:cxx11-lambdas.cpp@51@T@Integer | lang: C | cursor: TypeRef=Integer:3:13 | loc: 7:52<br>+// CHECK-INDEX: [indexEntityReference]: kind: typedef | name: Integer | USR: c:cxx11-lambdas.cpp@51@T@Integer | lang: C | cursor: TypeRef=Integer:3:13 | loc: 7:38<br>+// CHECK-INDEX: [indexEntityReference]: kind: variable | name: localA | USR: c:cxx11-lambdas.cpp@100@S@X@F@f#@localA | lang: C | cursor: DeclRefExpr=localA:6:9 | loc: 8:14<br>+// CHECK-INDEX: [indexEntityReference]: kind: variable | name: localB | USR: c:cxx11-lambdas.cpp@100@S@X@F@f#@localB | lang: C | cursor: DeclRefExpr=localB:6:17 | loc: 8:23<br>+// CHECK-INDEX: [indexEntityReference]: kind: variable | name: x | USR: c:cxx11-lambdas.cpp@157@S@X@F@f#@Ca@F@operator()#I#1@x | lang: C | cursor: DeclRefExpr=x:7:46 | loc: 8:32<br><br>Modified: cfe/trunk/tools/libclang/CIndex.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=150549&r1=150548&r2=150549&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=150549&r1=150548&r2=150549&view=diff</a><br>==============================================================================<br>--- cfe/trunk/tools/libclang/CIndex.cpp (original)<br>+++ cfe/trunk/tools/libclang/CIndex.cpp Tue Feb 14 18:54:55 2012<br>@@ -1615,6 +1615,7 @@<br> DEF_JOB(ExplicitTemplateArgsVisit, ASTTemplateArgumentListInfo, <br>         ExplicitTemplateArgsVisitKind)<br> DEF_JOB(SizeOfPackExprParts, SizeOfPackExpr, SizeOfPackExprPartsKind)<br>+DEF_JOB(LambdaExprParts, LambdaExpr, LambdaExprPartsKind)<br> #undef DEF_JOB<br><br> class DeclVisit : public VisitorJob {<br>@@ -1761,6 +1762,7 @@<br>   void VisitSizeOfPackExpr(SizeOfPackExpr *E);<br>   void VisitPseudoObjectExpr(PseudoObjectExpr *E);<br>   void VisitOpaqueValueExpr(OpaqueValueExpr *E);<br>+  void VisitLambdaExpr(LambdaExpr *E);<br><br> private:<br>   void AddDeclarationNameInfo(Stmt *S);<br>@@ -2081,6 +2083,10 @@<br>   if (Expr *SourceExpr = E->getSourceExpr())<br>     return Visit(SourceExpr);<br> }<br>+void EnqueueVisitor::VisitLambdaExpr(LambdaExpr *E) {<br>+  AddStmt(E->getBody());<br>+  WL.push_back(LambdaExprParts(E, Parent));<br>+}<br> void EnqueueVisitor::VisitPseudoObjectExpr(PseudoObjectExpr *E) {<br>   // Treat the expression like its syntactic form.<br>   Visit(E->getSyntacticForm());<br>@@ -2258,6 +2264,45 @@<br>         // treated like DeclRefExpr cursors.<br>         continue;<br>       }<br>+        <br>+      case VisitorJob::LambdaExprPartsKind: {<br>+        // Visit captures.<br>+        LambdaExpr *E = cast<LambdaExprParts>(&LI)->get();<br>+        for (LambdaExpr::capture_iterator C = E->explicit_capture_begin(),<br>+                                       CEnd = E->explicit_capture_end();<br>+             C != CEnd; ++C) {<br>+          if (C->capturesThis())<br>+            continue;<br>+          <br>+          if (Visit(MakeCursorVariableRef(C->getCapturedVar(),<br>+                                          C->getLocation(),<br>+                                          TU)))<br>+            return true;<br>+        }<br>+        <br>+        // Visit parameters and return type, if present.<br>+        if (E->hasExplicitParameters() || E->hasExplicitResultType()) {<br>+          TypeLoc TL = E->getCallOperator()->getTypeSourceInfo()->getTypeLoc();<br>+          if (E->hasExplicitParameters() && E->hasExplicitResultType()) {<br>+            // Visit the whole type.<br>+            if (Visit(TL))<br>+              return true;<br>+          } else if (isa<FunctionProtoTypeLoc>(TL)) {<br>+            FunctionProtoTypeLoc Proto = cast<FunctionProtoTypeLoc>(TL);<br>+            if (E->hasExplicitParameters()) {<br>+              // Visit parameters.<br>+              for (unsigned I = 0, N = Proto.getNumArgs(); I != N; ++I)<br>+                if (Visit(MakeCXCursor(Proto.getArg(I), TU)))<br>+                  return true;<br>+            } else {<br>+              // Visit result type.<br>+              if (Visit(Proto.getResultLoc()))<br>+                return true;<br>+            }<br>+          }<br>+        }<br>+        break;<br>+      }<br>     }<br>   }<br>   return false;<br>@@ -2980,6 +3025,13 @@<br>       return createCXString((*Ovl->begin())->getNameAsString());<br>     }<br><br>+    case CXCursor_VariableRef: {<br>+      VarDecl *Var = getCursorVariableRef(C).first;<br>+      assert(Var && "Missing variable decl");<br>+      <br>+      return createCXString(Var->getNameAsString());<br>+    }<br>+        <br>     default:<br>       return createCXString("<not implemented>");<br>     }<br>@@ -3173,6 +3225,8 @@<br>     return createCXString("LabelRef");<br>   case CXCursor_OverloadedDeclRef:<br>     return createCXString("OverloadedDeclRef");<br>+  case CXCursor_VariableRef:<br>+    return createCXString("VariableRef");<br>   case CXCursor_IntegerLiteral:<br>       return createCXString("IntegerLiteral");<br>   case CXCursor_FloatingLiteral:<br>@@ -3251,6 +3305,8 @@<br>       return createCXString("PackExpansionExpr");<br>   case CXCursor_SizeOfPackExpr:<br>       return createCXString("SizeOfPackExpr");<br>+  case CXCursor_LambdaExpr:<br>+    return createCXString("LambdaExpr");<br>   case CXCursor_UnexposedExpr:<br>       return createCXString("UnexposedExpr");<br>   case CXCursor_DeclRefExpr:<br>@@ -3626,6 +3682,11 @@<br>       return cxloc::translateSourceLocation(P.first->getASTContext(), P.second);<br>     }<br><br>+    case CXCursor_VariableRef: {<br>+      std::pair<VarDecl *, SourceLocation> P = getCursorVariableRef(C);<br>+      return cxloc::translateSourceLocation(P.first->getASTContext(), P.second);<br>+    }<br>+<br>     case CXCursor_CXXBaseSpecifier: {<br>       CXXBaseSpecifier *BaseSpec = getCursorCXXBaseSpecifier(C);<br>       if (!BaseSpec)<br>@@ -3768,6 +3829,9 @@<br>     case CXCursor_OverloadedDeclRef:<br>       return getCursorOverloadedDeclRef(C).second;<br><br>+    case CXCursor_VariableRef:<br>+      return getCursorVariableRef(C).second;<br>+        <br>     default:<br>       // FIXME: Need a way to enumerate all non-reference cases.<br>       llvm_unreachable("Missed a reference kind");<br>@@ -3975,6 +4039,9 @@<br><br>     case CXCursor_OverloadedDeclRef:<br>       return C;<br>+      <br>+    case CXCursor_VariableRef:<br>+      return MakeCXCursor(getCursorVariableRef(C).first, tu);<br><br>     default:<br>       // We would prefer to enumerate all non-reference cursor kinds here.<br><br>Modified: cfe/trunk/tools/libclang/CXCursor.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXCursor.cpp?rev=150549&r1=150548&r2=150549&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXCursor.cpp?rev=150549&r1=150548&r2=150549&view=diff</a><br>==============================================================================<br>--- cfe/trunk/tools/libclang/CXCursor.cpp (original)<br>+++ cfe/trunk/tools/libclang/CXCursor.cpp Tue Feb 14 18:54:55 2012<br>@@ -226,7 +226,6 @@<br>   case Stmt::UnaryExprOrTypeTraitExprClass:<br>   case Stmt::UnaryTypeTraitExprClass:<br>   case Stmt::VAArgExprClass:<br>-  case Stmt::LambdaExprClass:<br>     K = CXCursor_UnexposedExpr;<br>     break;<br><br>@@ -441,6 +440,10 @@<br>     K = CXCursor_CallExpr;<br>     break;<br><br>+  case Stmt::LambdaExprClass:<br>+    K = CXCursor_LambdaExpr;<br>+    break;<br>+      <br>   case Stmt::ObjCMessageExprClass: {<br>     K = CXCursor_ObjCMessageExpr;<br>     int SelectorIdIndex = -1;<br>@@ -573,6 +576,23 @@<br>                                        reinterpret_cast<uintptr_t>(C.data[1])));  <br> }<br><br>+CXCursor cxcursor::MakeCursorVariableRef(const VarDecl *Var, SourceLocation Loc, <br>+                                         CXTranslationUnit TU) {<br>+  <br>+  assert(Var && TU && "Invalid arguments!");<br>+  void *RawLoc = reinterpret_cast<void *>(Loc.getRawEncoding());<br>+  CXCursor C = { CXCursor_VariableRef, 0, { (void*)Var, RawLoc, TU } };<br>+  return C;<br>+}<br>+<br>+std::pair<VarDecl *, SourceLocation> <br>+cxcursor::getCursorVariableRef(CXCursor C) {<br>+  assert(C.kind == CXCursor_VariableRef);<br>+  return std::make_pair(static_cast<VarDecl *>(C.data[0]),<br>+                        SourceLocation::getFromRawEncoding(<br>+                          reinterpret_cast<uintptr_t>(C.data[1])));<br>+}<br>+<br> CXCursor cxcursor::MakeCursorMemberRef(const FieldDecl *Field, SourceLocation Loc, <br>                                        CXTranslationUnit TU) {<br><br><br>Modified: cfe/trunk/tools/libclang/CXCursor.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXCursor.h?rev=150549&r1=150548&r2=150549&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXCursor.h?rev=150549&r1=150548&r2=150549&view=diff</a><br>==============================================================================<br>--- cfe/trunk/tools/libclang/CXCursor.h (original)<br>+++ cfe/trunk/tools/libclang/CXCursor.h Tue Feb 14 18:54:55 2012<br>@@ -41,6 +41,7 @@<br> class TemplateDecl;<br> class TemplateName;<br> class TypeDecl;<br>+class VarDecl;<br><br> namespace cxcursor {<br><br>@@ -111,6 +112,14 @@<br> /// it references and the location where the reference occurred.<br> std::pair<NamedDecl *, SourceLocation> getCursorNamespaceRef(CXCursor C);<br><br>+/// \brief Create a reference to a variable at the given location.<br>+CXCursor MakeCursorVariableRef(const VarDecl *Var, SourceLocation Loc, <br>+                               CXTranslationUnit TU);<br>+<br>+/// \brief Unpack a VariableRef cursor into the variable it references and the<br>+/// location where the where the reference occurred.<br>+std::pair<VarDecl *, SourceLocation> getCursorVariableRef(CXCursor C); <br>+<br> /// \brief Create a reference to a field at the given location.<br> CXCursor MakeCursorMemberRef(const FieldDecl *Field, SourceLocation Loc, <br>                              CXTranslationUnit TU);<br><br>Modified: cfe/trunk/tools/libclang/CXType.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXType.cpp?rev=150549&r1=150548&r2=150549&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXType.cpp?rev=150549&r1=150548&r2=150549&view=diff</a><br>==============================================================================<br>--- cfe/trunk/tools/libclang/CXType.cpp (original)<br>+++ cfe/trunk/tools/libclang/CXType.cpp Tue Feb 14 18:54:55 2012<br>@@ -160,12 +160,17 @@<br><br>     case CXCursor_CXXBaseSpecifier:<br>       return cxtype::MakeCXType(getCursorCXXBaseSpecifier(C)->getType(), TU);<br>-      <br>-    case CXCursor_ObjCProtocolRef:        <br>+<br>+    case CXCursor_MemberRef:<br>+      return cxtype::MakeCXType(getCursorMemberRef(C).first->getType(), TU);<br>+<br>+    case CXCursor_VariableRef:<br>+      return cxtype::MakeCXType(getCursorVariableRef(C).first->getType(), TU);<br>+<br>+    case CXCursor_ObjCProtocolRef:<br>     case CXCursor_TemplateRef:<br>     case CXCursor_NamespaceRef:<br>-    case CXCursor_MemberRef:<br>-    case CXCursor_OverloadedDeclRef:      <br>+    case CXCursor_OverloadedDeclRef:<br>     default:<br>       break;<br>     }<br><br>Modified: cfe/trunk/tools/libclang/CursorVisitor.h<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CursorVisitor.h?rev=150549&r1=150548&r2=150549&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CursorVisitor.h?rev=150549&r1=150548&r2=150549&view=diff</a><br>==============================================================================<br>--- cfe/trunk/tools/libclang/CursorVisitor.h (original)<br>+++ cfe/trunk/tools/libclang/CursorVisitor.h Tue Feb 14 18:54:55 2012<br>@@ -31,7 +31,8 @@<br>               ExplicitTemplateArgsVisitKind,<br>               NestedNameSpecifierLocVisitKind,<br>               DeclarationNameInfoVisitKind,<br>-              MemberRefVisitKind, SizeOfPackExprPartsKind };<br>+              MemberRefVisitKind, SizeOfPackExprPartsKind,<br>+              LambdaExprPartsKind };<br> protected:<br>   void *data[3];<br>   CXCursor parent;<br><br>Modified: cfe/trunk/tools/libclang/IndexBody.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/IndexBody.cpp?rev=150549&r1=150548&r2=150549&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/IndexBody.cpp?rev=150549&r1=150548&r2=150549&view=diff</a><br>==============================================================================<br>--- cfe/trunk/tools/libclang/IndexBody.cpp (original)<br>+++ cfe/trunk/tools/libclang/IndexBody.cpp Tue Feb 14 18:54:55 2012<br>@@ -101,6 +101,17 @@<br>       IndexCtx.indexDeclGroupRef(S->getDeclGroup());<br>     return true;<br>   }<br>+  <br>+  bool TraverseLambdaCapture(LambdaExpr::Capture C) {<br>+    if (C.capturesThis())<br>+      return true;<br>+    <br>+    if (IndexCtx.indexFunctionLocalSymbols())<br>+      IndexCtx.handleReference(C.getCapturedVar(), C.getLocation(),<br>+                               Parent, ParentDC);<br>+    return true;<br>+  }<br>+<br> };<br><br> } // anonymous namespace<br><br>Modified: cfe/trunk/tools/libclang/IndexingContext.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/IndexingContext.cpp?rev=150549&r1=150548&r2=150549&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/IndexingContext.cpp?rev=150549&r1=150548&r2=150549&view=diff</a><br>==============================================================================<br>--- cfe/trunk/tools/libclang/IndexingContext.cpp (original)<br>+++ cfe/trunk/tools/libclang/IndexingContext.cpp Tue Feb 14 18:54:55 2012<br>@@ -1035,7 +1035,9 @@<br>     return MakeCursorNamespaceRef(Namespace, Loc, CXTU);<br>   if (const FieldDecl *Field = dyn_cast<FieldDecl>(D))<br>     return MakeCursorMemberRef(Field, Loc, CXTU);<br>-<br>+  if (const VarDecl *Var = dyn_cast<VarDecl>(D))<br>+    return MakeCursorVariableRef(Var, Loc, CXTU);<br>+  <br>   return clang_getNullCursor();<br> }<br><br><br><br>_______________________________________________<br>cfe-commits mailing list<br><a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits<br></div></blockquote></div><br></div></body></html>