This is a modified patch provided from MikoĊaj Siedlarek!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179384
91177308-0d34-0410-b5e6-
96231b3b80d8
* compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable.
*/
#define CINDEX_VERSION_MAJOR 0
-#define CINDEX_VERSION_MINOR 16
+#define CINDEX_VERSION_MINOR 17
#define CINDEX_VERSION_ENCODE(major, minor) ( \
((major) * 10000) \
CXFile file,
unsigned offset);
+/**
+ * \brief Returns non-zero if the given source location is in a system header.
+ */
+CINDEX_LINKAGE int clang_Location_isInSystemHeader(CXSourceLocation location);
+
/**
* \brief Retrieve a NULL (invalid) source range.
*/
extern "C" {
+int clang_Location_isInSystemHeader(CXSourceLocation location) {
+ const SourceLocation Loc =
+ SourceLocation::getFromRawEncoding(location.int_data);
+ if (Loc.isInvalid())
+ return 0;
+
+ const SourceManager &SM =
+ *static_cast<const SourceManager*>(location.ptr_data[0]);
+ return SM.isInSystemHeader(Loc);
+}
+
void clang_getExpansionLocation(CXSourceLocation location,
CXFile *file,
unsigned *line,
clang_isVirtualBase
clang_isVolatileQualifiedType
clang_loadDiagnostics
+clang_Location_isInSystemHeader
clang_parseTranslationUnit
clang_remap_dispose
clang_remap_getFilenames