diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-01-04 18:30:13 +0000 |
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2013-01-04 18:30:13 +0000 |
| commit | 56be71610fee1a7750ee98d756ca0e4f69b8daff (patch) | |
| tree | 148bd3612bca92625dce647dcce791b2a19d4f25 /clang/include/clang-c | |
| parent | d12c332905c0e6ca882b54a82b00b00696fa9cb0 (diff) | |
| download | bcm5719-llvm-56be71610fee1a7750ee98d756ca0e4f69b8daff.tar.gz bcm5719-llvm-56be71610fee1a7750ee98d756ca0e4f69b8daff.zip | |
[libclang] Introduce clang_getFileLocation.
Uses of clang_getSpellingLocation should eventually move to calling
clang_getFileLocation, and clang_getSpellingLocation should do what
its name represents and actually point at the 'spelling' location, e.g.
inside a macro definition if the spelling of a token came from that.
llvm-svn: 171486
Diffstat (limited to 'clang/include/clang-c')
| -rw-r--r-- | clang/include/clang-c/Index.h | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h index 94c896ec6e2..011588efc88 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 9 +#define CINDEX_VERSION_MINOR 10 #define CINDEX_VERSION_ENCODE(major, minor) ( \ ((major) * 10000) \ @@ -531,6 +531,35 @@ CINDEX_LINKAGE void clang_getSpellingLocation(CXSourceLocation location, unsigned *offset); /** + * \brief Retrieve the file, line, column, and offset represented by + * the given source location. + * + * If the location refers into a macro expansion, return where the macro was + * expanded or where the macro argument was written, if the location points at + * a macro argument. + * + * \param location the location within a source file that will be decomposed + * into its parts. + * + * \param file [out] if non-NULL, will be set to the file to which the given + * source location points. + * + * \param line [out] if non-NULL, will be set to the line to which the given + * source location points. + * + * \param column [out] if non-NULL, will be set to the column to which the given + * source location points. + * + * \param offset [out] if non-NULL, will be set to the offset into the + * buffer to which the given source location points. + */ +CINDEX_LINKAGE void clang_getFileLocation(CXSourceLocation location, + CXFile *file, + unsigned *line, + unsigned *column, + unsigned *offset); + +/** * \brief Retrieve a source location representing the first character within a * source range. */ |

