From 8e43ec9ade8850dc4f941512830db6632cd776d1 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 27 Sep 2020 18:31:59 +0200 Subject: [PATCH 01/16] remove dup info from the changelog --- debian/changelog | 4 ---- 1 file changed, 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index add171c8..2d7f700c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,10 +16,6 @@ llvm-toolchain-11 (1:11.0.0~+rc3-2) unstable; urgency=medium clang (LLVM option parsing): Unknown command line argument '-polly'. Try: 'clang (LLVM option parsing) --help' Also found in autopkgtest - * Bring back LLVM_POLLY_LINK_INTO_TOOLS=ON to workaround the error - clang (LLVM option parsing): Unknown command line argument '-polly'. - Try: 'clang (LLVM option parsing) --help' - Fix autopkgtest * In the autopkgtest tests, update the opt arguments (-q removed and -basicaa renamed to -basic-aa) * Disable test executions on mipsel (timeout) From 3ea916082aa018063575e264c98b47fca61f2bcb Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 28 Sep 2020 09:58:31 +0200 Subject: [PATCH 02/16] Remove an hardcoded declaration to 10 --- debian/qualify-clang.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index 00dfa1f6..e04f7ec4 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -1123,7 +1123,7 @@ int main() { EmitBackendOutput(*diags, *hsOpts, *cgOpts, *tOpts, *lOpts, *tDesc, m, *action, std::move(AsmOutStream)); } EOF -clang++-$VERSION foo.cpp -o test -lclangBasic -lclangCodeGen -lclangDriver -lclangFrontend -lclangFrontendTool -lclangCodeGen -lclangRewriteFrontend -lclangARCMigrate -lclangStaticAnalyzerFrontend -lclangStaticAnalyzerCheckers -lclangStaticAnalyzerCore -lclangCrossTU -lclangIndex -lclangFrontend -lclangDriver -lclangParse -lclangSerialization -lclangSema -lclangAnalysis -lclangEdit -lclangFormat -lclangToolingInclusions -lclangToolingCore -lclangRewrite -lclangASTMatchers -lclangAST -lclangLex -lclangBasic -ldl /usr/lib/llvm-10/lib/libLLVM-10.so -lclangCodeGen -lclangDriver -lclangFrontend -lclangFrontendTool -lclangRewriteFrontend -lclangARCMigrate -lclangStaticAnalyzerFrontend -lclangStaticAnalyzerCheckers -lclangStaticAnalyzerCore -lclangCrossTU -lclangIndex -lclangParse -lclangSerialization -lclangSema -lclangAnalysis -lclangEdit -lclangFormat -lclangToolingInclusions -lclangToolingCore -lclangRewrite -lclangASTMatchers -lclangAST -lclangLex -ldl -I /usr/lib/llvm-$VERSION/include/ -L/usr/lib/llvm-$VERSION/lib/ `llvm-config-$VERSION --cxxflags --ldflags --libs all` +clang++-$VERSION foo.cpp -o test -lclangBasic -lclangCodeGen -lclangDriver -lclangFrontend -lclangFrontendTool -lclangCodeGen -lclangRewriteFrontend -lclangARCMigrate -lclangStaticAnalyzerFrontend -lclangStaticAnalyzerCheckers -lclangStaticAnalyzerCore -lclangCrossTU -lclangIndex -lclangFrontend -lclangDriver -lclangParse -lclangSerialization -lclangSema -lclangAnalysis -lclangEdit -lclangFormat -lclangToolingInclusions -lclangToolingCore -lclangRewrite -lclangASTMatchers -lclangAST -lclangLex -lclangBasic -ldl /usr/lib/llvm-$VERSION/lib/libLLVM-$VERSION.so -lclangCodeGen -lclangDriver -lclangFrontend -lclangFrontendTool -lclangRewriteFrontend -lclangARCMigrate -lclangStaticAnalyzerFrontend -lclangStaticAnalyzerCheckers -lclangStaticAnalyzerCore -lclangCrossTU -lclangIndex -lclangParse -lclangSerialization -lclangSema -lclangAnalysis -lclangEdit -lclangFormat -lclangToolingInclusions -lclangToolingCore -lclangRewrite -lclangASTMatchers -lclangAST -lclangLex -ldl -I /usr/lib/llvm-$VERSION/include/ -L/usr/lib/llvm-$VERSION/lib/ `llvm-config-$VERSION --cxxflags --ldflags --libs all` if test ! -f /usr/bin/lldb-$VERSION; then echo "Install lldb-$VERSION"; From ead2340541eac70d85e853db78d8610ad12b6fce Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 28 Sep 2020 10:29:13 +0200 Subject: [PATCH 03/16] update of the changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 2d7f700c..530425a0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +llvm-toolchain-11 (1:11.0.0~+rc3-3) unstable; urgency=medium + + * Fix one more test in autopkgtest + + -- Sylvestre Ledru Mon, 28 Sep 2020 10:29:02 +0200 + llvm-toolchain-11 (1:11.0.0~+rc3-2) unstable; urgency=medium * Update of the symbol list of libomp5: From 75a1d12a46ddf672f4bece924f5bc4769145fb94 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 28 Sep 2020 22:22:08 +0200 Subject: [PATCH 04/16] New rc release --- debian/changelog | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 530425a0..e23b9934 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,9 @@ -llvm-toolchain-11 (1:11.0.0~+rc3-3) unstable; urgency=medium +llvm-toolchain-11 (1:11.0.0~+rc4-1) unstable; urgency=medium + * New rc release * Fix one more test in autopkgtest - -- Sylvestre Ledru Mon, 28 Sep 2020 10:29:02 +0200 + -- Sylvestre Ledru Mon, 28 Sep 2020 22:21:47 +0200 llvm-toolchain-11 (1:11.0.0~+rc3-2) unstable; urgency=medium From c070c96ef5914a04199b07f90d4b6f4bc88b7f21 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 30 Sep 2020 20:21:23 +0200 Subject: [PATCH 05/16] New rc release --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index e23b9934..c0c74c68 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +llvm-toolchain-11 (1:11.0.0~+rc5-1) unstable; urgency=medium + + * New rc release + + -- Sylvestre Ledru Wed, 30 Sep 2020 20:15:40 +0200 + llvm-toolchain-11 (1:11.0.0~+rc4-1) unstable; urgency=medium * New rc release From 3041189ac08cb7c8aee7f1e2c7590fbfd95f00e5 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 30 Sep 2020 20:22:00 +0200 Subject: [PATCH 06/16] remove all artifacts after tests --- debian/qualify-clang.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index e04f7ec4..85b462fc 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -1341,6 +1341,6 @@ fi #clean up rm -f a.out bar crash-* foo foo.* lldb-cmd.txt main.* test_fuzzer.cc foo.* o -rm -rf output matmul.* *profraw opt.ll +rm -rf output matmul.* *profraw opt.ll a.json default.profdata test echo "Completed" From d34f8688a3f017d658c32eabeb6460d2d6f43c65 Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Thu, 1 Oct 2020 15:11:40 +0200 Subject: [PATCH 07/16] qualify-clang.sh: exclude z3 tests when support is not available, not based on libz3-dev installation but on the error returned by clang invocation --- debian/qualify-clang.sh | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index 85b462fc..1c6f2308 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -385,9 +385,16 @@ void testBitwiseRules(unsigned int a, int b) { clang_analyzer_eval((b | -2) >= 0); // expected-warning{{FALSE}} } ' > foo.c -if dpkg -l|grep -q libz3-dev; then - # Should work + +clang-$VERSION -cc1 -analyze -analyzer-constraints=range -analyzer-checker=core,debug.ExprInspection -analyzer-constraints=z3 foo.c &> foo.log +if ! grep -q "fatal error: error in backend: LLVM was not compiled with Z3 support, rebuild with -DLLVM_ENABLE_Z3_SOLVER=ON" foo.log; then + # Should work clang-$VERSION -cc1 -analyze -analyzer-constraints=range -analyzer-checker=core,debug.ExprInspection -verify -analyzer-config eagerly-assume=false -analyzer-constraints=z3 foo.c + clang-$VERSION -cc1 -analyze -analyzer-constraints=range -analyzer-checker=core,debug.ExprInspection -analyzer-constraints=z3 foo.c &> foo.log + if ! grep -q "2 warnings generated." foo.log; then + echo "Should find 2 warnings" + exit 1 + fi else echo "z3 support not available" fi @@ -399,16 +406,6 @@ if grep -q "File a.c Line 7: UNKNOWN" foo.log; then exit 1 fi -if dpkg -l|grep -q libz3-dev; then - clang-$VERSION -cc1 -analyze -analyzer-constraints=range -analyzer-checker=core,debug.ExprInspection -analyzer-constraints=z3 foo.c &> foo.log - if ! grep -q "2 warnings generated." foo.log; then - echo "Should find 2 warnings" - exit 1 - fi -else - echo "z3 support not available" -fi - clang-$VERSION -cc1 -analyze -analyzer-constraints=range -analyzer-checker=core,debug.ExprInspection foo.c &> foo.log if ! grep -q "warnings generated." foo.log; then echo "Should find at least 2 warnings" From 30965153cd5572c51ad0594a13e66eb93854b7e3 Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Thu, 1 Oct 2020 15:12:44 +0200 Subject: [PATCH 08/16] Update changelog --- debian/changelog | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/debian/changelog b/debian/changelog index c0c74c68..983fc9ec 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +llvm-toolchain-11 (1:11.0.0~+rc5-2) UNRELEASED; urgency=medium + + [ Sylvestre Ledru ] + * remove all artifacts after tests + + [ Gianfranco Costamagna ] + * qualify-clang.sh: exclude z3 tests when support is not available, not based on libz3-dev installation but on the error returned by clang invocation + + -- Gianfranco Costamagna Thu, 01 Oct 2020 15:12:29 +0200 + llvm-toolchain-11 (1:11.0.0~+rc5-1) unstable; urgency=medium * New rc release From 92c48ba3c1eb84b0fa669bccd4dc9b70f6a758d6 Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Thu, 1 Oct 2020 15:19:43 +0200 Subject: [PATCH 09/16] Reduce the string comparison for z3 support --- debian/qualify-clang.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index 1c6f2308..40e052d8 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -387,7 +387,7 @@ void testBitwiseRules(unsigned int a, int b) { ' > foo.c clang-$VERSION -cc1 -analyze -analyzer-constraints=range -analyzer-checker=core,debug.ExprInspection -analyzer-constraints=z3 foo.c &> foo.log -if ! grep -q "fatal error: error in backend: LLVM was not compiled with Z3 support, rebuild with -DLLVM_ENABLE_Z3_SOLVER=ON" foo.log; then +if ! grep -q "LLVM was not compiled with Z3 support" foo.log; then # Should work clang-$VERSION -cc1 -analyze -analyzer-constraints=range -analyzer-checker=core,debug.ExprInspection -verify -analyzer-config eagerly-assume=false -analyzer-constraints=z3 foo.c clang-$VERSION -cc1 -analyze -analyzer-constraints=range -analyzer-checker=core,debug.ExprInspection -analyzer-constraints=z3 foo.c &> foo.log From 42e6ff160db2e50c2e42f49daf944909974e7659 Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Wed, 7 Oct 2020 12:33:24 +0200 Subject: [PATCH 10/16] Don't fail on armhf and arm64 tests that are intended to run on intel --- debian/qualify-clang.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index 40e052d8..0913c844 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -345,7 +345,7 @@ if test $NBLINES -lt 100; then exit 42 fi -if [ $DEB_HOST_ARCH != "arm64" -a $DEB_HOST_ARCH != "ppc64el" ]; then +if [ $DEB_HOST_ARCH != "arm64" -a $DEB_HOST_ARCH != "armhf" -a $DEB_HOST_ARCH != "ppc64el" ]; then # Fails on arm64 with # /usr/lib/llvm-10/lib/clang/10.0.0/include/mmintrin.h:33:5: error: use of undeclared identifier '__builtin_ia32_emms'; did you mean '__builtin_isless'? echo '#include ' > foo.cc @@ -811,7 +811,7 @@ if ! grep "No such file or directory" foo.log; then if ! ./a.out 2>&1 | grep -q -E "(Test unit written|PreferSmall)"; then echo "fuzzer. Output:" ./a.out || true - if [ $DEB_HOST_ARCH != "arm64" -a $DEB_HOST_ARCH != "ppc64el" ]; then + if [ $DEB_HOST_ARCH != "arm64" -a $DEB_HOST_ARCH != "armhf" -a $DEB_HOST_ARCH != "ppc64el" ]; then # Don't fail on arm64 and ppc64el exit 42 fi From 86b65186eac47588aeea67798eab2d9138d5d21e Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Wed, 7 Oct 2020 14:08:00 +0200 Subject: [PATCH 11/16] Change the previous commit to include only amd64 and i386 --- debian/qualify-clang.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index 0913c844..2be8a8c5 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -345,7 +345,7 @@ if test $NBLINES -lt 100; then exit 42 fi -if [ $DEB_HOST_ARCH != "arm64" -a $DEB_HOST_ARCH != "armhf" -a $DEB_HOST_ARCH != "ppc64el" ]; then +if [ $DEB_HOST_ARCH == "amd64" -o $DEB_HOST_ARCH == "i386" ]; then # Fails on arm64 with # /usr/lib/llvm-10/lib/clang/10.0.0/include/mmintrin.h:33:5: error: use of undeclared identifier '__builtin_ia32_emms'; did you mean '__builtin_isless'? echo '#include ' > foo.cc @@ -811,7 +811,7 @@ if ! grep "No such file or directory" foo.log; then if ! ./a.out 2>&1 | grep -q -E "(Test unit written|PreferSmall)"; then echo "fuzzer. Output:" ./a.out || true - if [ $DEB_HOST_ARCH != "arm64" -a $DEB_HOST_ARCH != "armhf" -a $DEB_HOST_ARCH != "ppc64el" ]; then + if [ $DEB_HOST_ARCH == "amd64" -o $DEB_HOST_ARCH == "i386" ]; then # Don't fail on arm64 and ppc64el exit 42 fi From 461582613104b9a51a7f092c5e6e402859793e59 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 7 Oct 2020 16:39:38 +0200 Subject: [PATCH 12/16] rc6 upload --- debian/changelog | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 983fc9ec..acb62c41 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,12 +1,15 @@ -llvm-toolchain-11 (1:11.0.0~+rc5-2) UNRELEASED; urgency=medium +llvm-toolchain-11 (1:11.0.0~+rc6-1) unstable; urgency=medium [ Sylvestre Ledru ] + * New rc release * remove all artifacts after tests [ Gianfranco Costamagna ] - * qualify-clang.sh: exclude z3 tests when support is not available, not based on libz3-dev installation but on the error returned by clang invocation + * qualify-clang.sh: exclude z3 tests when support is not available, + not based on libz3-dev installation but on the error returned by + clang invocation - -- Gianfranco Costamagna Thu, 01 Oct 2020 15:12:29 +0200 + -- Sylvestre Ledru Wed, 07 Oct 2020 16:38:40 +0200 llvm-toolchain-11 (1:11.0.0~+rc5-1) unstable; urgency=medium From 1bda59d2ac03be1e9f497ca51ebda50cf659fe7c Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 12 Oct 2020 11:22:28 +0200 Subject: [PATCH 13/16] New upstream release --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index acb62c41..4f580c15 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +llvm-toolchain-11 (1:11.0.0-1) unstable; urgency=medium + + * New upstream release + + -- Sylvestre Ledru Mon, 12 Oct 2020 11:14:19 +0200 + llvm-toolchain-11 (1:11.0.0~+rc6-1) unstable; urgency=medium [ Sylvestre Ledru ] From d98146afc4b798d00febcac09f841e6179c50100 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 12 Oct 2020 15:15:40 +0200 Subject: [PATCH 14/16] Fix a clang-format issue. Fix bug #47589 --- debian/changelog | 6 ++++++ debian/patches/fix-clang-format-bug-47589.diff | 13 +++++++++++++ debian/patches/series | 1 + 3 files changed, 20 insertions(+) create mode 100644 debian/patches/fix-clang-format-bug-47589.diff diff --git a/debian/changelog b/debian/changelog index 4f580c15..69cc806c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +llvm-toolchain-11 (1:11.0.0-2) unstable; urgency=medium + + * Fix a clang-format issue. Fix bug #47589 + + -- Sylvestre Ledru Mon, 12 Oct 2020 15:15:27 +0200 + llvm-toolchain-11 (1:11.0.0-1) unstable; urgency=medium * New upstream release diff --git a/debian/patches/fix-clang-format-bug-47589.diff b/debian/patches/fix-clang-format-bug-47589.diff new file mode 100644 index 00000000..a0ad620f --- /dev/null +++ b/debian/patches/fix-clang-format-bug-47589.diff @@ -0,0 +1,13 @@ +Index: llvm-toolchain-11-11.0.0/clang/lib/Format/UnwrappedLineParser.cpp +=================================================================== +--- llvm-toolchain-11-11.0.0.orig/clang/lib/Format/UnwrappedLineParser.cpp ++++ llvm-toolchain-11-11.0.0/clang/lib/Format/UnwrappedLineParser.cpp +@@ -3062,7 +3062,7 @@ void UnwrappedLineParser::pushToken(Form + Line->Tokens.push_back(UnwrappedLineNode(Tok)); + if (MustBreakBeforeNextToken) { + Line->Tokens.back().Tok->MustBreakBefore = true; +- Line->Tokens.back().Tok->MustBreakAlignBefore = true; ++// Line->Tokens.back().Tok->MustBreakAlignBefore = true; + MustBreakBeforeNextToken = false; + } + } diff --git a/debian/patches/series b/debian/patches/series index 2b9bdb58..92cf2f16 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -137,3 +137,4 @@ disable-fuzzer-compiler-rt-x86.diff python3-shebang.patch print-lldb-path.patch libcxx-armhf-ftbfs.diff +fix-clang-format-bug-47589.diff From 292c1c818bc64616f83bfe2d584b98ba81e2f863 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 12 Oct 2020 15:15:40 +0200 Subject: [PATCH 15/16] Fix a clang-format issue. Fix bug #47589 --- .../patches/fix-clang-format-bug-47589.patch | 148 ++++++++++++++++++ debian/patches/series | 2 +- 2 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 debian/patches/fix-clang-format-bug-47589.patch diff --git a/debian/patches/fix-clang-format-bug-47589.patch b/debian/patches/fix-clang-format-bug-47589.patch new file mode 100644 index 00000000..010c3339 --- /dev/null +++ b/debian/patches/fix-clang-format-bug-47589.patch @@ -0,0 +1,148 @@ +From 05860350084abdae30dfbd2181452d1b87dca3b4 Mon Sep 17 00:00:00 2001 +From: Sylvestre Ledru +Date: Mon, 12 Oct 2020 18:47:30 +0200 +Subject: [PATCH] Revert "[clang-format] Fix AlignConsecutive on PP blocks" + +This reverts commit b2eb439317576ce718193763c12bff9fccdfc166. +--- + clang/lib/Format/FormatToken.h | 6 ----- + clang/lib/Format/UnwrappedLineParser.cpp | 2 -- + clang/lib/Format/WhitespaceManager.cpp | 10 +++----- + clang/unittests/Format/FormatTest.cpp | 23 ------------------- + clang/unittests/Format/FormatTestComments.cpp | 21 ----------------- + 5 files changed, 3 insertions(+), 59 deletions(-) + +diff --git a/clang/lib/Format/FormatToken.h b/clang/lib/Format/FormatToken.h +index d4287f53fde..b132a3e84da 100644 +--- a/clang/lib/Format/FormatToken.h ++++ b/clang/lib/Format/FormatToken.h +@@ -183,12 +183,6 @@ struct FormatToken { + /// before the token. + bool MustBreakBefore = false; + +- /// Whether to not align across this token +- /// +- /// This happens for example when a preprocessor directive ended directly +- /// before the token, but very rarely otherwise. +- bool MustBreakAlignBefore = false; +- + /// The raw text of the token. + /// + /// Contains the raw token text without leading whitespace and without leading +diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp +index a37386425aa..ea8a41cfba8 100644 +--- a/clang/lib/Format/UnwrappedLineParser.cpp ++++ b/clang/lib/Format/UnwrappedLineParser.cpp +@@ -3037,7 +3037,6 @@ void UnwrappedLineParser::readToken(int LevelDifference) { + } + FormatTok = Tokens->getNextToken(); + FormatTok->MustBreakBefore = true; +- FormatTok->MustBreakAlignBefore = true; + } + + if (!PPStack.empty() && (PPStack.back().Kind == PP_Unreachable) && +@@ -3062,7 +3061,6 @@ void UnwrappedLineParser::pushToken(FormatToken *Tok) { + Line->Tokens.push_back(UnwrappedLineNode(Tok)); + if (MustBreakBeforeNextToken) { + Line->Tokens.back().Tok->MustBreakBefore = true; +- Line->Tokens.back().Tok->MustBreakAlignBefore = true; + MustBreakBeforeNextToken = false; + } + } +diff --git a/clang/lib/Format/WhitespaceManager.cpp b/clang/lib/Format/WhitespaceManager.cpp +index 32e0b685ea0..3a265bd0916 100644 +--- a/clang/lib/Format/WhitespaceManager.cpp ++++ b/clang/lib/Format/WhitespaceManager.cpp +@@ -411,11 +411,9 @@ static unsigned AlignTokens(const FormatStyle &Style, F &&Matches, + if (Changes[i].NewlinesBefore != 0) { + CommasBeforeMatch = 0; + EndOfSequence = i; +- // If there is a blank line, there is a forced-align-break (eg, +- // preprocessor), or if the last line didn't contain any matching token, +- // the sequence ends here. +- if (Changes[i].NewlinesBefore > 1 || +- Changes[i].Tok->MustBreakAlignBefore || !FoundMatchOnLine) ++ // If there is a blank line, or if the last line didn't contain any ++ // matching token, the sequence ends here. ++ if (Changes[i].NewlinesBefore > 1 || !FoundMatchOnLine) + AlignCurrentSequence(); + + FoundMatchOnLine = false; +@@ -726,8 +724,6 @@ void WhitespaceManager::alignTrailingComments() { + if (Changes[i].StartOfBlockComment) + continue; + Newlines += Changes[i].NewlinesBefore; +- if (Changes[i].Tok->MustBreakAlignBefore) +- BreakBeforeNext = true; + if (!Changes[i].IsTrailingComment) + continue; + +diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp +index 17d302f0b65..7e4d1fca509 100644 +--- a/clang/unittests/Format/FormatTest.cpp ++++ b/clang/unittests/Format/FormatTest.cpp +@@ -11968,29 +11968,6 @@ TEST_F(FormatTest, AlignConsecutiveAssignments) { + verifyFormat("int oneTwoThree = 123; // comment\n" + "int oneTwo = 12; // comment", + Alignment); +- +- // Bug 25167 +- verifyFormat("#if A\n" +- "#else\n" +- "int aaaaaaaa = 12;\n" +- "#endif\n" +- "#if B\n" +- "#else\n" +- "int a = 12;\n" +- "#endif\n", +- Alignment); +- verifyFormat("enum foo {\n" +- "#if A\n" +- "#else\n" +- " aaaaaaaa = 12;\n" +- "#endif\n" +- "#if B\n" +- "#else\n" +- " a = 12;\n" +- "#endif\n" +- "};\n", +- Alignment); +- + EXPECT_EQ("int a = 5;\n" + "\n" + "int oneTwoThree = 123;", +diff --git a/clang/unittests/Format/FormatTestComments.cpp b/clang/unittests/Format/FormatTestComments.cpp +index 47509f29744..d5b9f8e0885 100644 +--- a/clang/unittests/Format/FormatTestComments.cpp ++++ b/clang/unittests/Format/FormatTestComments.cpp +@@ -2780,27 +2780,6 @@ TEST_F(FormatTestComments, AlignTrailingComments) { + " // line 2 about b\n" + " long b;", + getLLVMStyleWithColumns(80))); +- +- // Checks an edge case in preprocessor handling. +- // These comments should *not* be aligned +- EXPECT_EQ( +- "#if FOO\n" +- "#else\n" +- "long a; // Line about a\n" +- "#endif\n" +- "#if BAR\n" +- "#else\n" +- "long b_long_name; // Line about b\n" +- "#endif\n", +- format("#if FOO\n" +- "#else\n" +- "long a; // Line about a\n" // Previous (bad) behavior +- "#endif\n" +- "#if BAR\n" +- "#else\n" +- "long b_long_name; // Line about b\n" +- "#endif\n", +- getLLVMStyleWithColumns(80))); + } + + TEST_F(FormatTestComments, AlignsBlockCommentDecorations) { +-- +2.28.0 + diff --git a/debian/patches/series b/debian/patches/series index 92cf2f16..cc2a92d2 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -137,4 +137,4 @@ disable-fuzzer-compiler-rt-x86.diff python3-shebang.patch print-lldb-path.patch libcxx-armhf-ftbfs.diff -fix-clang-format-bug-47589.diff +fix-clang-format-bug-47589.patch From f93c8a5d15cf39e4ebc2e380c5d5e377dc0eb2e1 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 13 Oct 2020 09:21:57 +0200 Subject: [PATCH 16/16] remove artifact --- debian/patches/fix-clang-format-bug-47589.diff | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 debian/patches/fix-clang-format-bug-47589.diff diff --git a/debian/patches/fix-clang-format-bug-47589.diff b/debian/patches/fix-clang-format-bug-47589.diff deleted file mode 100644 index a0ad620f..00000000 --- a/debian/patches/fix-clang-format-bug-47589.diff +++ /dev/null @@ -1,13 +0,0 @@ -Index: llvm-toolchain-11-11.0.0/clang/lib/Format/UnwrappedLineParser.cpp -=================================================================== ---- llvm-toolchain-11-11.0.0.orig/clang/lib/Format/UnwrappedLineParser.cpp -+++ llvm-toolchain-11-11.0.0/clang/lib/Format/UnwrappedLineParser.cpp -@@ -3062,7 +3062,7 @@ void UnwrappedLineParser::pushToken(Form - Line->Tokens.push_back(UnwrappedLineNode(Tok)); - if (MustBreakBeforeNextToken) { - Line->Tokens.back().Tok->MustBreakBefore = true; -- Line->Tokens.back().Tok->MustBreakAlignBefore = true; -+// Line->Tokens.back().Tok->MustBreakAlignBefore = true; - MustBreakBeforeNextToken = false; - } - }