Skip to content

Commit 7a40c98

Browse files
authored
Merge branch 'release/20.x' into issue132475
2 parents 78b0eb2 + 5ba1949 commit 7a40c98

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+644
-457
lines changed

.github/workflows/libclang-abi-tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ jobs:
103103
uses: llvm/actions/install-ninja@main
104104
- name: Install abi-compliance-checker
105105
run: |
106+
sudo apt-get update
106107
sudo apt-get install abi-dumper autoconf pkg-config
107108
- name: Install universal-ctags
108109
run: |
@@ -154,7 +155,9 @@ jobs:
154155
path: build-latest
155156

156157
- name: Install abi-compliance-checker
157-
run: sudo apt-get install abi-compliance-checker
158+
run: |
159+
sudo apt-get update
160+
sudo apt-get install abi-compliance-checker
158161
- name: Compare ABI
159162
run: |
160163
for lib in ${{ needs.abi-dump-setup.outputs.ABI_LIBS }}; do

.github/workflows/llvm-tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ jobs:
9191
uses: llvm/actions/install-ninja@main
9292
- name: Install abi-compliance-checker
9393
run: |
94+
sudo apt-get update
9495
sudo apt-get install abi-dumper autoconf pkg-config
9596
- name: Install universal-ctags
9697
run: |
@@ -163,7 +164,9 @@ jobs:
163164
path: symbol-list
164165

165166
- name: Install abi-compliance-checker
166-
run: sudo apt-get install abi-compliance-checker
167+
run: |
168+
sudo apt-get update
169+
sudo apt-get install abi-compliance-checker
167170
- name: Compare ABI
168171
run: |
169172
if [ -s symbol-list/llvm.symbols ]; then

clang/docs/ReleaseNotes.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,11 @@ New Compiler Flags
545545
- The ``-Warray-compare-cxx26`` warning has been added to warn about array comparison
546546
starting from C++26, this warning is enabled as an error by default.
547547

548+
- The ``-Wnontrivial-memcall`` warning has been added to warn about
549+
passing non-trivially-copyable destination parameter to ``memcpy``,
550+
``memset`` and similar functions for which it is a documented undefined
551+
behavior. It is implied by ``-Wnontrivial-memaccess``
552+
548553
- clang-cl and clang-dxc now support ``-fdiagnostics-color=[auto|never|always]``
549554
in addition to ``-f[no-]color-diagnostics``.
550555

@@ -576,11 +581,6 @@ Modified Compiler Flags
576581
to utilize these vector libraries. The behavior for all other vector function
577582
libraries remains unchanged.
578583

579-
- The ``-Wnontrivial-memcall`` warning has been added to warn about
580-
passing non-trivially-copyable destination parameter to ``memcpy``,
581-
``memset`` and similar functions for which it is a documented undefined
582-
behavior. It is implied by ``-Wnontrivial-memaccess``
583-
584584
- Added ``-fmodules-reduced-bmi`` flag corresponding to
585585
``-fexperimental-modules-reduced-bmi`` flag. The ``-fmodules-reduced-bmi`` flag
586586
is intended to be enabled by default in the future.

clang/lib/Driver/ToolChains/Hexagon.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ constructHexagonLinkArgs(Compilation &C, const JobAction &JA,
313313
// handled somewhere else.
314314
Args.ClaimAllArgs(options::OPT_static_libgcc);
315315

316+
CmdArgs.push_back("--eh-frame-hdr");
316317
//----------------------------------------------------------------------------
317318
//
318319
//----------------------------------------------------------------------------
@@ -802,9 +803,7 @@ bool HexagonToolChain::isAutoHVXEnabled(const llvm::opt::ArgList &Args) {
802803
// Returns the default CPU for Hexagon. This is the default compilation target
803804
// if no Hexagon processor is selected at the command-line.
804805
//
805-
StringRef HexagonToolChain::GetDefaultCPU() {
806-
return "hexagonv60";
807-
}
806+
StringRef HexagonToolChain::GetDefaultCPU() { return "hexagonv68"; }
808807

809808
StringRef HexagonToolChain::GetTargetCPUVersion(const ArgList &Args) {
810809
Arg *CpuArg = nullptr;

clang/lib/Format/Format.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2114,10 +2114,14 @@ std::error_code parseConfiguration(llvm::MemoryBufferRef Config,
21142114
FormatStyle::FormatStyleSet StyleSet;
21152115
bool LanguageFound = false;
21162116
for (const FormatStyle &Style : llvm::reverse(Styles)) {
2117-
if (Style.Language != FormatStyle::LK_None)
2117+
const auto Lang = Style.Language;
2118+
if (Lang != FormatStyle::LK_None)
21182119
StyleSet.Add(Style);
2119-
if (Style.Language == Language)
2120+
if (Lang == Language ||
2121+
// For backward compatibility.
2122+
(Lang == FormatStyle::LK_Cpp && Language == FormatStyle::LK_C)) {
21202123
LanguageFound = true;
2124+
}
21212125
}
21222126
if (!LanguageFound) {
21232127
if (Styles.empty() || Styles[0].Language != FormatStyle::LK_None)
@@ -2157,8 +2161,14 @@ FormatStyle::FormatStyleSet::Get(FormatStyle::LanguageKind Language) const {
21572161
if (!Styles)
21582162
return std::nullopt;
21592163
auto It = Styles->find(Language);
2160-
if (It == Styles->end())
2161-
return std::nullopt;
2164+
if (It == Styles->end()) {
2165+
if (Language != FormatStyle::LK_C)
2166+
return std::nullopt;
2167+
// For backward compatibility.
2168+
It = Styles->find(FormatStyle::LK_Cpp);
2169+
if (It == Styles->end())
2170+
return std::nullopt;
2171+
}
21622172
FormatStyle Style = It->second;
21632173
Style.StyleSet = *this;
21642174
return Style;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// CHECK: "-target-cpu" "hexagonv68"
2+
3+
// RUN: %clang -c %s -### --target=hexagon-unknown-elf \
4+
// RUN: 2>&1 | FileCheck %s

clang/test/Driver/hexagon-toolchain-elf.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,7 @@
555555
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
556556
// RUN: -mcpu=hexagonv60 \
557557
// RUN: -fuse-ld=lld %s 2>&1 | FileCheck -check-prefix=CHECK382 %s
558+
// CHECK382: "--eh-frame-hdr
558559
// CHECK382-NOT: "-march=
559560
// CHECK382-NOT: "-mcpu=
560561
// -----------------------------------------------------------------------------

clang/test/Driver/hexagon-toolchain-linux.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
// RUN: --target=hexagon-unknown-linux-musl %s -### 2>&1 \
128128
// RUN: | FileCheck -check-prefix=CHECK011 %s
129129
// CHECK011: InstalledDir: [[INSTALLED_DIR:.+]]
130+
// CHECK011: "--eh-frame-hdr"
130131
// CHECK011: crt1.o
131132
// CHECK011-NOT: "-lunwind"
132133
// CHECK011-NOT: "-lgcc_eh"

clang/unittests/Format/ConfigParseTest.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,6 +1214,26 @@ TEST(ConfigParseTest, ParsesConfigurationWithLanguages) {
12141214
IndentWidth, 56u);
12151215
}
12161216

1217+
TEST(ConfigParseTest, AllowCppForC) {
1218+
FormatStyle Style = {};
1219+
Style.Language = FormatStyle::LK_C;
1220+
EXPECT_EQ(parseConfiguration("Language: Cpp", &Style), ParseError::Success);
1221+
1222+
CHECK_PARSE("---\n"
1223+
"IndentWidth: 4\n"
1224+
"---\n"
1225+
"Language: Cpp\n"
1226+
"IndentWidth: 8\n",
1227+
IndentWidth, 8u);
1228+
1229+
EXPECT_EQ(parseConfiguration("---\n"
1230+
"Language: ObjC\n"
1231+
"---\n"
1232+
"Language: Cpp\n",
1233+
&Style),
1234+
ParseError::Success);
1235+
}
1236+
12171237
TEST(ConfigParseTest, UsesLanguageForBasedOnStyle) {
12181238
FormatStyle Style = {};
12191239
Style.Language = FormatStyle::LK_JavaScript;

libcxx/test/tools/clang_tidy_checks/CMakeLists.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ set(Clang_DIR_SAVE ${Clang_DIR})
88
# versions must match. Otherwise there likely will be ODR-violations. This had
99
# led to crashes and incorrect output of the clang-tidy based checks.
1010
find_package(Clang ${CMAKE_CXX_COMPILER_VERSION})
11+
12+
set(LLVM_DIR "${LLVM_DIR_SAVE}" CACHE PATH "The directory containing a CMake configuration file for LLVM." FORCE)
13+
set(Clang_DIR "${Clang_DIR_SAVE}" CACHE PATH "The directory containing a CMake configuration file for Clang." FORCE)
14+
1115
if(NOT Clang_FOUND)
1216
message(STATUS "Clang-tidy tests are disabled since the "
1317
"Clang development package is unavailable.")
@@ -19,9 +23,6 @@ if(NOT TARGET clangTidy)
1923
return()
2024
endif()
2125

22-
set(LLVM_DIR "${LLVM_DIR_SAVE}" CACHE PATH "The directory containing a CMake configuration file for LLVM." FORCE)
23-
set(Clang_DIR "${Clang_DIR_SAVE}" CACHE PATH "The directory containing a CMake configuration file for Clang." FORCE)
24-
2526
message(STATUS "Found system-installed LLVM ${LLVM_PACKAGE_VERSION} with headers in ${LLVM_INCLUDE_DIRS}")
2627

2728
set(CMAKE_CXX_STANDARD 20)

0 commit comments

Comments
 (0)