From f112edd905598b0559d6edd06885d08588ba7348 Mon Sep 17 00:00:00 2001 From: Ivan Donchevskii Date: Tue, 19 Jun 2018 12:43:23 +0200 Subject: [PATCH] Clang: Use built-in follow symbol for "ui_*" includes Currently ClangCodeModel will follow to the temporary empty generated file instead of the proper "ui_*" header. Use built-in follow symbol for such includes until we fix the initial issue that requires these empty files. Task-number: QTCREATORBUG-20579 Change-Id: If67d21ea7b44889c93d3d41193403bade2dc330a Reviewed-by: David Schulz --- src/tools/clangbackend/source/clangfollowsymbol.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tools/clangbackend/source/clangfollowsymbol.cpp b/src/tools/clangbackend/source/clangfollowsymbol.cpp index d41af5dc758..2dcdca4bef8 100644 --- a/src/tools/clangbackend/source/clangfollowsymbol.cpp +++ b/src/tools/clangbackend/source/clangfollowsymbol.cpp @@ -142,7 +142,12 @@ FollowSymbolResult FollowSymbol::followSymbol(CXTranslationUnit tu, CXFile file = clang_getIncludedFile(cursors[tokenIndex]); const ClangString filename(clang_getFileName(file)); const SourceLocation loc(tu, filename, 1, 1); - return SourceRangeContainer(SourceRange(loc, loc)); + FollowSymbolResult result; + result.range = SourceRangeContainer(SourceRange(loc, loc)); + // CLANG-UPGRADE-CHECK: Remove if we don't use empty generated ui_* headers anymore. + if (Utf8String(filename).contains("ui_")) + result.isResultOnlyForFallBack = true; + return result; } // For definitions we can always find a declaration in current TU