diff options
Diffstat (limited to 'clang/tools/libclang/CIndex.cpp')
-rw-r--r-- | clang/tools/libclang/CIndex.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp index 5d492417bae..a8517091acb 100644 --- a/clang/tools/libclang/CIndex.cpp +++ b/clang/tools/libclang/CIndex.cpp @@ -2960,6 +2960,21 @@ unsigned clang_isFileMultipleIncludeGuarded(CXTranslationUnit tu, CXFile file) { .isFileMultipleIncludeGuarded(FEnt); } +int clang_getFileUniqueID(CXFile file, CXFileUniqueID *outID) { + if (!file || !outID) + return 1; + +#ifdef LLVM_ON_WIN32 + return 1; // inodes not supported on windows. +#else + FileEntry *FEnt = static_cast<FileEntry *>(file); + outID->data[0] = FEnt->getDevice(); + outID->data[1] = FEnt->getInode(); + outID->data[2] = FEnt->getModificationTime(); + return 0; +#endif +} + } // end: extern "C" //===----------------------------------------------------------------------===// |