forked from qt-creator/qt-creator
Clang: Fix path for clang query
Task-number: QTCREATORBUG-18814 Change-Id: I638fa4dd993e8efbabefc883622e1619b4e5d9cc Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -63,10 +63,10 @@ llvm::SmallString<256> absolutePath(clang::StringRef path)
|
||||
return absolutePath;
|
||||
}
|
||||
|
||||
template <typename Container>
|
||||
Utils::PathString fromNativePath(Container container)
|
||||
inline
|
||||
Utils::PathString fromNativePath(const llvm::SmallString<256> &string)
|
||||
{
|
||||
Utils::PathString path(container.data(), container.size());
|
||||
Utils::PathString path(string.data(), string.size());
|
||||
|
||||
#ifdef _WIN32
|
||||
std::replace(path.begin(), path.end(), '\\', '/');
|
||||
@@ -91,7 +91,7 @@ void appendSourceLocationsToSourceLocationsContainer(
|
||||
const auto fileEntry = sourceManager.getFileEntryForID(fileId);
|
||||
|
||||
sourceLocationsContainer.insertFilePath(fileId.getHashValue(),
|
||||
fromNativePath(fileEntry->tryGetRealPathName()));
|
||||
fromNativePath(absolutePath(fileEntry->getName())));
|
||||
sourceLocationsContainer.insertSourceLocation(fileId.getHashValue(),
|
||||
fullSourceLocation.getSpellingLineNumber(),
|
||||
fullSourceLocation.getSpellingColumnNumber(),
|
||||
|
||||
Reference in New Issue
Block a user