Ejemplo n.º 1
0
static void printVersion() {
    // do not change the format for the first line, external programs should be
    // able to rely on it
    std::cout << "irony-server version " IRONY_PACKAGE_VERSION "\n";

    CXString cxVersionString = clang_getClangVersion();
    std::cout << clang_getCString(cxVersionString) << "\n";
    clang_disposeString(cxVersionString);
}
Ejemplo n.º 2
0
int
main(int argc, char *argv[])
{
    CXString str;
    str = clang_getClangVersion();
    const char * const tmp = clang_getCString(str);
    printf("%s\n", tmp);
    clang_disposeString(str);  // ???? should we do this here.
    return(1);
}
Ejemplo n.º 3
0
    bool Parser::ParseWorkspace(const Workspace* workspace)
    {
        if (workspace == nullptr)
        {
            std::cout << "invalid workspace" << std::endl;
            return false;
        }

        std::cout << "{ libclang index version " << CINDEX_VERSION_STRING << " }" << std::endl;
        std::cout << "{ libclang " << clang::String(clang_getClangVersion()).Get() << " }" << std::endl;
        std::cout << std::endl;

        std::cout << "> workspace : " << workspace->GetName() << std::endl;

        {
            ScopeTimer timer([](double time) {
                std::cout << "> " << time << "s" << std::endl;
            });

            auto originalOutput = outputDirectory_;

            for (auto& project : workspace->GetProjects())
            {
                outputDirectory_ = originalOutput / project->GetName();
                internal::EnsureDirectoryExists(outputDirectory_);

                if (!ParseProject(project.get()))
                {
                    return false;
                }
            }

            outputDirectory_ = originalOutput;
        }

        reflection::TypeEnumerator enumerator;
        pimpl_->GetTypeRegistry().Accept(enumerator);

        if (listTypes_)
        {
            internal::ListTypes(enumerator);
        }

        pimpl_->GetDatabase().Initialize(outputDirectory_ / "registry.db");
        internal::SaveTypes(enumerator, pimpl_->GetDatabase());

        return true;
    }
Ejemplo n.º 4
0
int main(int argc, char* argv[])
{

	CXString version = clang_getClangVersion();
	printf("%s\n", clang_getCString(version));
	clang_disposeString(version);

	CXIndex index = clang_createIndex(1, 1);
	CXTranslationUnit tu = clang_createTranslationUnit(index, argv[1]);
	if (tu) {
		clang_visitChildren(clang_getTranslationUnitCursor(tu), visitor, argv[2]);
		clang_disposeTranslationUnit(tu);
	}

	clang_disposeIndex(index);

	return 0;

}
Ejemplo n.º 5
0
std::string ClangVersion() {
  return CXStringToString( clang_getClangVersion() );
}