[cfe-commits] r103224 - in /cfe/trunk: include/clang-c/Index.h tools/libclang/CIndex.cpp

Ted Kremenek kremenek at apple.com
Thu May 6 18:04:29 PDT 2010


Author: kremenek
Date: Thu May  6 20:04:29 2010
New Revision: 103224

URL: http://llvm.org/viewvc/llvm-project?rev=103224&view=rev
Log:
Add CXCursor support for LinkageSpecDecl (e.g., 'extern "C"').

Modified:
    cfe/trunk/include/clang-c/Index.h
    cfe/trunk/tools/libclang/CIndex.cpp

Modified: cfe/trunk/include/clang-c/Index.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/Index.h?rev=103224&r1=103223&r2=103224&view=diff
==============================================================================
--- cfe/trunk/include/clang-c/Index.h (original)
+++ cfe/trunk/include/clang-c/Index.h Thu May  6 20:04:29 2010
@@ -704,8 +704,10 @@
   CXCursor_CXXMethod                     = 21,
   /** \brief A C++ namespace. */
   CXCursor_Namespace                     = 22,
+  /** \brief A linkage specification, e.g. 'extern "C"'. */
+  CXCursor_LinkageSpec                   = 23,
 
-  CXCursor_LastDecl                      = CXCursor_Namespace,
+  CXCursor_LastDecl                      = CXCursor_LinkageSpec,
 
   /* References */
   CXCursor_FirstRef                      = 40, /* Decl references */

Modified: cfe/trunk/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=103224&r1=103223&r2=103224&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Thu May  6 20:04:29 2010
@@ -285,6 +285,7 @@
   // FIXME: ObjCCompatibleAliasDecl requires aliased-class locations.
   bool VisitObjCForwardProtocolDecl(ObjCForwardProtocolDecl *D);
   bool VisitObjCClassDecl(ObjCClassDecl *D);
+  bool VisitLinkageSpecDecl(LinkageSpecDecl *D);
   bool VisitNamespaceDecl(NamespaceDecl *D);
 
   // Type visitors
@@ -727,6 +728,10 @@
   return VisitDeclContext(D);
 }
 
+bool CursorVisitor::VisitLinkageSpecDecl(LinkageSpecDecl *D) {
+  return VisitDeclContext(D);
+}
+
 bool CursorVisitor::VisitBuiltinTypeLoc(BuiltinTypeLoc TL) {
   ASTContext &Context = TU->getASTContext();
 
@@ -1645,6 +1650,8 @@
     return createCXString("macro instantiation");
   case CXCursor_Namespace:
     return createCXString("Namespace");
+  case CXCursor_LinkageSpec:
+    return createCXString("LinkageSpec");
   }
 
   llvm_unreachable("Unhandled CXCursorKind");





More information about the cfe-commits mailing list