Skip to content

Commit 9f46c06

Browse files
authored
Merge branch 'main' into Fix_bug_61045
2 parents 7689da7 + a8e9dce commit 9f46c06

File tree

340 files changed

+12212
-8710
lines changed

Some content is hidden

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

340 files changed

+12212
-8710
lines changed

.github/workflows/llvm-project-tests.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
required: false
1515
os_list:
1616
required: false
17-
default: '["ubuntu-latest", "windows-2019", "macOS-12"]'
17+
default: '["ubuntu-latest", "windows-2019", "macOS-11"]'
1818
workflow_call:
1919
inputs:
2020
build_target:
@@ -34,7 +34,9 @@ on:
3434
type: string
3535
# Use windows-2019 due to:
3636
# https://developercommunity.visualstudio.com/t/Prev-Issue---with-__assume-isnan-/1597317
37-
default: '["ubuntu-latest", "windows-2019", "macOS-12"]'
37+
# We're using a specific version of macOS due to:
38+
# https://github.com/actions/virtual-environments/issues/5900
39+
default: '["ubuntu-latest", "windows-2019", "macOS-11"]'
3840

3941
concurrency:
4042
# Skip intermediate builds: always.
@@ -89,6 +91,10 @@ jobs:
8991
variant: sccache
9092
- name: Build and Test
9193
uses: llvm/actions/build-test-llvm-project@main
94+
env:
95+
# Workaround for https://github.com/actions/virtual-environments/issues/5900.
96+
# This should be a no-op for non-mac OSes
97+
PKG_CONFIG_PATH: /usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig//12
9298
with:
9399
cmake_args: '-GNinja -DLLVM_ENABLE_PROJECTS="${{ inputs.projects }}" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLDB_INCLUDE_TESTS=OFF -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache ${{ inputs.extra_cmake_args }}'
94100
build_target: '${{ inputs.build_target }}'

bolt/test/RISCV/relax.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
// CHECK: Binary Function "_start" after building cfg {
88
// CHECK: jal ra, near_f
9-
// CHECK-NEXT: auipc ra, far_f@plt
9+
// CHECK-NEXT: auipc ra, far_f
1010
// CHECK-NEXT: jalr ra, 0xc(ra)
1111
// CHECK-NEXT: j near_f
1212

clang-tools-extra/clang-tidy/misc/UnusedUsingDeclsCheck.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ class UnusedUsingDeclsCheck : public ClangTidyCheck {
2626
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
2727
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
2828
void onEndOfTranslationUnit() override;
29+
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
30+
return LangOpts.CPlusPlus;
31+
}
2932

3033
private:
3134
void removeFromFoundDecls(const Decl *D);

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ Changes in existing checks
382382

383383
- Improved :doc:`misc-unused-using-decls
384384
<clang-tidy/checks/misc/unused-using-decls>` check to avoid false positive when
385-
using in elaborated type.
385+
using in elaborated type and only check cpp files.
386386

387387
- Improved :doc:`modernize-avoid-bind
388388
<clang-tidy/checks/modernize/avoid-bind>` check to

clang/docs/ReleaseNotes.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,9 +1150,10 @@ Improvements
11501150
^^^^^^^^^^^^
11511151

11521152
- Improved the ``unix.StdCLibraryFunctions`` checker by modeling more
1153-
functions like ``send``, ``recv``, ``readlink``, ``fflush``, ``mkdtemp`` and
1154-
``errno`` behavior.
1153+
functions like ``send``, ``recv``, ``readlink``, ``fflush``, ``mkdtemp``,
1154+
``getcwd`` and ``errno`` behavior.
11551155
(`52ac71f92d38 <https://github.com/llvm/llvm-project/commit/52ac71f92d38f75df5cb88e9c090ac5fd5a71548>`_,
1156+
`#77040 <https://github.com/llvm/llvm-project/pull/77040>`_,
11561157
`#76671 <https://github.com/llvm/llvm-project/pull/76671>`_,
11571158
`#71373 <https://github.com/llvm/llvm-project/pull/71373>`_,
11581159
`#76557 <https://github.com/llvm/llvm-project/pull/76557>`_,

clang/include/clang/Analysis/CFG.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,9 @@ class CFG {
12151215
//===--------------------------------------------------------------------===//
12161216

12171217
class BuildOptions {
1218-
std::bitset<Stmt::lastStmtConstant> alwaysAddMask;
1218+
// Stmt::lastStmtConstant has the same value as the last Stmt kind,
1219+
// so make sure we add one to account for this!
1220+
std::bitset<Stmt::lastStmtConstant + 1> alwaysAddMask;
12191221

12201222
public:
12211223
using ForcedBlkExprs = llvm::DenseMap<const Stmt *, const CFGBlock *>;

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6160,23 +6160,19 @@ def err_illegal_initializer_type : Error<"illegal initializer type %0">;
61606160
def ext_init_list_type_narrowing : ExtWarn<
61616161
"type %0 cannot be narrowed to %1 in initializer list">,
61626162
InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
6163-
// *_narrowing_const_reference diagnostics have the same messages, but are
6164-
// controlled by -Wc++11-narrowing-const-reference for narrowing involving a
6165-
// const reference.
61666163
def ext_init_list_type_narrowing_const_reference : ExtWarn<
6167-
"type %0 cannot be narrowed to %1 in initializer list">,
6164+
ext_init_list_type_narrowing.Summary>,
61686165
InGroup<CXX11NarrowingConstReference>, DefaultError, SFINAEFailure;
61696166
def ext_init_list_variable_narrowing : ExtWarn<
61706167
"non-constant-expression cannot be narrowed from type %0 to %1 in "
61716168
"initializer list">, InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
61726169
def ext_init_list_variable_narrowing_const_reference : ExtWarn<
6173-
"non-constant-expression cannot be narrowed from type %0 to %1 in "
6174-
"initializer list">, InGroup<CXX11NarrowingConstReference>, DefaultError, SFINAEFailure;
6170+
ext_init_list_variable_narrowing.Summary>, InGroup<CXX11NarrowingConstReference>, DefaultError, SFINAEFailure;
61756171
def ext_init_list_constant_narrowing : ExtWarn<
61766172
"constant expression evaluates to %0 which cannot be narrowed to type %1">,
61776173
InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
61786174
def ext_init_list_constant_narrowing_const_reference : ExtWarn<
6179-
"constant expression evaluates to %0 which cannot be narrowed to type %1">,
6175+
ext_init_list_constant_narrowing.Summary>,
61806176
InGroup<CXX11NarrowingConstReference>, DefaultError, SFINAEFailure;
61816177
def warn_init_list_type_narrowing : Warning<
61826178
"type %0 cannot be narrowed to %1 in initializer list in C++11">,

clang/include/clang/Basic/OpenACCKinds.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ enum class OpenACCClauseKind {
9393
/// 'default' clause, allowed on parallel, serial, kernel (and compound)
9494
/// constructs.
9595
Default,
96+
/// 'if' clause, allowed on all the Compute Constructs, Data Constructs,
97+
/// Executable Constructs, and Combined Constructs.
98+
If,
99+
/// 'self' clause, allowed on Compute and Combined Constructs, plus 'update'.
100+
Self,
96101
/// Represents an invalid clause, for the purposes of parsing.
97102
Invalid,
98103
};

clang/include/clang/Driver/Options.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,8 @@ def gcc_install_dir_EQ : Joined<["--"], "gcc-install-dir=">,
773773
def gcc_toolchain : Joined<["--"], "gcc-toolchain=">, Flags<[NoXarchOption]>,
774774
HelpText<"Specify a directory where Clang can find 'include' and 'lib{,32,64}/gcc{,-cross}/$triple/$version'. "
775775
"Clang will use the GCC installation with the largest version">;
776+
def gcc_triple_EQ : Joined<["--"], "gcc-triple=">,
777+
HelpText<"Search for the GCC installation with the specified triple.">;
776778
def CC : Flag<["-"], "CC">, Visibility<[ClangOption, CC1Option]>,
777779
Group<Preprocessor_Group>,
778780
HelpText<"Include comments from within macros in preprocessed output">,

clang/lib/AST/ASTImporter.cpp

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2034,23 +2034,25 @@ ASTNodeImporter::ImportDeclContext(DeclContext *FromDC, bool ForceImport) {
20342034
return ToDCOrErr.takeError();
20352035
}
20362036

2037-
DeclContext *ToDC = *ToDCOrErr;
2038-
// Remove all declarations, which may be in wrong order in the
2039-
// lexical DeclContext and then add them in the proper order.
2040-
for (auto *D : FromDC->decls()) {
2041-
if (!MightNeedReordering(D))
2042-
continue;
2037+
if (const auto *FromRD = dyn_cast<RecordDecl>(FromDC)) {
2038+
DeclContext *ToDC = *ToDCOrErr;
2039+
// Remove all declarations, which may be in wrong order in the
2040+
// lexical DeclContext and then add them in the proper order.
2041+
for (auto *D : FromRD->decls()) {
2042+
if (!MightNeedReordering(D))
2043+
continue;
20432044

2044-
assert(D && "DC contains a null decl");
2045-
if (Decl *ToD = Importer.GetAlreadyImportedOrNull(D)) {
2046-
// Remove only the decls which we successfully imported.
2047-
assert(ToDC == ToD->getLexicalDeclContext() && ToDC->containsDecl(ToD));
2048-
// Remove the decl from its wrong place in the linked list.
2049-
ToDC->removeDecl(ToD);
2050-
// Add the decl to the end of the linked list.
2051-
// This time it will be at the proper place because the enclosing for
2052-
// loop iterates in the original (good) order of the decls.
2053-
ToDC->addDeclInternal(ToD);
2045+
assert(D && "DC contains a null decl");
2046+
if (Decl *ToD = Importer.GetAlreadyImportedOrNull(D)) {
2047+
// Remove only the decls which we successfully imported.
2048+
assert(ToDC == ToD->getLexicalDeclContext() && ToDC->containsDecl(ToD));
2049+
// Remove the decl from its wrong place in the linked list.
2050+
ToDC->removeDecl(ToD);
2051+
// Add the decl to the end of the linked list.
2052+
// This time it will be at the proper place because the enclosing for
2053+
// loop iterates in the original (good) order of the decls.
2054+
ToDC->addDeclInternal(ToD);
2055+
}
20542056
}
20552057
}
20562058

0 commit comments

Comments
 (0)