importedASTFile indexing callback.
llvm-svn: 165281
*/
CXFile file;
/**
- * \brief Location where the file is imported. Applicable only for modules.
+ * \brief The imported module or NULL if the AST file is a PCH.
*/
- CXIdxLoc loc;
+ CXModule module;
/**
- * \brief Non-zero if the AST file is a module otherwise it's a PCH.
+ * \brief Location where the file is imported. Applicable only for modules.
*/
- int isModule;
+ CXIdxLoc loc;
/**
* \brief Non-zero if an inclusion directive was automatically turned into
- * a module import.
+ * a module import. Applicable only for modules.
*/
int isImplicit;
- /**
- * \brief The actual name of the module or submodule being imported.
- * The syntax is a sequence of identifiers separated by dots, e.g "std.vector"
- * Applicable only for modules.
- */
- const char *moduleName;
} CXIdxImportedASTFileInfo;
printf("[importedASTFile]: ");
printCXIndexFile((CXIdxClientFile)info->file);
- printf(" | loc: ");
- printCXIndexLoc(info->loc, client_data);
- printf(" | name: \"%s\"", info->moduleName);
- printf(" | isModule: %d | isImplicit: %d\n",
- info->isModule, info->isImplicit);
+ if (info->module) {
+ CXString name = clang_Module_getFullName(info->module);
+ printf(" | loc: ");
+ printCXIndexLoc(info->loc, client_data);
+ printf(" | name: \"%s\"", clang_getCString(name));
+ printf(" | isImplicit: %d\n", info->isImplicit);
+ clang_disposeString(name);
+ }
return (CXIdxClientFile)info->file;
}
CXIdxImportedASTFileInfo Info = {
(CXFile)Mod->getASTFile(),
+ Mod,
getIndexLoc(ImportD->getLocation()),
- /*isModule=*/true,
- ImportD->isImplicit(),
- ModuleName.c_str(),
+ ImportD->isImplicit()
};
CXIdxClientASTFile astFile = CB.importedASTFile(ClientData, &Info);
(void)astFile;
CXIdxImportedASTFileInfo Info = {
(CXFile)File,
+ /*module=*/NULL,
getIndexLoc(SourceLocation()),
- /*isModule=*/false,
- /*isImplicit=*/false,
- /*moduleName=*/NULL
+ /*isImplicit=*/false
};
CXIdxClientASTFile astFile = CB.importedASTFile(ClientData, &Info);
(void)astFile;