[cfe-commits] r142233 - in /cfe/trunk: include/clang-c/Index.h tools/c-index-test/c-index-test.c tools/libclang/CIndex.cpp tools/libclang/CIndexUSRs.cpp tools/libclang/CMakeLists.txt tools/libclang/CXCursor.cpp tools/libclang/CXCursor.h tools/libclang/CXTranslationUnit.h tools/libclang/IndexBody.cpp tools/libclang/IndexDecl.cpp tools/libclang/IndexTypeSourceInfo.cpp tools/libclang/Indexing.cpp tools/libclang/IndexingContext.cpp tools/libclang/IndexingContext.h tools/libclang/libclang.exports

Douglas Gregor dgregor at apple.com
Wed Oct 19 08:23:55 PDT 2011



Sent from my iPhone

On Oct 19, 2011, at 8:18 AM, Argyrios Kyrtzidis <kyrtzidis at apple.com> wrote:

> On Oct 18, 2011, at 10:27 PM, Douglas Gregor wrote:
> 
>> 
>> On Oct 17, 2011, at 12:48 PM, Argyrios Kyrtzidis wrote:
>> 
>>> Author: akirtzidis
>>> Date: Mon Oct 17 14:48:19 2011
>>> New Revision: 142233
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=142233&view=rev
>>> Log:
>>> [libclang] Introduce a new high level API for indexing clients that assumes
>>> more of the work involved in indexing a translation unit and simplifies client
>>> implementations.
>>> 
>>> Only C/ObjC for now, C++ (and comments) to come.
>>> 
>>> Added:
>>>  cfe/trunk/tools/libclang/IndexBody.cpp
>>>  cfe/trunk/tools/libclang/IndexDecl.cpp
>>>  cfe/trunk/tools/libclang/IndexTypeSourceInfo.cpp
>>>  cfe/trunk/tools/libclang/Indexing.cpp
>>>  cfe/trunk/tools/libclang/IndexingContext.cpp
>>>  cfe/trunk/tools/libclang/IndexingContext.h
>>> Modified:
>>>  cfe/trunk/include/clang-c/Index.h
>>>  cfe/trunk/tools/c-index-test/c-index-test.c
>>>  cfe/trunk/tools/libclang/CIndex.cpp
>>>  cfe/trunk/tools/libclang/CIndexUSRs.cpp
>>>  cfe/trunk/tools/libclang/CMakeLists.txt
>>>  cfe/trunk/tools/libclang/CXCursor.cpp
>>>  cfe/trunk/tools/libclang/CXCursor.h
>>>  cfe/trunk/tools/libclang/CXTranslationUnit.h
>>>  cfe/trunk/tools/libclang/libclang.exports
>>> 
>>> Modified: cfe/trunk/include/clang-c/Index.h
>>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/Index.h?rev=142233&r1=142232&r2=142233&view=diff
>>> ==============================================================================
>>> --- cfe/trunk/include/clang-c/Index.h (original)
>>> +++ cfe/trunk/include/clang-c/Index.h Mon Oct 17 14:48:19 2011
>>> @@ -3855,6 +3855,329 @@
>>> #  endif
>>> #endif
>>> 
>>> +typedef void *CXIdxFile;
>>> +typedef void *CXIdxEntity;
>>> +typedef void *CXIdxContainer;
>>> +typedef void *CXIdxMacro;
>>> +typedef void *CXIdxASTFile;
>>> +
>>> +typedef struct {
>>> +  void *ptr_data[2];
>>> +  unsigned int_data;
>>> +} CXIdxLoc;
>>> +
>>> +typedef struct {
>>> +  CXIdxLoc hashLoc;
>>> +  const char *filename;
>>> +  CXIdxFile file;
>>> +  int isImport;
>>> +  int isAngled;
>>> +} CXIdxIncludedFileInfo;
>>> +
>>> +typedef struct {
>>> +  CXFile file;
>>> +  CXIdxLoc loc;
>>> +  int isModule;
>>> +} CXIdxImportedASTFileInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxLoc loc;
>>> +  const char *name;
>>> +} CXIdxMacroInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxMacroInfo *macroInfo;
>>> +  CXIdxLoc defBegin;
>>> +  unsigned defLength;
>>> +} CXIdxMacroDefinedInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxLoc loc;
>>> +  const char *name;
>>> +  CXIdxMacro macro;
>>> +} CXIdxMacroUndefinedInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxLoc loc;
>>> +  const char *name;
>>> +  CXIdxMacro macro;
>>> +} CXIdxMacroExpandedInfo;
>>> +
>>> +typedef struct {
>>> +  const char *name;
>>> +  const char *USR;
>>> +} CXIdxEntityInfo;
>>> +
>>> +typedef struct {
>>> +  CXCursor cursor;
>>> +  CXIdxLoc loc;
>>> +  CXIdxContainer container;
>>> +} CXIdxIndexedDeclInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxEntityInfo *entityInfo;
>>> +  CXCursor cursor;
>>> +  CXIdxLoc loc;
>>> +  CXIdxASTFile ASTFile;
>>> +} CXIdxImportedEntityInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxMacroInfo *macroInfo;
>>> +  CXIdxASTFile ASTFile;
>>> +} CXIdxImportedMacroInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxEntityInfo *entityInfo;
>>> +  CXIdxIndexedDeclInfo *declInfo;
>>> +} CXIdxIndexedEntityInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxIndexedDeclInfo *declInfo;
>>> +  CXIdxEntity entity;
>>> +} CXIdxIndexedRedeclInfo;
>>> +
>>> +typedef struct {
>>> +  CXCursor cursor;
>>> +  CXIdxLoc loc;
>>> +  CXIdxEntity entity;
>>> +} CXIdxContainerInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxIndexedEntityInfo *indexedEntityInfo;
>>> +} CXIdxTypedefInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxIndexedEntityInfo *indexedEntityInfo;
>>> +  int isDefinition;
>>> +} CXIdxFunctionInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxIndexedRedeclInfo *indexedRedeclInfo;
>>> +  int isDefinition;
>>> +} CXIdxFunctionRedeclInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxIndexedEntityInfo *indexedEntityInfo;
>>> +  int isDefinition;
>>> +} CXIdxVariableInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxIndexedRedeclInfo *indexedRedeclInfo;
>>> +  int isDefinition;
>>> +} CXIdxVariableRedeclInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxIndexedEntityInfo *indexedEntityInfo;
>>> +  int isDefinition;
>>> +  int isAnonymous;
>>> +} CXIdxTagTypeInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxIndexedRedeclInfo *indexedRedeclInfo;
>>> +  int isDefinition;
>>> +} CXIdxTagTypeRedeclInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxContainerInfo *containerInfo;
>>> +} CXIdxTagTypeDefinitionInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxIndexedEntityInfo *indexedEntityInfo;
>>> +} CXIdxFieldInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxIndexedEntityInfo *indexedEntityInfo;
>>> +} CXIdxEnumeratorInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxIndexedEntityInfo *indexedEntityInfo;
>>> +  int isForwardRef;
>>> +} CXIdxObjCClassInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxIndexedEntityInfo *indexedEntityInfo;
>>> +  int isForwardRef;
>>> +} CXIdxObjCProtocolInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxIndexedEntityInfo *indexedEntityInfo;
>>> +  CXIdxEntity objcClass;
>>> +} CXIdxObjCCategoryInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxIndexedEntityInfo *indexedEntityInfo;
>>> +  int isDefinition;
>>> +} CXIdxObjCMethodInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxIndexedEntityInfo *indexedEntityInfo;
>>> +} CXIdxObjCPropertyInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxIndexedRedeclInfo *indexedRedeclInfo;
>>> +  int isDefinition;
>>> +} CXIdxObjCMethodRedeclInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxContainerInfo *containerInfo;
>>> +  CXIdxLoc bodyBegin;
>>> +} CXIdxStmtBodyInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxContainerInfo *containerInfo;
>>> +} CXIdxObjCContainerInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxEntity objcClass;
>>> +  CXIdxLoc loc;
>>> +} CXIdxObjCBaseClassInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxEntity protocol;
>>> +  CXIdxLoc loc;
>>> +} CXIdxObjCProtocolRefInfo;
>>> +
>>> +typedef struct {
>>> +  CXCursor cursor;
>>> +  CXIdxEntity objcClass;
>>> +  CXIdxContainer container;
>>> +  CXIdxObjCBaseClassInfo *baseInfo;
>>> +  CXIdxObjCProtocolRefInfo **protocols;
>>> +  unsigned numProtocols;
>>> +} CXIdxObjCClassDefineInfo;
>>> +
>>> +typedef struct {
>>> +  CXIdxContainer container;
>>> +  CXIdxLoc endLoc;
>>> +} CXIdxEndContainerInfo;
>>> +
>>> +typedef struct {
>>> +  CXCursor cursor;
>>> +  CXIdxLoc loc;
>>> +  CXIdxEntity referencedEntity;
>>> +  CXIdxEntity parentEntity;
>>> +  CXIdxContainer container;
>>> +} CXIdxEntityRefInfo;
>>> +
>>> +typedef struct {
>>> +  void (*diagnostic)(CXClientData client_data,
>>> +                     CXDiagnostic, void *reserved);
>>> +
>>> +  CXIdxFile (*recordFile)(CXClientData client_data,
>>> +                          CXFile file, void *reserved);
>>> +
>>> +  void (*ppIncludedFile)(CXClientData client_data,
>>> +                         CXIdxIncludedFileInfo *);
>> 
>> Should you pass the "included from" file here?
> 
> You can get that from the hash location; it should be sufficient, right ?

Yes, that's fine. Sorry for the noise. 



More information about the cfe-commits mailing list