data: removed storing commandline for errors

* reason: commandline string may be large (7GB for 20k errors in the UnrealEngine)
This commit is contained in:
mlangkabel
2017-12-12 10:04:44 +01:00
parent 4da2b1f8f4
commit 928aa45bfc
17 changed files with 43 additions and 77 deletions
@@ -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;
};
-11
View File
@@ -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);