summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorIvan Donchevskii <ivan.donchevskii@qt.io>2018-09-13 12:22:21 +0200
committerIvan Donchevskii <ivan.donchevskii@qt.io>2018-09-13 11:15:20 +0000
commit292cc7c8161617626ccb230d46889f49a65770bf (patch)
tree972d86972275852f483ff6e296a544247ffd31cd /src/tools
parent50e5aacb026e79995c9967b12eabb9d37336a841 (diff)
downloadqt-creator-292cc7c8161617626ccb230d46889f49a65770bf.tar.gz
Clang: Remove redundant workaround for operator arguments
With updated libclang 8c21a7a396 is not required anymore. Change-Id: Ied17a946e5e361441ebe2900dac59b7fe434f36e Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/clangbackend/source/clangreferencescollector.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/tools/clangbackend/source/clangreferencescollector.cpp b/src/tools/clangbackend/source/clangreferencescollector.cpp
index d496eab583..a3969aeb56 100644
--- a/src/tools/clangbackend/source/clangreferencescollector.cpp
+++ b/src/tools/clangbackend/source/clangreferencescollector.cpp
@@ -43,15 +43,8 @@ namespace {
class ReferencedCursor
{
public:
- static ReferencedCursor find(const Cursor &cursor, const CXToken &token)
+ static ReferencedCursor find(const Cursor &cursor)
{
- if (cursor.spelling().startsWith("operator")
- && clang_getTokenKind(token) == CXToken_Identifier) {
- // We are actually inside operator, use clang_getCursor to return a proper cursor instead.
- return find(clang_getCursor(cursor.cxTranslationUnit(),
- clang_getTokenLocation(cursor.cxTranslationUnit(), token)),
- token);
- }
// Query the referenced cursor directly instead of first testing with cursor.isReference().
// cursor.isReference() reports false for e.g. CXCursor_DeclRefExpr or CXCursor_CallExpr
// although it returns a valid cursor.
@@ -209,7 +202,7 @@ bool ReferencesCollector::checkToken(unsigned index, const Utf8String &identifie
}
const Cursor currentCursor(m_cxCursors[static_cast<int>(index)]);
- const ReferencedCursor candidate = ReferencedCursor::find(currentCursor, token);
+ const ReferencedCursor candidate = ReferencedCursor::find(currentCursor);
return candidate.usr() == usr;
}
@@ -224,7 +217,7 @@ ReferencesResult ReferencesCollector::collect(uint line, uint column, bool local
const Cursor cursorFromUser = m_cxCursors[static_cast<int>(index)];
- const ReferencedCursor refCursor = ReferencedCursor::find(cursorFromUser, m_cxTokens[index]);
+ const ReferencedCursor refCursor = ReferencedCursor::find(cursorFromUser);
const Utf8String usr = refCursor.usr();
if (usr.isEmpty())
return result;