data: removed storing commandline for errors
* reason: commandline string may be large (7GB for 20k errors in the UnrealEngine)
This commit is contained in:
@@ -94,14 +94,8 @@ void CxxDiagnosticConsumer::HandleDiagnostic(clang::DiagnosticsEngine::Level lev
|
||||
m_client->recordError(
|
||||
location,
|
||||
message,
|
||||
m_commandline,
|
||||
level == clang::DiagnosticsEngine::Fatal,
|
||||
m_register->hasFilePath(location.filePath)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void CxxDiagnosticConsumer::setCommandLine(const std::string& commandline)
|
||||
{
|
||||
m_commandline = commandline;
|
||||
}
|
||||
|
||||
@@ -25,15 +25,11 @@ public:
|
||||
|
||||
void HandleDiagnostic(clang::DiagnosticsEngine::Level level, const clang::Diagnostic& info);
|
||||
|
||||
void setCommandLine(const std::string& commandline);
|
||||
|
||||
private:
|
||||
std::shared_ptr<ParserClient> m_client;
|
||||
std::shared_ptr<FileRegister> m_register;
|
||||
std::shared_ptr<CanonicalFilePathCache> m_canonicalFilePathCache;
|
||||
|
||||
std::string m_commandline;
|
||||
|
||||
bool m_isParsingFile;
|
||||
bool m_useLogging;
|
||||
};
|
||||
|
||||
@@ -116,17 +116,6 @@ void CxxParser::runTool(clang::tooling::CompilationDatabase* compilationDatabase
|
||||
|
||||
std::shared_ptr<CxxDiagnosticConsumer> diagnostics = getDiagnostics(canonicalFilePathCache, true);
|
||||
|
||||
std::vector<clang::tooling::CompileCommand> compileCommands = compilationDatabase->getCompileCommands(sourceFilePath.str());
|
||||
if (compileCommands.size() == 1)
|
||||
{
|
||||
std::string commandline;
|
||||
for (const std::string& str : compileCommands[0].CommandLine)
|
||||
{
|
||||
commandline += str + " ";
|
||||
}
|
||||
diagnostics->setCommandLine(commandline);
|
||||
}
|
||||
|
||||
tool.setDiagnosticConsumer(diagnostics.get());
|
||||
|
||||
ASTActionFactory actionFactory(m_client, m_fileRegister, canonicalFilePathCache);
|
||||
|
||||
Reference in New Issue
Block a user