Commit d551c39f authored by Marco Bubke's avatar Marco Bubke

Clang: Fix build

Change-Id: I7a310402ec4527e4db47b46e34078885e08dac0b
Reviewed-by: Nikolai Kosjar's avatarNikolai Kosjar <nikolai.kosjar@qt.io>
parent ecad2cc6
......@@ -3,13 +3,8 @@ INCLUDEPATH += $$PWD
HEADERS += \
$$PWD/clangrefactoringbackend_global.h \
$$PWD/sourcerangefilter.h \
$$PWD/symbolscollector.h \
$$PWD/symbolindexer.h \
$$PWD/symbolentry.h \
$$PWD/collectsymbolsconsumer.h \
$$PWD/collectsymbolsaction.h \
$$PWD/collectmacrossourcefilecallbacks.h \
$$PWD/collectsymbolsastvisitor.h \
$$PWD/sourcelocationentry.h \
$$PWD/symbolscollectorinterface.h \
$$PWD/symbolstorageinterface.h \
......@@ -28,6 +23,8 @@ SOURCES += \
$$PWD/clangtool.cpp \
$$PWD/sourcerangeextractor.cpp \
$$PWD/locationsourcefilecallbacks.cpp \
$$PWD/collectsymbolsaction.cpp \
$$PWD/symbolscollector.cpp \
$$PWD/clangquerygatherer.cpp
HEADERS += \
......@@ -44,15 +41,18 @@ HEADERS += \
$$PWD/clangtool.h \
$$PWD/sourcerangeextractor.h \
$$PWD/locationsourcefilecallbacks.h \
$$PWD/collectmacrossourcefilecallbacks.cpp \
$$PWD/collectsymbolsconsumer.h \
$$PWD/collectsymbolsaction.h \
$$PWD/collectsymbolsastvisitor.h \
$$PWD/collectmacrossourcefilecallbacks.h \
$$PWD/symbolscollector.h \
$$PWD/clangquerygatherer.h
}
SOURCES += \
$$PWD/sourcerangefilter.cpp \
$$PWD/symbolscollector.cpp \
$$PWD/symbolindexer.cpp \
$$PWD/collectsymbolsaction.cpp \
$$PWD/collectmacrossourcefilecallbacks.cpp \
$$PWD/symbolentry.cpp \
$$PWD/sourcelocationentry.cpp \
$$PWD/symbolstorage.cpp
......@@ -67,7 +67,7 @@ public:
if (found == m_symbolEntries.end()) {
m_symbolEntries.emplace(std::piecewise_construct,
std::forward_as_tuple(globalId),
std::forward_as_tuple(generateUSR(declaration), declaration->getName()));
std::forward_as_tuple(generateUSR(declaration), symbolName(declaration)));
}
m_sourceLocationEntries.emplace_back(globalId,
......@@ -116,13 +116,20 @@ public:
m_sourceManager.getSpellingColumnNumber(sourceLocation)};
}
llvm::SmallVector<char, 128> generateUSR(const clang::Decl *declaration)
Utils::PathString generateUSR(const clang::Decl *declaration)
{
llvm::SmallVector<char, 128> usr;
clang::index::generateUSRForDecl(declaration, usr);
return usr;
return {usr.data(), usr.size()};
}
Utils::SmallString symbolName(const clang::NamedDecl *declaration)
{
const llvm::StringRef symbolName{declaration->getName()};
return {symbolName.data(), symbolName.size()};
}
static SymbolIndex toSymbolIndex(const void *pointer)
......
......@@ -29,9 +29,6 @@
#include <utils/smallstring.h>
#include <llvm/ADT/SmallVector.h>
#include <llvm/ADT/StringRef.h>
#include <limits>
#include <unordered_map>
#include <iosfwd>
......@@ -43,12 +40,6 @@ using SymbolIndex = long long;
class SymbolEntry
{
public:
SymbolEntry(const llvm::SmallVector<char, 128> &usr,
llvm::StringRef name)
: usr(usr.data(), usr.size()),
symbolName(name.data(), name.size())
{}
SymbolEntry(Utils::PathString &&usr,
Utils::SmallString &&symbolName)
: usr(std::move(usr)),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment