clang: Fix include/resource dir confusion

The getClangResourceDirAndVersion() function in ClangTools could return
the actual resource dir or the include dir, depending on the input. This
mistake happened because of misleading names spread all around the code.
Now the function returns what it says, and the other names are accurate
as well.

Change-Id: I0a8600857ee7b9fafb16256e0d1ad203ac3273d2
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2020-08-24 10:46:58 +02:00
parent 643c9405bd
commit d65ef60ea2
19 changed files with 65 additions and 65 deletions

View File

@@ -125,7 +125,7 @@ protected:
arguments.clone(),
Utils::clone(compilerMacros),
{{"project/.pre_includes", 1, ClangBackEnd::IncludeSearchPathType::System},
{CLANG_RESOURCE_DIR, 2, ClangBackEnd::IncludeSearchPathType::BuiltIn}},
{CLANG_INCLUDE_DIR, 2, ClangBackEnd::IncludeSearchPathType::BuiltIn}},
{},
{filePathId(headerPaths[1])},
{filePathIds(sourcePaths)},
@@ -136,7 +136,7 @@ protected:
arguments2.clone(),
Utils::clone(compilerMacros),
{{"project/.pre_includes", 1, ClangBackEnd::IncludeSearchPathType::System},
{CLANG_RESOURCE_DIR, 2, ClangBackEnd::IncludeSearchPathType::BuiltIn}},
{CLANG_INCLUDE_DIR, 2, ClangBackEnd::IncludeSearchPathType::BuiltIn}},
{},
{filePathId(headerPaths[1])},
{filePathIds(sourcePaths)},
@@ -386,7 +386,7 @@ TEST_F(ProjectUpdater, CreateSortedIncludeSearchPaths)
Eq(IncludeSearchPath{builtInPath.path, 5, IncludeSearchPathType::BuiltIn}),
Eq(IncludeSearchPath{frameworkPath.path, 3, IncludeSearchPathType::Framework}),
Eq(IncludeSearchPath{"project/.pre_includes", 1, IncludeSearchPathType::System}),
Eq(IncludeSearchPath{CLANG_RESOURCE_DIR,
Eq(IncludeSearchPath{CLANG_INCLUDE_DIR,
4,
ClangBackEnd::IncludeSearchPathType::BuiltIn})));
ASSERT_THAT(paths.project,