llvm-project/clang/include/clang-c
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
..
BuildSystem.h Add clang_free to libclang to free memory allocated in libclang. 2015-07-09 07:53:23 +00:00
CXCompilationDatabase.h [index] Fix typo: inferface -> interface 2017-06-16 20:58:26 +00:00
CXErrorCode.h Header guard canonicalization, clang part. 2014-08-13 16:25:19 +00:00
CXString.h libclang: add new StringSet type 2015-11-12 03:57:16 +00:00
Documentation.h Header guard canonicalization, clang part. 2014-08-13 16:25:19 +00:00
Index.h [libclang] Add clang_File_tryGetRealPathName 2018-04-07 20:50:35 +00:00
Platform.h Header guard canonicalization, clang part. 2014-08-13 16:25:19 +00:00
module.modulemap The Clang C API does not require C++. Thanks to Jordan Rose for pointing out this error! 2014-06-12 22:09:11 +00:00