Skip to content

Commit 6385230

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:1a4b9b6f7339 into amd-gfx:31ed504cc6fe
Local branch amd-gfx 31ed504 Merged main:c718336c4cb1 into amd-gfx:1d8917372237 Remote branch main 1a4b9b6 [asan] Ensure __asan_register_elf_globals is called in COMDAT asan.module_ctor (llvm#67745)
2 parents 31ed504 + 1a4b9b6 commit 6385230

File tree

179 files changed

+1846
-1180
lines changed

Some content is hidden

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

179 files changed

+1846
-1180
lines changed

clang-tools-extra/clangd/IncludeCleaner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ bool mayConsiderUnused(const Inclusion &Inc, ParsedAST &AST,
102102
// Headers without include guards have side effects and are not
103103
// self-contained, skip them.
104104
if (!AST.getPreprocessor().getHeaderSearchInfo().isFileMultipleIncludeGuarded(
105-
&FE->getFileEntry())) {
105+
*FE)) {
106106
dlog("{0} doesn't have header guard and will not be considered unused",
107107
FE->getName());
108108
return false;

clang-tools-extra/clangd/ParsedAST.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,8 @@ ParsedAST::build(llvm::StringRef Filename, const ParseInputs &Inputs,
499499
// (The rest of HeaderFileInfo is not relevant for our purposes).
500500
if (Preamble && Preamble->MainIsIncludeGuarded) {
501501
const SourceManager &SM = Clang->getSourceManager();
502-
const FileEntry *MainFE = SM.getFileEntryForID(SM.getMainFileID());
503-
Clang->getPreprocessor().getHeaderSearchInfo().MarkFileIncludeOnce(MainFE);
502+
OptionalFileEntryRef MainFE = SM.getFileEntryRefForID(SM.getMainFileID());
503+
Clang->getPreprocessor().getHeaderSearchInfo().MarkFileIncludeOnce(*MainFE);
504504
}
505505

506506
// Set up ClangTidy. Must happen after BeginSourceFile() so ASTContext exists.

clang-tools-extra/clangd/Preamble.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,10 @@ class CppFilePreambleCallbacks : public PreambleCallbacks {
122122
CapturedCtx.emplace(CI);
123123

124124
const SourceManager &SM = CI.getSourceManager();
125-
const FileEntry *MainFE = SM.getFileEntryForID(SM.getMainFileID());
125+
OptionalFileEntryRef MainFE = SM.getFileEntryRefForID(SM.getMainFileID());
126126
IsMainFileIncludeGuarded =
127127
CI.getPreprocessor().getHeaderSearchInfo().isFileMultipleIncludeGuarded(
128-
MainFE);
128+
*MainFE);
129129

130130
if (Stats) {
131131
const ASTContext &AST = CI.getASTContext();

clang-tools-extra/clangd/unittests/ParsedASTTests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,10 +465,10 @@ std::string once(llvm::StringRef Code) {
465465

466466
bool mainIsGuarded(const ParsedAST &AST) {
467467
const auto &SM = AST.getSourceManager();
468-
const FileEntry *MainFE = SM.getFileEntryForID(SM.getMainFileID());
468+
OptionalFileEntryRef MainFE = SM.getFileEntryRefForID(SM.getMainFileID());
469469
return AST.getPreprocessor()
470470
.getHeaderSearchInfo()
471-
.isFileMultipleIncludeGuarded(MainFE);
471+
.isFileMultipleIncludeGuarded(*MainFE);
472472
}
473473

474474
MATCHER_P(diag, Desc, "") {

clang-tools-extra/include-cleaner/lib/Record.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ class PragmaIncludes::RecordPragma : public PPCallbacks, public CommentHandler {
188188
if (Reason == PPCallbacks::ExitFile) {
189189
// At file exit time HeaderSearchInfo is valid and can be used to
190190
// determine whether the file was a self-contained header or not.
191-
if (const FileEntry *FE = SM.getFileEntryForID(PrevFID)) {
192-
if (tooling::isSelfContainedHeader(FE, SM, HeaderInfo))
191+
if (OptionalFileEntryRef FE = SM.getFileEntryRefForID(PrevFID)) {
192+
if (tooling::isSelfContainedHeader(*FE, SM, HeaderInfo))
193193
Out->NonSelfContainedFiles.erase(FE->getUniqueID());
194194
else
195195
Out->NonSelfContainedFiles.insert(FE->getUniqueID());

clang/docs/ReleaseNotes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ Bug Fixes in This Version
269269
- Fixes crash when trying to obtain the common sugared type of
270270
`decltype(instantiation-dependent-expr)`.
271271
Fixes (`#67603 <https://github.com/llvm/llvm-project/issues/67603>`_)
272+
- Fixes a crash caused by a multidimensional array being captured by a lambda
273+
(`#67722 <https://github.com/llvm/llvm-project/issues/67722>`_).
272274

273275
Bug Fixes to Compiler Builtins
274276
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -370,6 +372,9 @@ Bug Fixes to C++ Support
370372
argument. Fixes:
371373
(`#67395 <https://github.com/llvm/llvm-project/issues/67395>`_)
372374

375+
- Fixed a bug causing destructors of constant-evaluated structured bindings
376+
initialized by array elements to be called in the wrong evaluation context.
377+
373378
Bug Fixes to AST Handling
374379
^^^^^^^^^^^^^^^^^^^^^^^^^
375380
- Fixed an import failure of recursive friend class template.

clang/include/clang/AST/OpenMPClause.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9220,6 +9220,27 @@ class OMPXAttributeClause
92209220
}
92219221
};
92229222

9223+
/// This represents 'ompx_bare' clause in the '#pragma omp target teams ...'
9224+
/// directive.
9225+
///
9226+
/// \code
9227+
/// #pragma omp target teams ompx_bare
9228+
/// \endcode
9229+
/// In this example directive '#pragma omp target teams' has a 'ompx_bare'
9230+
/// clause.
9231+
class OMPXBareClause : public OMPNoChildClause<llvm::omp::OMPC_ompx_bare> {
9232+
public:
9233+
/// Build 'ompx_bare' clause.
9234+
///
9235+
/// \param StartLoc Starting location of the clause.
9236+
/// \param EndLoc Ending location of the clause.
9237+
OMPXBareClause(SourceLocation StartLoc, SourceLocation EndLoc)
9238+
: OMPNoChildClause(StartLoc, EndLoc) {}
9239+
9240+
/// Build an empty clause.
9241+
OMPXBareClause() = default;
9242+
};
9243+
92239244
} // namespace clang
92249245

92259246
#endif // LLVM_CLANG_AST_OPENMPCLAUSE_H

clang/include/clang/AST/RecursiveASTVisitor.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3890,6 +3890,11 @@ bool RecursiveASTVisitor<Derived>::VisitOMPXAttributeClause(
38903890
return true;
38913891
}
38923892

3893+
template <typename Derived>
3894+
bool RecursiveASTVisitor<Derived>::VisitOMPXBareClause(OMPXBareClause *C) {
3895+
return true;
3896+
}
3897+
38933898
// FIXME: look at the following tricky-seeming exprs to see if we
38943899
// need to recurse on anything. These are ones that have methods
38953900
// returning decls or qualtypes or nestednamespecifier -- though I'm

clang/include/clang/Basic/DiagnosticParseKinds.td

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,6 +1360,8 @@ def warn_clause_expected_string : Warning<
13601360
"expected string literal in 'clause %0' - ignoring">, InGroup<IgnoredPragmas>;
13611361
def err_omp_unexpected_clause : Error<
13621362
"unexpected OpenMP clause '%0' in directive '#pragma omp %1'">;
1363+
def err_omp_unexpected_clause_extension_only : Error<
1364+
"OpenMP clause '%0' is only available as extension, use '-fopenmp-extensions'">;
13631365
def err_omp_immediate_directive : Error<
13641366
"'#pragma omp %0' %select{|with '%2' clause }1cannot be an immediate substatement">;
13651367
def err_omp_expected_identifier_for_critical : Error<
@@ -1452,6 +1454,8 @@ def warn_unknown_declare_variant_isa_trait
14521454
"spelling or consider restricting the context selector with the "
14531455
"'arch' selector further">,
14541456
InGroup<SourceUsesOpenMP>;
1457+
def note_ompx_bare_clause : Note<
1458+
"OpenMP extension clause '%0' only allowed with '#pragma omp %1'">;
14551459
def note_omp_declare_variant_ctx_options
14561460
: Note<"context %select{set|selector|property}0 options are: %1">;
14571461
def warn_omp_declare_variant_expected

clang/include/clang/Basic/SourceManager.h

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -942,12 +942,12 @@ class SourceManager : public RefCountedBase<SourceManager> {
942942
///
943943
/// Returns std::nullopt if the buffer is not valid.
944944
std::optional<llvm::MemoryBufferRef>
945-
getMemoryBufferForFileOrNone(const FileEntry *File);
945+
getMemoryBufferForFileOrNone(FileEntryRef File);
946946

947947
/// Retrieve the memory buffer associated with the given file.
948948
///
949949
/// Returns a fake buffer if there isn't a real one.
950-
llvm::MemoryBufferRef getMemoryBufferForFileOrFake(const FileEntry *File) {
950+
llvm::MemoryBufferRef getMemoryBufferForFileOrFake(FileEntryRef File) {
951951
if (auto B = getMemoryBufferForFileOrNone(File))
952952
return *B;
953953
return getFakeBufferForRecovery();
@@ -960,7 +960,7 @@ class SourceManager : public RefCountedBase<SourceManager> {
960960
///
961961
/// \param Buffer the memory buffer whose contents will be used as the
962962
/// data in the given source file.
963-
void overrideFileContents(const FileEntry *SourceFile,
963+
void overrideFileContents(FileEntryRef SourceFile,
964964
const llvm::MemoryBufferRef &Buffer) {
965965
overrideFileContents(SourceFile, llvm::MemoryBuffer::getMemBuffer(Buffer));
966966
}
@@ -972,12 +972,8 @@ class SourceManager : public RefCountedBase<SourceManager> {
972972
///
973973
/// \param Buffer the memory buffer whose contents will be used as the
974974
/// data in the given source file.
975-
void overrideFileContents(const FileEntry *SourceFile,
976-
std::unique_ptr<llvm::MemoryBuffer> Buffer);
977975
void overrideFileContents(FileEntryRef SourceFile,
978-
std::unique_ptr<llvm::MemoryBuffer> Buffer) {
979-
overrideFileContents(&SourceFile.getFileEntry(), std::move(Buffer));
980-
}
976+
std::unique_ptr<llvm::MemoryBuffer> Buffer);
981977

982978
/// Override the given source file with another one.
983979
///

0 commit comments

Comments
 (0)