forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/3.0'
Conflicts: qtcreator.pri src/plugins/qnx/qnxutils.cpp Change-Id: I019ad21fb4c128eb736c8ab2d09310757e3be037
This commit is contained in:
@@ -175,6 +175,11 @@ static CppModelManagerInterface *g_instance = 0;
|
||||
const QString CppModelManagerInterface::configurationFileName()
|
||||
{ return CPlusPlus::Preprocessor::configurationFileName; }
|
||||
|
||||
const QString CppModelManagerInterface::editorConfigurationFileName()
|
||||
{
|
||||
return QLatin1String("<per-editor-defines>");
|
||||
}
|
||||
|
||||
CppModelManagerInterface::CppModelManagerInterface(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
|
||||
@@ -216,6 +216,7 @@ public:
|
||||
|
||||
public:
|
||||
static const QString configurationFileName();
|
||||
static const QString editorConfigurationFileName();
|
||||
|
||||
public:
|
||||
CppModelManagerInterface(QObject *parent = 0);
|
||||
|
||||
@@ -416,7 +416,6 @@ void CppPreprocessor::sourceNeeded(unsigned line, const QString &fileName, Inclu
|
||||
if (m_dumpFileNameWhileParsing) {
|
||||
qDebug() << "Parsing file:" << absoluteFileName
|
||||
<< "contents:" << contents.size() << "bytes";
|
||||
;
|
||||
}
|
||||
|
||||
Document::Ptr doc = m_snapshot.document(absoluteFileName);
|
||||
|
||||
@@ -138,7 +138,8 @@ void SnapshotUpdater::update(CppModelManager::WorkingCopy workingCopy)
|
||||
workingCopy.insert(configurationFileName, m_configFile);
|
||||
m_snapshot.remove(m_fileInEditor);
|
||||
|
||||
static const QString editorDefinesFileName = QLatin1String("<per-editor-defines>");
|
||||
static const QString editorDefinesFileName
|
||||
= CppModelManagerInterface::editorConfigurationFileName();
|
||||
if (editorDefinesChanged) {
|
||||
m_snapshot.remove(editorDefinesFileName);
|
||||
workingCopy.insert(editorDefinesFileName, m_editorDefines);
|
||||
@@ -152,15 +153,21 @@ void SnapshotUpdater::update(CppModelManager::WorkingCopy workingCopy)
|
||||
preproc.setIncludePaths(m_includePaths);
|
||||
preproc.setFrameworkPaths(m_frameworkPaths);
|
||||
preproc.run(configurationFileName);
|
||||
if (m_usePrecompiledHeaders)
|
||||
if (m_usePrecompiledHeaders) {
|
||||
foreach (const QString &precompiledHeader, m_precompiledHeaders)
|
||||
preproc.run(precompiledHeader);
|
||||
}
|
||||
if (!m_editorDefines.isEmpty())
|
||||
preproc.run(editorDefinesFileName);
|
||||
preproc.run(m_fileInEditor);
|
||||
|
||||
m_snapshot = preproc.snapshot();
|
||||
m_snapshot = m_snapshot.simplified(document());
|
||||
Snapshot newSnapshot = m_snapshot.simplified(document());
|
||||
for (Snapshot::const_iterator i = m_snapshot.begin(), ei = m_snapshot.end(); i != ei; ++i) {
|
||||
if (Client::isInjectedFile(i.key()))
|
||||
newSnapshot.insert(i.value());
|
||||
}
|
||||
m_snapshot = newSnapshot;
|
||||
m_deps.build(m_snapshot);
|
||||
|
||||
foreach (Document::Ptr doc, m_snapshot) {
|
||||
|
||||
Reference in New Issue
Block a user