From 7c09f3339b5c6a284dbb8dd15dc4d39f9ebbdced Mon Sep 17 00:00:00 2001 From: mlangkabel Date: Mon, 2 Jul 2018 13:00:41 +0200 Subject: [PATCH] ui: store and display translation unit of recorded indexing errors --- src/lib/data/indexer/TaskBuildIndex.cpp | 2 +- .../shared_types/SharedStorageTypes.h | 5 +++ src/lib/data/parser/ParserClient.cpp | 8 +--- src/lib/data/parser/ParserClient.h | 6 +-- src/lib/data/parser/ParserClientImpl.cpp | 8 ++-- src/lib/data/parser/ParserClientImpl.h | 4 +- .../storage/sqlite/SqliteIndexStorage.cpp | 11 +++-- src/lib/data/storage/type/StorageError.h | 6 +++ .../data/parser/cxx/CxxDiagnosticConsumer.cpp | 7 +++- .../data/parser/cxx/CxxDiagnosticConsumer.h | 3 ++ src/lib_cxx/data/parser/cxx/CxxParser.cpp | 9 +++-- src/lib_cxx/data/parser/cxx/CxxParser.h | 3 +- src/lib_gui/qt/view/QtErrorView.cpp | 40 ++++++++++--------- src/lib_gui/qt/view/QtErrorView.h | 6 ++- src/lib_java/data/parser/java/JavaParser.cpp | 3 +- src/test/helper/DumpParserClient.h | 2 +- src/test/helper/TestParserClient.h | 3 +- 17 files changed, 77 insertions(+), 49 deletions(-) diff --git a/src/lib/data/indexer/TaskBuildIndex.cpp b/src/lib/data/indexer/TaskBuildIndex.cpp index e0cea033..0d966d6f 100644 --- a/src/lib/data/indexer/TaskBuildIndex.cpp +++ b/src/lib/data/indexer/TaskBuildIndex.cpp @@ -144,7 +144,7 @@ void TaskBuildIndex::doExit(std::shared_ptr blackboard) is->addError(StorageErrorData( L"The translation unit threw an exception during indexing. Please check if the source file " "conforms to the specified language standard and all necessary options are defined within your project " - "setup.", path.wstr(), 1, 1, true, true + "setup.", path.wstr(), 1, 1, path.wstr(), true, true )); LOG_INFO(L"crashed translation unit: " + path.wstr()); } diff --git a/src/lib/data/indexer/interprocess/shared_types/SharedStorageTypes.h b/src/lib/data/indexer/interprocess/shared_types/SharedStorageTypes.h index d1283018..34f9003e 100644 --- a/src/lib/data/indexer/interprocess/shared_types/SharedStorageTypes.h +++ b/src/lib/data/indexer/interprocess/shared_types/SharedStorageTypes.h @@ -123,6 +123,7 @@ struct SharedStorageErrorData const std::string& filePath, uint lineNumber, uint columnNumber, + const std::string& sourceFilePath, bool fatal, bool indexed, SharedMemory::Allocator* allocator @@ -131,6 +132,7 @@ struct SharedStorageErrorData , filePath(filePath.c_str(), allocator) , lineNumber(lineNumber) , columnNumber(columnNumber) + , translationUnit(sourceFilePath.c_str(), allocator) , fatal(fatal) , indexed(indexed) {} @@ -141,6 +143,7 @@ struct SharedStorageErrorData uint lineNumber; uint columnNumber; + SharedMemory::String translationUnit; bool fatal; bool indexed; }; @@ -152,6 +155,7 @@ inline SharedStorageErrorData toShared(const StorageErrorData& error, SharedMemo utility::encodeToUtf8(error.filePath), error.lineNumber, error.columnNumber, + utility::encodeToUtf8(error.translationUnit), error.fatal, error.indexed, allocator ); @@ -164,6 +168,7 @@ inline StorageErrorData fromShared(const SharedStorageErrorData& error) utility::decodeFromUtf8(error.filePath.c_str()), error.lineNumber, error.columnNumber, + utility::decodeFromUtf8(error.translationUnit.c_str()), error.fatal, error.indexed ); diff --git a/src/lib/data/parser/ParserClient.cpp b/src/lib/data/parser/ParserClient.cpp index aad12bc7..f788c128 100644 --- a/src/lib/data/parser/ParserClient.cpp +++ b/src/lib/data/parser/ParserClient.cpp @@ -75,14 +75,10 @@ ParserClient::ParserClient() { } -ParserClient::~ParserClient() -{ -} - void ParserClient::recordError( - const ParseLocation& location, const std::wstring& message, bool fatal, bool indexed) + const ParseLocation& errorLocation, const std::wstring& message, bool fatal, bool indexed, const FilePath& translationUnit) { - doRecordError(location, message, fatal, indexed); + doRecordError(errorLocation, message, fatal, indexed, translationUnit); if (fatal) { diff --git a/src/lib/data/parser/ParserClient.h b/src/lib/data/parser/ParserClient.h index 6bdc687d..68c61546 100644 --- a/src/lib/data/parser/ParserClient.h +++ b/src/lib/data/parser/ParserClient.h @@ -26,7 +26,7 @@ public: const std::wstring& str, const ParseLocation& location, const ParseLocation& scopeLocation); ParserClient(); - virtual ~ParserClient(); + virtual ~ParserClient() = default; virtual Id recordSymbol( const NameHierarchy& symbolName, SymbolKind symbolKind, @@ -50,7 +50,7 @@ public: const NameHierarchy& qualifierName, const ParseLocation& location) = 0; void recordError( - const ParseLocation& location, const std::wstring& message, bool fatal, bool indexed); + const ParseLocation& errorLocation, const std::wstring& message, bool fatal, bool indexed, const FilePath& translationUnit); virtual void recordLocalSymbol(const std::wstring& name, const ParseLocation& location) = 0; virtual void recordFile(const FileInfo& fileInfo, bool indexed) = 0; @@ -60,7 +60,7 @@ public: protected: virtual void doRecordError( - const ParseLocation& location, const std::wstring& message, bool fatal, bool indexed) = 0; + const ParseLocation& errorLocation, const std::wstring& message, bool fatal, bool indexed, const FilePath& translationUnit) = 0; bool m_hasFatalErrors; }; diff --git a/src/lib/data/parser/ParserClientImpl.cpp b/src/lib/data/parser/ParserClientImpl.cpp index 6eea0c13..bed67710 100644 --- a/src/lib/data/parser/ParserClientImpl.cpp +++ b/src/lib/data/parser/ParserClientImpl.cpp @@ -91,11 +91,11 @@ void ParserClientImpl::recordComment(const ParseLocation& location) } void ParserClientImpl::doRecordError( - const ParseLocation& location, const std::wstring& message, bool fatal, bool indexed) + const ParseLocation& location, const std::wstring& message, bool fatal, bool indexed, const FilePath& translationUnit) { if (location.isValid()) { - addError(message, fatal, indexed, location); + addError(message, fatal, indexed, location, translationUnit); } } @@ -331,7 +331,7 @@ void ParserClientImpl::addCommentLocation(const ParseLocation& location) } void ParserClientImpl::addError( - const std::wstring& message, bool fatal, bool indexed, const ParseLocation& location) + const std::wstring& message, bool fatal, bool indexed, const ParseLocation& location, const FilePath& translationUnit) { if (!m_storage) { @@ -339,6 +339,6 @@ void ParserClientImpl::addError( } m_storage->addError(StorageErrorData( - message, location.filePath.wstr(), location.startLineNumber, location.startColumnNumber, fatal, indexed + message, location.filePath.wstr(), location.startLineNumber, location.startColumnNumber, translationUnit.wstr(), fatal, indexed )); } diff --git a/src/lib/data/parser/ParserClientImpl.h b/src/lib/data/parser/ParserClientImpl.h index 294c1047..6acee80f 100644 --- a/src/lib/data/parser/ParserClientImpl.h +++ b/src/lib/data/parser/ParserClientImpl.h @@ -45,7 +45,7 @@ public: private: virtual void doRecordError( - const ParseLocation& location, const std::wstring& message, bool fatal, bool indexed) override; + const ParseLocation& location, const std::wstring& message, bool fatal, bool indexed, const FilePath& sourceFilePath) override; NodeType symbolKindToNodeType(SymbolKind symbolType) const; Edge::EdgeType referenceKindToEdgeType(ReferenceKind referenceKind) const; @@ -61,7 +61,7 @@ private: void addComponentAccess(Id nodeId , int type); void addCommentLocation(const ParseLocation& location); void addError(const std::wstring& message, bool fatal, bool indexed, - const ParseLocation& location); + const ParseLocation& location, const FilePath& sourceFilePath); std::shared_ptr m_storage; }; diff --git a/src/lib/data/storage/sqlite/SqliteIndexStorage.cpp b/src/lib/data/storage/sqlite/SqliteIndexStorage.cpp index ae04f89e..c30f74cf 100644 --- a/src/lib/data/storage/sqlite/SqliteIndexStorage.cpp +++ b/src/lib/data/storage/sqlite/SqliteIndexStorage.cpp @@ -9,7 +9,7 @@ #include "data/location/SourceLocationCollection.h" #include "data/location/SourceLocationFile.h" -const size_t SqliteIndexStorage::s_storageVersion = 16; +const size_t SqliteIndexStorage::s_storageVersion = 17; SqliteIndexStorage::SqliteIndexStorage(const FilePath& dbFilePath) : SqliteStorage(dbFilePath.getCanonical()) @@ -281,6 +281,7 @@ StorageError SqliteIndexStorage::addError(const StorageErrorData& data) m_insertErrorStmt.bind(4, utility::encodeToUtf8(data.filePath).c_str()); m_insertErrorStmt.bind(5, int(data.lineNumber)); m_insertErrorStmt.bind(6, int(data.columnNumber)); + m_insertErrorStmt.bind(7, utility::encodeToUtf8(data.translationUnit).c_str()); const bool success = executeStatement(m_insertErrorStmt); if (success) @@ -1056,6 +1057,7 @@ void SqliteIndexStorage::setupTables() "file_path TEXT, " "line_number INTEGER, " "column_number INTEGER, " + "translation_unit TEXT, " "PRIMARY KEY(id));" ); } @@ -1136,7 +1138,7 @@ void SqliteIndexStorage::setupPrecompiledStatements() "LIMIT 1;" ); m_insertErrorStmt = m_database.compileStatement( - "INSERT INTO error(message, fatal, indexed, file_path, line_number, column_number) VALUES(?, ?, ?, ?, ?, ?);" + "INSERT INTO error(message, fatal, indexed, file_path, line_number, column_number, translation_unit) VALUES(?, ?, ?, ?, ?, ?, ?);" ); } catch (CppSQLite3Exception& e) @@ -1383,7 +1385,7 @@ template <> std::vector SqliteIndexStorage::doGetAll(const std::string& query) const { CppSQLite3Query q = executeQuery( - "SELECT message, fatal, indexed, file_path, line_number, column_number FROM error " + query + ";" + "SELECT message, fatal, indexed, file_path, line_number, column_number, translation_unit FROM error " + query + ";" ); std::vector errors; @@ -1396,11 +1398,12 @@ std::vector SqliteIndexStorage::doGetAll(const std:: const std::string filePath = q.getStringField(3, ""); const int lineNumber = q.getIntField(4, -1); const int columnNumber = q.getIntField(5, -1); + const std::string translationUnit = q.getStringField(6, ""); if (lineNumber != -1 && columnNumber != -1) { errors.push_back(StorageError( - id, utility::decodeFromUtf8(message), utility::decodeFromUtf8(filePath), lineNumber, columnNumber, fatal, indexed) + id, utility::decodeFromUtf8(message), utility::decodeFromUtf8(filePath), lineNumber, columnNumber, utility::decodeFromUtf8(translationUnit), fatal, indexed) ); id++; } diff --git a/src/lib/data/storage/type/StorageError.h b/src/lib/data/storage/type/StorageError.h index 45a92a14..b63109db 100644 --- a/src/lib/data/storage/type/StorageError.h +++ b/src/lib/data/storage/type/StorageError.h @@ -13,6 +13,7 @@ struct StorageErrorData , filePath(L"") , lineNumber(-1) , columnNumber(-1) + , translationUnit(L"") , fatal(0) , indexed(0) {} @@ -22,6 +23,7 @@ struct StorageErrorData const std::wstring& filePath, uint lineNumber, uint columnNumber, + const std::wstring& translationUnit, bool fatal, bool indexed ) @@ -29,6 +31,7 @@ struct StorageErrorData , filePath(filePath) , lineNumber(lineNumber) , columnNumber(columnNumber) + , translationUnit(translationUnit) , fatal(fatal) , indexed(indexed) {} @@ -39,6 +42,7 @@ struct StorageErrorData uint lineNumber; uint columnNumber; + std::wstring translationUnit; bool fatal; bool indexed; }; @@ -61,6 +65,7 @@ struct StorageError: public StorageErrorData const std::wstring& filePath, uint lineNumber, uint columnNumber, + const std::wstring& translationUnit, bool fatal, bool indexed ) @@ -69,6 +74,7 @@ struct StorageError: public StorageErrorData filePath, lineNumber, columnNumber, + translationUnit, fatal, indexed ) diff --git a/src/lib_cxx/data/parser/cxx/CxxDiagnosticConsumer.cpp b/src/lib_cxx/data/parser/cxx/CxxDiagnosticConsumer.cpp index 27dbd20e..c3afb96c 100644 --- a/src/lib_cxx/data/parser/cxx/CxxDiagnosticConsumer.cpp +++ b/src/lib_cxx/data/parser/cxx/CxxDiagnosticConsumer.cpp @@ -16,12 +16,14 @@ CxxDiagnosticConsumer::CxxDiagnosticConsumer( std::shared_ptr client, std::shared_ptr fileRegister, std::shared_ptr canonicalFilePathCache, + const FilePath& sourceFilePath, bool useLogging ) : clang::TextDiagnosticPrinter(os, diags) , m_client(client) , m_register(fileRegister) , m_canonicalFilePathCache(canonicalFilePathCache) + , m_sourceFilePath(sourceFilePath) , m_isParsingFile(false) , m_useLogging(useLogging) { @@ -34,6 +36,8 @@ void CxxDiagnosticConsumer::BeginSourceFile(const clang::LangOptions& langOption clang::TextDiagnosticPrinter::BeginSourceFile(langOptions, preProcessor); } + + m_isParsingFile = true; } @@ -107,7 +111,8 @@ void CxxDiagnosticConsumer::HandleDiagnostic(clang::DiagnosticsEngine::Level lev location, utility::decodeFromUtf8(message), level == clang::DiagnosticsEngine::Fatal, - m_register->hasFilePath(location.filePath) + m_register->hasFilePath(location.filePath), + m_sourceFilePath ); } } diff --git a/src/lib_cxx/data/parser/cxx/CxxDiagnosticConsumer.h b/src/lib_cxx/data/parser/cxx/CxxDiagnosticConsumer.h index dc9dc442..cddc1fe0 100644 --- a/src/lib_cxx/data/parser/cxx/CxxDiagnosticConsumer.h +++ b/src/lib_cxx/data/parser/cxx/CxxDiagnosticConsumer.h @@ -2,6 +2,7 @@ #define CXX_DIAGNOSTIC_CONSUMER #include "clang/Frontend/TextDiagnosticPrinter.h" +#include "utility/file/FilePath.h" class CanonicalFilePathCache; class FileRegister; @@ -17,6 +18,7 @@ public: std::shared_ptr client, std::shared_ptr fileRegister, std::shared_ptr canonicalFilePathCache, + const FilePath& sourceFilePath, bool useLogging = true ); @@ -30,6 +32,7 @@ private: std::shared_ptr m_register; std::shared_ptr m_canonicalFilePathCache; + const FilePath m_sourceFilePath; bool m_isParsingFile; bool m_useLogging; }; diff --git a/src/lib_cxx/data/parser/cxx/CxxParser.cpp b/src/lib_cxx/data/parser/cxx/CxxParser.cpp index d86dcc8e..9dc253e0 100644 --- a/src/lib_cxx/data/parser/cxx/CxxParser.cpp +++ b/src/lib_cxx/data/parser/cxx/CxxParser.cpp @@ -110,7 +110,7 @@ void CxxParser::buildIndex(const std::wstring& fileName, std::shared_ptr canonicalFilePathCache = std::make_shared(); - std::shared_ptr diagnostics = getDiagnostics(canonicalFilePathCache, false); + std::shared_ptr diagnostics = getDiagnostics(FilePath(), canonicalFilePathCache, false); ASTActionFactory actionFactory(m_client, m_fileRegister, canonicalFilePathCache); std::vector args = getCommandlineArgumentsEssential(compilerFlags, std::vector(), std::vector()); @@ -130,7 +130,7 @@ void CxxParser::runTool(clang::tooling::CompilationDatabase* compilationDatabase std::shared_ptr canonicalFilePathCache = std::make_shared(); - std::shared_ptr diagnostics = getDiagnostics(canonicalFilePathCache, true); + std::shared_ptr diagnostics = getDiagnostics(sourceFilePath, canonicalFilePathCache, true); tool.setDiagnosticConsumer(diagnostics.get()); @@ -195,9 +195,10 @@ std::vector CxxParser::getCommandlineArguments(std::shared_ptr CxxParser::getDiagnostics(std::shared_ptr canonicalFilePathCache, bool logErrors) const +std::shared_ptr CxxParser::getDiagnostics(const FilePath& sourceFilePath, std::shared_ptr canonicalFilePathCache, bool logErrors) const { llvm::IntrusiveRefCntPtr options = new clang::DiagnosticOptions(); return std::make_shared( - llvm::errs(), &*options, m_client, m_fileRegister, canonicalFilePathCache, logErrors); + llvm::errs(), &*options, m_client, m_fileRegister, canonicalFilePathCache, sourceFilePath, logErrors + ); } diff --git a/src/lib_cxx/data/parser/cxx/CxxParser.h b/src/lib_cxx/data/parser/cxx/CxxParser.h index facc5a41..e9649c34 100644 --- a/src/lib_cxx/data/parser/cxx/CxxParser.h +++ b/src/lib_cxx/data/parser/cxx/CxxParser.h @@ -37,7 +37,8 @@ private: const std::vector& frameworkSearchPaths) const; std::vector getCommandlineArguments(std::shared_ptr indexerCommand) const; - std::shared_ptr getDiagnostics(std::shared_ptr canonicalFilePathCache, bool logErrors) const; + std::shared_ptr getDiagnostics( + const FilePath& sourceFilePath, std::shared_ptr canonicalFilePathCache, bool logErrors) const; friend class TaskParseCxx; diff --git a/src/lib_gui/qt/view/QtErrorView.cpp b/src/lib_gui/qt/view/QtErrorView.cpp index 0f84a787..2ce2b088 100644 --- a/src/lib_gui/qt/view/QtErrorView.cpp +++ b/src/lib_gui/qt/view/QtErrorView.cpp @@ -86,14 +86,15 @@ void QtErrorView::initView() // Setup Table Headers m_model->setColumnCount(COLUMN_MAX + 1); - m_table->setColumnWidth(COLUMN::ID, 40); - m_table->setColumnWidth(COLUMN::TYPE, 80); - m_table->setColumnWidth(COLUMN::MESSAGE, 450); - m_table->setColumnWidth(COLUMN::FILE, 300); - m_table->setColumnWidth(COLUMN::LINE, 50); + m_table->setColumnWidth(Column::ID, 40); + m_table->setColumnWidth(Column::TYPE, 80); + m_table->setColumnWidth(Column::MESSAGE, 450); + m_table->setColumnWidth(Column::FILE, 300); + m_table->setColumnWidth(Column::LINE, 50); + m_table->setColumnWidth(Column::TRANSLATION_UNIT, 300); QStringList headers; - headers << "ID" << "Type" << "Message" << "File" << "Line" << "Indexed"; + headers << "ID" << "Type" << "Message" << "File" << "Line" << "Indexed" << "Translation Unit"; m_model->setHorizontalHeaderLabels(headers); connect(m_table->selectionModel(), &QItemSelectionModel::currentRowChanged, @@ -101,12 +102,12 @@ void QtErrorView::initView() { if (index.isValid() && !m_ignoreRowSelection) { - if (m_model->item(index.row(), COLUMN::FILE) == nullptr) + if (m_model->item(index.row(), Column::FILE) == nullptr) { return; } - Id errorId = m_model->item(index.row(), COLUMN::ID)->text().toUInt(); + Id errorId = m_model->item(index.row(), Column::ID)->text().toUInt(); m_controllerProxy.executeAsTaskWithArgs(&ErrorController::showError, errorId); } @@ -263,7 +264,7 @@ void QtErrorView::setErrorId(Id errorId) { m_onQtThread([=]() { - QList items = m_model->findItems(QString::number(errorId), Qt::MatchExactly, COLUMN::ID); + QList items = m_model->findItems(QString::number(errorId), Qt::MatchExactly, Column::ID); if (items.size() == 1) { @@ -360,25 +361,28 @@ void QtErrorView::addErrorToTable(const ErrorInfo& error) QStandardItem *item = new QStandardItem(); item->setData(QVariant(qlonglong(error.id)), Qt::DisplayRole); - m_model->setItem(rowNumber, COLUMN::ID, item); + m_model->setItem(rowNumber, Column::ID, item); - m_model->setItem(rowNumber, COLUMN::TYPE, new QStandardItem(error.fatal ? "FATAL" : "ERROR")); + m_model->setItem(rowNumber, Column::TYPE, new QStandardItem(error.fatal ? "FATAL" : "ERROR")); if (error.fatal) { - m_model->item(rowNumber, COLUMN::TYPE)->setForeground(QBrush(Qt::red)); + m_model->item(rowNumber, Column::TYPE)->setForeground(QBrush(Qt::red)); } - m_model->item(rowNumber, COLUMN::TYPE)->setIcon(s_errorIcon); + m_model->item(rowNumber, Column::TYPE)->setIcon(s_errorIcon); - m_model->setItem(rowNumber, COLUMN::MESSAGE, new QStandardItem(QString::fromStdWString(error.message))); + m_model->setItem(rowNumber, Column::MESSAGE, new QStandardItem(QString::fromStdWString(error.message))); - m_model->setItem(rowNumber, COLUMN::FILE, new QStandardItem(QString::fromStdWString(error.filePath))); - m_model->item(rowNumber, COLUMN::FILE)->setToolTip(QString::fromStdWString(error.filePath)); + m_model->setItem(rowNumber, Column::FILE, new QStandardItem(QString::fromStdWString(error.filePath))); + m_model->item(rowNumber, Column::FILE)->setToolTip(QString::fromStdWString(error.filePath)); item = new QStandardItem(); item->setData(QVariant(error.lineNumber), Qt::DisplayRole); - m_model->setItem(rowNumber, COLUMN::LINE, item); + m_model->setItem(rowNumber, Column::LINE, item); - m_model->setItem(rowNumber, COLUMN::INDEXED, new QStandardItem(error.indexed ? "yes" : "no")); + m_model->setItem(rowNumber, Column::INDEXED, new QStandardItem(error.indexed ? "yes" : "no")); + + m_model->setItem(rowNumber, Column::TRANSLATION_UNIT, new QStandardItem(QString::fromStdWString(error.translationUnit))); + m_model->item(rowNumber, Column::TRANSLATION_UNIT)->setToolTip(QString::fromStdWString(error.translationUnit)); } QCheckBox* QtErrorView::createFilterCheckbox(const QString& name, bool checked, QBoxLayout* layout) diff --git a/src/lib_gui/qt/view/QtErrorView.h b/src/lib_gui/qt/view/QtErrorView.h index f5cd7150..57b007b6 100644 --- a/src/lib_gui/qt/view/QtErrorView.h +++ b/src/lib_gui/qt/view/QtErrorView.h @@ -48,14 +48,16 @@ private slots: void errorFilterChanged(int i = 0); private: - enum COLUMN { + enum Column + { ID = 0, TYPE = 1, MESSAGE = 2, FILE = 3, LINE = 4, INDEXED = 5, - COLUMN_MAX = INDEXED + TRANSLATION_UNIT = 6, + COLUMN_MAX = TRANSLATION_UNIT }; void setStyleSheet() const; diff --git a/src/lib_java/data/parser/java/JavaParser.cpp b/src/lib_java/data/parser/java/JavaParser.cpp index c866a469..38b64943 100644 --- a/src/lib_java/data/parser/java/JavaParser.cpp +++ b/src/lib_java/data/parser/java/JavaParser.cpp @@ -265,6 +265,7 @@ void JavaParser::doRecordError( ParseLocation(m_currentFilePath, beginLine, beginColumn, endLine, endColumn), utility::decodeFromUtf8(m_javaEnvironment->toStdString(jMessage)), fatal, - indexed + indexed, + FilePath() ); } diff --git a/src/test/helper/DumpParserClient.h b/src/test/helper/DumpParserClient.h index 33b0e0fa..18f5e6fa 100644 --- a/src/test/helper/DumpParserClient.h +++ b/src/test/helper/DumpParserClient.h @@ -97,7 +97,7 @@ public: private: virtual void doRecordError(const ParseLocation& location, const std::wstring& message, - bool fatal, bool indexed) override + bool fatal, bool indexed, const FilePath& translationUnit) override { recordLine(L"ERROR: " + addLocationSuffix(message + L" [" + location.filePath.fileName(), location) + L"]\n"); } diff --git a/src/test/helper/TestParserClient.h b/src/test/helper/TestParserClient.h index c22e11b6..4196f613 100644 --- a/src/test/helper/TestParserClient.h +++ b/src/test/helper/TestParserClient.h @@ -166,7 +166,8 @@ private: const ParseLocation& location, const std::wstring& message, bool fatal, - bool indexed) override + bool indexed, + const FilePath& translationUnit) override { if (location.isValid()) {