diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-01-26 04:52:52 +0000 |
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-01-26 04:52:52 +0000 |
| commit | ac08b26611860e16d95c6cd49b444cd5d84cc1de (patch) | |
| tree | f2f40f6280166f6886e72db55d8537dad299b664 /clang/include/clang-c | |
| parent | 6350e07ecddc2457915ed73938117b2c8a710b44 (diff) | |
| download | bcm5719-llvm-ac08b26611860e16d95c6cd49b444cd5d84cc1de.tar.gz bcm5719-llvm-ac08b26611860e16d95c6cd49b444cd5d84cc1de.zip | |
[libclang] Introduce clang_getFileUniqueID which returns a struct
for a CXFile containing device/inode/modification time.
Intended to be useful as a key associated with a unique file across
an indexing session.
rdar://13091837
llvm-svn: 173559
Diffstat (limited to 'clang/include/clang-c')
| -rw-r--r-- | clang/include/clang-c/Index.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h index 6fa8296bdfb..2a66e7a798e 100644 --- a/clang/include/clang-c/Index.h +++ b/clang/include/clang-c/Index.h @@ -32,7 +32,7 @@ * compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable. */ #define CINDEX_VERSION_MAJOR 0 -#define CINDEX_VERSION_MINOR 10 +#define CINDEX_VERSION_MINOR 11 #define CINDEX_VERSION_ENCODE(major, minor) ( \ ((major) * 10000) \ @@ -297,6 +297,24 @@ CINDEX_LINKAGE CXString clang_getFileName(CXFile SFile); CINDEX_LINKAGE time_t clang_getFileTime(CXFile SFile); /** + * \brief Uniquely identifies a CXFile, that refers to the same underlying file, + * across an indexing session. + */ +typedef struct { + unsigned long long data[3]; +} CXFileUniqueID; + +/** + * \brief Retrieve the unique ID for the given \c file. + * + * \param file the file to get the ID for. + * \param outID stores the returned CXFileUniqueID. + * \returns If there was a failure getting the unique ID, returns non-zero, + * otherwise returns 0. +*/ +CINDEX_LINKAGE int clang_getFileUniqueID(CXFile file, CXFileUniqueID *outID); + +/** * \brief Determine whether the given header is guarded against * multiple inclusions, either with the conventional * \#ifndef/\#define/\#endif macro guards or with \#pragma once. |

