diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2011-08-31 16:53:37 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2011-08-31 16:53:37 +0000 |
| commit | 4aa01ef19c4d8484ac2364761fdc68fbf1bf7712 (patch) | |
| tree | 0cb0dbb73ef83fbecbc647f700becd5063792a33 /clang/include/clang-c | |
| parent | 5247ca0ae506d4a5e5b9d0ddce331ff3567b2569 (diff) | |
| download | bcm5719-llvm-4aa01ef19c4d8484ac2364761fdc68fbf1bf7712.tar.gz bcm5719-llvm-4aa01ef19c4d8484ac2364761fdc68fbf1bf7712.zip | |
Update libclang to have APIs corresponding to the new 'expansion' naming
system for macro-backed source locations. The old APIs are preserved for
legacy users.
This was intended to land with the main work of instantiation ->
expansion, but despite running it by Doug over a month ago, I forgot to
commit it. Very sorry for that...
llvm-svn: 138860
Diffstat (limited to 'clang/include/clang-c')
| -rw-r--r-- | clang/include/clang-c/Index.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h index 7c322504381..644518ac0f2 100644 --- a/clang/include/clang-c/Index.h +++ b/clang/include/clang-c/Index.h @@ -263,7 +263,7 @@ CINDEX_LINKAGE CXFile clang_getFile(CXTranslationUnit tu, * \brief Identifies a specific source location within a translation * unit. * - * Use clang_getInstantiationLocation() or clang_getSpellingLocation() + * Use clang_getExpansionLocation() or clang_getSpellingLocation() * to map a source location to a particular file, line, and column. */ typedef struct { @@ -339,8 +339,8 @@ CINDEX_LINKAGE unsigned clang_equalRanges(CXSourceRange range1, * \brief Retrieve the file, line, column, and offset represented by * the given source location. * - * If the location refers into a macro instantiation, retrieves the - * location of the macro instantiation. + * If the location refers into a macro expansion, retrieves the + * location of the macro expansion. * * \param location the location within a source file that will be decomposed * into its parts. @@ -357,6 +357,20 @@ CINDEX_LINKAGE unsigned clang_equalRanges(CXSourceRange range1, * \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_getExpansionLocation(CXSourceLocation location, + CXFile *file, + unsigned *line, + unsigned *column, + unsigned *offset); + +/** + * \brief Legacy API to retrieve the file, line, column, and offset represented + * by the given source location. + * + * This interface has been replaced by the newer interface + * \see clang_getExpansionLocation(). See that interface's documentation for + * details. + */ CINDEX_LINKAGE void clang_getInstantiationLocation(CXSourceLocation location, CXFile *file, unsigned *line, |

