diff options
Diffstat (limited to 'sources/shiboken2/ApiExtractor/clangparser/clangutils.h')
-rw-r--r-- | sources/shiboken2/ApiExtractor/clangparser/clangutils.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/sources/shiboken2/ApiExtractor/clangparser/clangutils.h b/sources/shiboken2/ApiExtractor/clangparser/clangutils.h index 738b51bb4..41d0af460 100644 --- a/sources/shiboken2/ApiExtractor/clangparser/clangutils.h +++ b/sources/shiboken2/ApiExtractor/clangparser/clangutils.h @@ -30,6 +30,7 @@ #define CLANGUTILS_H #include <clang-c/Index.h> +#include <qtcompat.h> #include <QtCore/QPair> #include <QtCore/QString> #include <QtCore/QStringList> @@ -40,10 +41,10 @@ QT_FORWARD_DECLARE_CLASS(QDebug) bool operator==(const CXCursor &c1, const CXCursor &c2); -uint qHash(const CXCursor &c, uint seed = 0); +QtCompatHashFunctionType qHash(const CXCursor &c, QtCompatHashFunctionType seed = 0); bool operator==(const CXType &t1, const CXType &t2); -uint qHash(const CXType &ct, uint seed); +QtCompatHashFunctionType qHash(const CXType &ct, QtCompatHashFunctionType seed); namespace clang { @@ -61,16 +62,24 @@ inline bool isCursorValid(const CXCursor &c) return c.kind < CXCursor_FirstInvalid || c.kind > CXCursor_LastInvalid; } +QString getFileName(CXFile file); // Uncached,see BaseVisitor for a cached version + struct SourceLocation { - int compare(const SourceLocation &rhs) const; + bool equals(const SourceLocation &rhs) const; - QString file; + CXFile file; unsigned line = 0; unsigned column = 0; unsigned offset = 0; }; +inline bool operator==(const SourceLocation &l1, const SourceLocation &l2) +{ return l1.equals(l2); } + +inline bool operator!=(const SourceLocation &l1, const SourceLocation &l2) +{ return !l1.equals(l2); } + SourceLocation getExpansionLocation(const CXSourceLocation &location); using SourceRange =QPair<SourceLocation, SourceLocation>; |