forked from qt-creator/qt-creator
Clang: Remove project tracking on clangbackend side
...as it is not needed. Just provide the compilation arguments as part of the Document. As a side effect, re-initializing the backend after a crash is cheaper and will not freeze the UI anymore (referenced bug). Task-number: QTCREATORBUG-21097 Change-Id: I866e25ef1fd5e4d318df16612a7564469e6baa11 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -63,26 +63,6 @@ using namespace CppTools;
|
||||
namespace ClangCodeModel {
|
||||
namespace Utils {
|
||||
|
||||
/**
|
||||
* @brief Creates list of message-line arguments required for correct parsing
|
||||
* @param pPart Null if file isn't part of any project
|
||||
* @param fileName Path to file, non-empty
|
||||
*/
|
||||
QStringList createClangOptions(const ProjectPart::Ptr &pPart, const QString &fileName)
|
||||
{
|
||||
ProjectFile::Kind fileKind = ProjectFile::Unclassified;
|
||||
if (!pPart.isNull())
|
||||
foreach (const ProjectFile &file, pPart->files)
|
||||
if (file.path == fileName) {
|
||||
fileKind = file.kind;
|
||||
break;
|
||||
}
|
||||
if (fileKind == ProjectFile::Unclassified)
|
||||
fileKind = ProjectFile::classify(fileName);
|
||||
|
||||
return createClangOptions(pPart, fileKind);
|
||||
}
|
||||
|
||||
class LibClangOptionsBuilder final : public CompilerOptionsBuilder
|
||||
{
|
||||
public:
|
||||
@@ -122,16 +102,10 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Creates list of message-line arguments required for correct parsing
|
||||
* @param pPart Null if file isn't part of any project
|
||||
* @param fileKind Determines language and source/header state
|
||||
*/
|
||||
QStringList createClangOptions(const ProjectPart::Ptr &pPart, ProjectFile::Kind fileKind)
|
||||
QStringList createClangOptions(const ProjectPart &projectPart, ProjectFile::Kind fileKind)
|
||||
{
|
||||
if (!pPart)
|
||||
return QStringList();
|
||||
return LibClangOptionsBuilder(*pPart).build(fileKind, CompilerOptionsBuilder::PchUsage::None);
|
||||
return LibClangOptionsBuilder(projectPart)
|
||||
.build(fileKind, CompilerOptionsBuilder::PchUsage::None);
|
||||
}
|
||||
|
||||
ProjectPart::Ptr projectPartForFile(const QString &filePath)
|
||||
|
||||
Reference in New Issue
Block a user