aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2011-08-31 16:53:37 +0000
committerChandler Carruth <chandlerc@gmail.com>2011-08-31 16:53:37 +0000
commit20174221af145554b76a0b0f5e4eb3ac70d05945 (patch)
tree235f3b2420767cf7441042214be7f7267b2d0fef /include
parent14c3633a0b6a06dd61c0cd239925174fc5728fff (diff)
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... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138860 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/clang-c/Index.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h
index 7c32250438..644518ac0f 100644
--- a/include/clang-c/Index.h
+++ b/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,