Commit 332caf38 authored by Nikolai Kosjar's avatar Nikolai Kosjar
Browse files

Clang: Print cmd line equivalent if using QTC_CLANG_VERBOSE



...so we can easily check if the bug is in (lib)clang itself.

Change-Id: Id6dfd8014efc1c7704265b99697f19ab990286a7
Reviewed-by: default avatarErik Verbruggen <erik.verbruggen@digia.com>
parent cbf98ba8
......@@ -32,6 +32,7 @@
#include <cplusplus/CppDocument.h>
#include <cpptools/cppmodelmanagerinterface.h>
#include <utils/hostosinfo.h>
#include <utils/runextensions.h>
#include <QCoreApplication>
......@@ -84,6 +85,17 @@ CreateMarkers::CreateMarkers(SemanticMarker::Ptr semanticMarker,
CreateMarkers::~CreateMarkers()
{ }
static QString commandLine(const QStringList &options, const QString &fileName)
{
const QStringList allOptions = QStringList(options)
<< QLatin1String("-fsyntax-only") << fileName;
QStringList allOptionsQuoted;
foreach (const QString &option, allOptions)
allOptionsQuoted.append(QLatin1Char('\'') + option + QLatin1Char('\''));
return ::Utils::HostOsInfo::withExecutableSuffix(QLatin1String("clang"))
+ QLatin1Char(' ') + allOptionsQuoted.join(QLatin1String(" "));
}
void CreateMarkers::run()
{
QMutexLocker lock(m_marker->mutex());
......@@ -95,7 +107,8 @@ void CreateMarkers::run()
QTime t;
if (DebugTiming) {
qDebug() << "*** Highlighting from" << m_firstLine << "to" << m_lastLine << "of" << m_fileName;
qDebug() << "***** Options: " << m_options.join(QLatin1String(" "));
qDebug("***** Options (cmd line equivalent): %s",
commandLine(m_options, m_fileName).toUtf8().constData());
t.start();
}
......
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