Merge remote-tracking branch 'origin/11' into snapshot

This commit is contained in:
Sylvestre Ledru 2020-10-17 10:06:55 +02:00
commit a5ad51174a
5 changed files with 192 additions and 12 deletions

37
debian/changelog vendored
View File

@ -47,15 +47,30 @@ llvm-toolchain-snapshot (1:12~++20200715052739+d6e79e3dd6d-1~exp1) experimental;
-- Sylvestre Ledru <sylvestre@debian.org> Wed, 08 Jul 2020 15:19:14 +0200
llvm-toolchain-11 (1:11.0.0~+rc5-2) UNRELEASED; urgency=medium
llvm-toolchain-11 (1:11.0.0-2) unstable; urgency=medium
* Fix a clang-format issue. Fix bug #47589
-- Sylvestre Ledru <sylvestre@debian.org> Mon, 12 Oct 2020 15:15:27 +0200
llvm-toolchain-11 (1:11.0.0-1) unstable; urgency=medium
* New upstream release
-- Sylvestre Ledru <sylvestre@debian.org> Mon, 12 Oct 2020 11:14:19 +0200
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 <locutusofborg@debian.org> Thu, 01 Oct 2020 15:12:29 +0200
-- Sylvestre Ledru <sylvestre@debian.org> Wed, 07 Oct 2020 16:38:40 +0200
llvm-toolchain-11 (1:11.0.0~+rc5-1) unstable; urgency=medium
@ -300,11 +315,27 @@ llvm-toolchain-snapshot (1:11~++20200123111717+04fd2041561-1~exp1) experimental;
-- Sylvestre Ledru <sylvestre@debian.org> Thu, 23 Jan 2020 14:52:30 +0100
llvm-toolchain-10 (1:10.0.1-7) UNRELEASED; urgency=medium
[ Samuel Thibault ]
* debian/patches/hurd/hurd-cxx-paths.diff: Add missing GCC installation
initialization.
[ Sylvestre Ledru ]
* Replace use of deprecated $ADTTMP with $AUTOPKGTEST_TMP.
-- Samuel Thibault <sthibault@debian.org> Thu, 27 Aug 2020 17:06:44 +0200
llvm-toolchain-10 (1:10.0.1-6) unstable; urgency=medium
[ Sylvestre Ledru ]
* Add debian/* to the copyright file. Uses the same license
as LLVM
[ Julien Cristau ]
* Cherry-pick "[PowerPC] PPCBoolRetToInt: Don't translate Constant's
operands". Fixes rustc crash building firefox-esr.
-- Sylvestre Ledru <sylvestre@debian.org> Wed, 02 Sep 2020 13:55:46 +0200
llvm-toolchain-10 (1:10.0.1-5) unstable; urgency=medium

View File

@ -0,0 +1,148 @@
From 05860350084abdae30dfbd2181452d1b87dca3b4 Mon Sep 17 00:00:00 2001
From: Sylvestre Ledru <sylvestre@debian.org>
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

View File

@ -132,3 +132,4 @@ disable-fuzzer-compiler-rt-x86.diff
python3-shebang.patch
print-lldb-path.patch
libcxx-armhf-ftbfs.diff
fix-clang-format-bug-47589.patch

View File

@ -5,18 +5,18 @@ set -e
LLVM_VERSION=12
# this is taken from libjsoncpp package
# Presence of $ADTTMP implies that someone will handle cleanup for us, so we
# Presence of $AUTOPKGTEST_TMP implies that someone will handle cleanup for us, so we
# can avoid duplicating the effort (signal handling, etc.) here.
if [ -z "$ADTTMP" ]
if [ -z "$AUTOPKGTEST_TMP" ]
then
echo "Required envvar ADTTMP \"$ADTTMP\" is not set" >&2
echo "Required envvar AUTOPKGTEST_TMP \"$AUTOPKGTEST_TMP\" is not set" >&2
exit 1
fi
# the idea was taken from spirv-llvm-translator package
cd "$ADTTMP"
cd "$AUTOPKGTEST_TMP"
cat <<EOF > CMakeLists.txt
cmake_minimum_required(VERSION 2.6.2)
project(cmake-test)

View File

@ -5,17 +5,17 @@ set -e
LLVM_VERSION=12
# this is taken from libjsoncpp package
# Presence of $ADTTMP implies that someone will handle cleanup for us, so we
# Presence of $AUTOPKGTEST_TMP implies that someone will handle cleanup for us, so we
# can avoid duplicating the effort (signal handling, etc.) here.
if [ -z "$ADTTMP" ]
if [ -z "$AUTOPKGTEST_TMP" ]
then
echo "Required envvar ADTTMP \"$ADTTMP\" is not set" >&2
echo "Required envvar AUTOPKGTEST_TMP \"$AUTOPKGTEST_TMP\" is not set" >&2
exit 1
fi
# Copy the integration repo to the temp dir
cp -Rv integration-test-suite/* "$ADTTMP"/
cd "$ADTTMP"
cp -Rv integration-test-suite/* "$AUTOPKGTEST_TMP"/
cd "$AUTOPKGTEST_TMP"
mkdir build
cd build