forked from qt-creator/qt-creator
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: Erik Verbruggen <erik.verbruggen@digia.com>
This commit is contained in:
@@ -32,6 +32,7 @@
|
|||||||
|
|
||||||
#include <cplusplus/CppDocument.h>
|
#include <cplusplus/CppDocument.h>
|
||||||
#include <cpptools/cppmodelmanagerinterface.h>
|
#include <cpptools/cppmodelmanagerinterface.h>
|
||||||
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/runextensions.h>
|
#include <utils/runextensions.h>
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
@@ -84,6 +85,17 @@ CreateMarkers::CreateMarkers(SemanticMarker::Ptr semanticMarker,
|
|||||||
CreateMarkers::~CreateMarkers()
|
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()
|
void CreateMarkers::run()
|
||||||
{
|
{
|
||||||
QMutexLocker lock(m_marker->mutex());
|
QMutexLocker lock(m_marker->mutex());
|
||||||
@@ -95,7 +107,8 @@ void CreateMarkers::run()
|
|||||||
QTime t;
|
QTime t;
|
||||||
if (DebugTiming) {
|
if (DebugTiming) {
|
||||||
qDebug() << "*** Highlighting from" << m_firstLine << "to" << m_lastLine << "of" << m_fileName;
|
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();
|
t.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user