From dae4477cd367d115e2011cfedae6b1d5dbc22cb7 Mon Sep 17 00:00:00 2001 From: Tim Jenssen Date: Mon, 3 Jul 2017 11:12:00 +0200 Subject: Clang: Make file ids unique Clang file ids are only unique for one query. Because we query in parallel we have to manage our own unique ids. Change-Id: I67d57d8b1766cab75ad252a14e57bbf9dc5fdb79 Reviewed-by: Tim Jenssen --- .../clangrefactoringbackend/source/clangquery.cpp | 23 +++++++--------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'src/tools/clangrefactoringbackend/source/clangquery.cpp') diff --git a/src/tools/clangrefactoringbackend/source/clangquery.cpp b/src/tools/clangrefactoringbackend/source/clangquery.cpp index d24b981f45..be93b61a1a 100644 --- a/src/tools/clangrefactoringbackend/source/clangquery.cpp +++ b/src/tools/clangrefactoringbackend/source/clangquery.cpp @@ -30,27 +30,15 @@ #include -#include +#include -#if defined(__GNUC__) -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wunused-parameter" -#elif defined(_MSC_VER) -# pragma warning(push) -# pragma warning( disable : 4100 ) -#endif +#include #include #include #include #include -#if defined(__GNUC__) -# pragma GCC diagnostic pop -#elif defined(_MSC_VER) -# pragma warning(pop) -#endif - using clang::ast_matchers::dynamic::Diagnostics; using clang::ast_matchers::dynamic::Parser; using clang::ast_matchers::BoundNodes; @@ -66,8 +54,10 @@ struct CollectBoundNodes : MatchFinder::MatchCallback { } }; -ClangQuery::ClangQuery(Utils::SmallString &&query) - : query(std::move(query)) +ClangQuery::ClangQuery(StringCache &filePathCache, + Utils::SmallString &&query) + : query(std::move(query)), + filePathCache(filePathCache) { } @@ -226,6 +216,7 @@ void ClangQuery::matchLocation( SourceRangeExtractor extractor(ast->getSourceManager(), ast->getLangOpts(), + filePathCache, sourceRangesContainer); extractor.addSourceRanges(sourceRanges); -- cgit v1.2.1