forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.8'
Change-Id: I5b18233936e3b2cd674df92a694ba73b5a3ed752
This commit is contained in:
@@ -50,8 +50,10 @@ static QByteArray overwrittenToolchainDefines(const ProjectPart &projectPart)
|
||||
return defines;
|
||||
}
|
||||
|
||||
BuiltinEditorDocumentParser::BuiltinEditorDocumentParser(const QString &filePath)
|
||||
BuiltinEditorDocumentParser::BuiltinEditorDocumentParser(const QString &filePath,
|
||||
int fileSizeLimitInMb)
|
||||
: BaseEditorDocumentParser(filePath)
|
||||
, m_fileSizeLimitInMb(fileSizeLimitInMb)
|
||||
{
|
||||
qRegisterMetaType<CPlusPlus::Snapshot>("CPlusPlus::Snapshot");
|
||||
}
|
||||
@@ -191,6 +193,7 @@ void BuiltinEditorDocumentParser::updateImpl(const QFutureInterface<void> &futur
|
||||
if (releaseSourceAndAST_)
|
||||
doc->releaseSourceAndAST();
|
||||
});
|
||||
sourceProcessor.setFileSizeLimitInMb(m_fileSizeLimitInMb);
|
||||
sourceProcessor.setCancelChecker([future]() {
|
||||
return future.isCanceled();
|
||||
});
|
||||
|
||||
@@ -39,7 +39,7 @@ class CPPTOOLS_EXPORT BuiltinEditorDocumentParser : public BaseEditorDocumentPar
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BuiltinEditorDocumentParser(const QString &filePath);
|
||||
BuiltinEditorDocumentParser(const QString &filePath, int fileSizeLimitInMb = -1);
|
||||
|
||||
bool releaseSourceAndAST() const;
|
||||
void setReleaseSourceAndAST(bool release);
|
||||
@@ -79,6 +79,8 @@ private:
|
||||
|
||||
bool m_releaseSourceAndAST = true;
|
||||
ExtraState m_extraState;
|
||||
|
||||
const int m_fileSizeLimitInMb = -1;
|
||||
};
|
||||
|
||||
} // namespace CppTools
|
||||
|
||||
@@ -163,7 +163,8 @@ BuiltinEditorDocumentProcessor::BuiltinEditorDocumentProcessor(
|
||||
TextEditor::TextDocument *document,
|
||||
bool enableSemanticHighlighter)
|
||||
: BaseEditorDocumentProcessor(document->document(), document->filePath().toString())
|
||||
, m_parser(new BuiltinEditorDocumentParser(document->filePath().toString()))
|
||||
, m_parser(new BuiltinEditorDocumentParser(document->filePath().toString(),
|
||||
indexerFileSizeLimitInMb()))
|
||||
, m_codeWarningsUpdated(false)
|
||||
, m_semanticHighlighter(enableSemanticHighlighter
|
||||
? new CppTools::SemanticHighlighter(document)
|
||||
|
||||
@@ -84,6 +84,7 @@ QStringList CompilerOptionsBuilder::build(CppTools::ProjectFile::Kind fileKind,
|
||||
undefineClangVersionMacrosForMsvc();
|
||||
undefineCppLanguageFeatureMacrosForMsvc2015();
|
||||
addDefineFunctionMacrosMsvc();
|
||||
addBoostWorkaroundMacros();
|
||||
|
||||
addToolchainFlags();
|
||||
addPrecompiledHeaderOptions(pchUsage);
|
||||
@@ -560,6 +561,14 @@ void CompilerOptionsBuilder::addDefineFunctionMacrosMsvc()
|
||||
addMacros({{"__FUNCSIG__", "\"\""}, {"__FUNCTION__", "\"\""}, {"__FUNCDNAME__", "\"\""}});
|
||||
}
|
||||
|
||||
void CompilerOptionsBuilder::addBoostWorkaroundMacros()
|
||||
{
|
||||
if (m_projectPart.toolchainType != ProjectExplorer::Constants::MSVC_TOOLCHAIN_TYPEID
|
||||
&& m_projectPart.toolchainType != ProjectExplorer::Constants::CLANG_CL_TOOLCHAIN_TYPEID) {
|
||||
addMacros({{"BOOST_TYPE_INDEX_CTTI_USER_DEFINED_PARSING", "(39, 1, true, \"T = \")"}});
|
||||
}
|
||||
}
|
||||
|
||||
QString CompilerOptionsBuilder::includeDirOptionForPath(const QString &path) const
|
||||
{
|
||||
if (m_useSystemHeader == UseSystemHeader::No
|
||||
|
||||
@@ -87,6 +87,7 @@ public:
|
||||
void addMsvcCompatibilityVersion();
|
||||
void undefineCppLanguageFeatureMacrosForMsvc2015();
|
||||
void addDefineFunctionMacrosMsvc();
|
||||
void addBoostWorkaroundMacros();
|
||||
|
||||
void addProjectConfigFileInclude();
|
||||
void undefineClangVersionMacrosForMsvc();
|
||||
|
||||
Reference in New Issue
Block a user