diff options
author | Eike Ziller <eike.ziller@qt.io> | 2018-04-13 10:54:42 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2018-04-13 10:54:42 +0200 |
commit | 428fcb476ba2c5bbe1d16dfe437e510dafce1777 (patch) | |
tree | 10b130ef79d87dd1339004857c8f1e31e29c3f95 /src/tools | |
parent | 9e29a32e1ab3af42a4d70984449ba33b3092a50b (diff) | |
parent | f4594c922fe3ffcfaf715cf09622ba48c3d1d620 (diff) |
Merge remote-tracking branch 'origin/4.6'
Conflicts:
src/libs/utils/settingsaccessor.cpp
src/plugins/autotest/autotestplugin.cpp
src/plugins/git/gitclient.cpp
src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
src/plugins/qbsprojectmanager/qbsrunconfiguration.h
Change-Id: I65f143cad18af509a2621d6c5925abbd038ea70f
Diffstat (limited to 'src/tools')
4 files changed, 20 insertions, 7 deletions
diff --git a/src/tools/clangbackend/clangbackend.pro b/src/tools/clangbackend/clangbackend.pro index 3b7c5de518..c1c72036ea 100644 --- a/src/tools/clangbackend/clangbackend.pro +++ b/src/tools/clangbackend/clangbackend.pro @@ -19,7 +19,7 @@ SOURCES += clangbackendmain.cpp HEADERS += ../qtcreatorcrashhandler/crashhandlersetup.h SOURCES += ../qtcreatorcrashhandler/crashhandlersetup.cpp -unix { +unix:!disable_external_rpath:!contains(QMAKE_DEFAULT_LIBDIRS, $${LLVM_LIBDIR}) { !osx: QMAKE_LFLAGS += -Wl,-z,origin - !contains(QMAKE_DEFAULT_LIBDIRS, $${LLVM_LIBDIR}):!disable_external_rpath: QMAKE_LFLAGS += -Wl,-rpath,$$shell_quote($${LLVM_LIBDIR}) + QMAKE_LFLAGS += -Wl,-rpath,$$shell_quote($${LLVM_LIBDIR}) } diff --git a/src/tools/clangbackend/source/clangtranslationunit.cpp b/src/tools/clangbackend/source/clangtranslationunit.cpp index baabcaf50b..f0bbc78934 100644 --- a/src/tools/clangbackend/source/clangtranslationunit.cpp +++ b/src/tools/clangbackend/source/clangtranslationunit.cpp @@ -237,6 +237,17 @@ static bool isHeaderErrorDiagnostic(const Utf8String &mainFilePath, const Diagno return isCritical && diagnostic.location().filePath() != mainFilePath; } +static bool isIgnoredHeaderErrorDiagnostic(const Diagnostic &diagnostic) +{ + // FIXME: This diagnostic can appear if e.g. a main file includes a -isystem header and then the + // header is opened in the editor - the provided unsaved file for the newly opened editor + // overrides the file from the preamble. In this case, clang uses the version from the preamble + // and changes in the header are not reflected in the main file. Typically that's not a problem + // because only non-project headers are opened as -isystem headers. + return diagnostic.text().endsWith( + Utf8StringLiteral("from the precompiled header has been overridden")); +} + void TranslationUnit::extractDiagnostics(DiagnosticContainer &firstHeaderErrorDiagnostic, QVector<DiagnosticContainer> &mainFileDiagnostics) const { @@ -246,7 +257,9 @@ void TranslationUnit::extractDiagnostics(DiagnosticContainer &firstHeaderErrorDi bool hasFirstHeaderErrorDiagnostic = false; for (const Diagnostic &diagnostic : diagnostics()) { - if (!hasFirstHeaderErrorDiagnostic && isHeaderErrorDiagnostic(m_filePath, diagnostic)) { + if (!hasFirstHeaderErrorDiagnostic + && isHeaderErrorDiagnostic(m_filePath, diagnostic) + && !isIgnoredHeaderErrorDiagnostic(diagnostic)) { hasFirstHeaderErrorDiagnostic = true; firstHeaderErrorDiagnostic = diagnostic.toDiagnosticContainer(); } diff --git a/src/tools/clangpchmanagerbackend/clangpchmanagerbackend.pro b/src/tools/clangpchmanagerbackend/clangpchmanagerbackend.pro index b54db0be04..efdd94377b 100644 --- a/src/tools/clangpchmanagerbackend/clangpchmanagerbackend.pro +++ b/src/tools/clangpchmanagerbackend/clangpchmanagerbackend.pro @@ -28,9 +28,9 @@ SOURCES += \ ../clangrefactoringbackend/source/refactoringcompilationdatabase.cpp -unix { +unix:!disable_external_rpath:!contains(QMAKE_DEFAULT_LIBDIRS, $${LLVM_LIBDIR}) { !macx: QMAKE_LFLAGS += -Wl,-z,origin - !disable_external_rpath: QMAKE_LFLAGS += -Wl,-rpath,$$shell_quote($${LLVM_LIBDIR}) + QMAKE_LFLAGS += -Wl,-rpath,$$shell_quote($${LLVM_LIBDIR}) } DEFINES += CLANG_COMPILER_PATH=\"R\\\"xxx($${LLVM_BINDIR}/clang)xxx\\\"\" diff --git a/src/tools/clangrefactoringbackend/clangrefactoringbackend.pro b/src/tools/clangrefactoringbackend/clangrefactoringbackend.pro index 3b94d003c0..6e7c8262a9 100644 --- a/src/tools/clangrefactoringbackend/clangrefactoringbackend.pro +++ b/src/tools/clangrefactoringbackend/clangrefactoringbackend.pro @@ -23,7 +23,7 @@ QMAKE_CXXFLAGS += $$LLVM_CXXFLAGS SOURCES += \ clangrefactoringbackendmain.cpp -unix { +unix:!disable_external_rpath:!contains(QMAKE_DEFAULT_LIBDIRS, $$LLVM_LIBDIR) { !osx: QMAKE_LFLAGS += -Wl,-z,origin - !disable_external_rpath: QMAKE_LFLAGS += -Wl,-rpath,$$shell_quote($${LLVM_LIBDIR}) + QMAKE_LFLAGS += -Wl,-rpath,$$shell_quote($${LLVM_LIBDIR}) } |