зеркало из https://github.com/microsoft/clang.git
Extend libclang with clang_equalRanges, from Erik Verbruggen!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135860 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
2da9f5d4a8
Коммит
ab4e83b904
|
@ -327,6 +327,14 @@ CINDEX_LINKAGE CXSourceRange clang_getNullRange();
|
|||
CINDEX_LINKAGE CXSourceRange clang_getRange(CXSourceLocation begin,
|
||||
CXSourceLocation end);
|
||||
|
||||
/**
|
||||
* \brief Determine whether two ranges are equivalent.
|
||||
*
|
||||
* \returns non-zero if the ranges are the same, zero if they differ.
|
||||
*/
|
||||
CINDEX_LINKAGE unsigned clang_equalRanges(CXSourceRange range1,
|
||||
CXSourceRange range2);
|
||||
|
||||
/**
|
||||
* \brief Retrieve the file, line, column, and offset represented by
|
||||
* the given source location.
|
||||
|
|
|
@ -2786,6 +2786,14 @@ CXSourceRange clang_getRange(CXSourceLocation begin, CXSourceLocation end) {
|
|||
begin.int_data, end.int_data };
|
||||
return Result;
|
||||
}
|
||||
|
||||
unsigned clang_equalRanges(CXSourceRange range1, CXSourceRange range2)
|
||||
{
|
||||
return range1.ptr_data[0] == range2.ptr_data[0]
|
||||
&& range1.ptr_data[1] == range2.ptr_data[1]
|
||||
&& range1.begin_int_data == range2.begin_int_data
|
||||
&& range1.end_int_data == range2.end_int_data;
|
||||
}
|
||||
} // end: extern "C"
|
||||
|
||||
static void createNullLocation(CXFile *file, unsigned *line,
|
||||
|
|
|
@ -36,6 +36,7 @@ _clang_disposeTranslationUnit
|
|||
_clang_enableStackTraces
|
||||
_clang_equalCursors
|
||||
_clang_equalLocations
|
||||
_clang_equalRanges
|
||||
_clang_equalTypes
|
||||
_clang_executeOnThread
|
||||
_clang_formatDiagnostic
|
||||
|
|
|
@ -36,6 +36,7 @@ clang_disposeTranslationUnit
|
|||
clang_enableStackTraces
|
||||
clang_equalCursors
|
||||
clang_equalLocations
|
||||
clang_equalRanges
|
||||
clang_equalTypes
|
||||
clang_executeOnThread
|
||||
clang_formatDiagnostic
|
||||
|
|
Загрузка…
Ссылка в новой задаче