diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-07-12 10:06:48 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-07-23 10:15:43 +0000 |
| commit | 0aaa1ecd864fc7cb2c1b8f2765687b1fe53d3103 (patch) | |
| tree | d4f8f9ce1169feab4c21af73aef6a6899ddc14ac /sources/shiboken2/ApiExtractor/clangparser/clangutils.cpp | |
| parent | ff3bfa061034d66dc2300de0d1a9dfa87850ccb8 (diff) | |
shiboken: Cache TypeInfo in clangbuilder
Add a cache containing the TypeInfo for the CXType structs.
Task-number: PYSIDE-672
Change-Id: Ibd0b5bb3f01fa507a65ded8f121c12a10aa7c401
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/clangparser/clangutils.cpp')
| -rw-r--r-- | sources/shiboken2/ApiExtractor/clangparser/clangutils.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sources/shiboken2/ApiExtractor/clangparser/clangutils.cpp b/sources/shiboken2/ApiExtractor/clangparser/clangutils.cpp index a68c5b5ee..8bee28cdf 100644 --- a/sources/shiboken2/ApiExtractor/clangparser/clangutils.cpp +++ b/sources/shiboken2/ApiExtractor/clangparser/clangutils.cpp @@ -46,6 +46,18 @@ uint qHash(const CXCursor &c, uint seed) ^ qHash(c.data[1]) ^ qHash(c.data[2]) ^ seed; } +bool operator==(const CXType &t1, const CXType &t2) +{ + return t1.kind == t2.kind && t1.data[0] == t2.data[0] + && t1.data[1] == t2.data[1]; +} + +uint qHash(const CXType &ct, uint seed) +{ + return uint(ct.kind) ^ uint(0xFFFFFFFF & quintptr(ct.data[0])) + ^ uint(0xFFFFFFFF & quintptr(ct.data[1])) ^ seed; +} + namespace clang { SourceLocation getExpansionLocation(const CXSourceLocation &location) |
