llvm-project/clang/unittests
Fangrui Song e46ac5fb9d [libclang] Add clang_File_tryGetRealPathName
Summary:
clang_getFileName() may return a path relative to WorkingDir.
On Arch Linux, during clang_indexTranslationUnit(), clang_getFileName() on
CXIdxIncludedIncludedFileInfo::file may return
"/../lib64/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../include/c++/7.3.0/string",
for `#include <string>`.

I presume WorkingDir is somehow changed to /usr/lib or /usr/include and
clang_getFileName() returns a path relative to WorkingDir.

clang_File_tryGetRealPathName() returns "/usr/include/c++/7.3.0/string"
which is more useful for the indexer in this case.

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D42893

llvm-svn: 329515
2018-04-07 20:50:35 +00:00
..
AST [ASTImporter] Add test helper Fixture 2018-03-30 22:03:29 +00:00
ASTMatchers [ASTMatchers] Introduce a matcher for matching any given Objective-C selector 2018-03-29 00:51:12 +00:00
Analysis [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
Basic Fixes errors with FS iterators caused by https://reviews.llvm.org/D44960 2018-04-04 19:47:25 +00:00
CodeGen Unit tests for TBAA metadata generation. 2017-12-22 15:22:45 +00:00
CrossTU Revert "[Tooling] [0/1] Refactor FrontendActionFactory::create() to return std::unique_ptr<>" 2018-02-27 15:54:55 +00:00
Driver Add a unit test for Driver::getDefaultModuleCachePath(). 2018-02-12 17:59:54 +00:00
Format [clang-format] Support lightweight Objective-C generics 2018-04-05 15:26:25 +00:00
Frontend Add possibility to specify output stream for CompilerInstance 2018-03-02 12:11:40 +00:00
Lex [Lexer] Support adding working directory to relative search dir for #include shortening in HeaderSearch. 2018-01-29 13:21:23 +00:00
Rename Unittests misc. typos 2018-02-06 13:12:29 +00:00
Rewrite [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
Sema Revert "[Tooling] [0/1] Refactor FrontendActionFactory::create() to return std::unique_ptr<>" 2018-02-27 15:54:55 +00:00
StaticAnalyzer Unittests misc. typos 2018-02-06 13:12:29 +00:00
Tooling Updated a usage of createTemporaryFile that does not expect file to be created. 2018-03-19 14:20:25 +00:00
libclang [libclang] Add clang_File_tryGetRealPathName 2018-04-07 20:50:35 +00:00
CMakeLists.txt Add Cross Translation Unit support library 2017-09-22 11:11:01 +00:00