Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit 10a6f7e

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:e353cd8173db into amd-gfx:2ca870ff5381
Local branch amd-gfx 2ca870f Merged main:3cac608fbd08 into amd-gfx:97f6261bccf8 Remote branch main e353cd8 [RISCV] Apply `IsSignExtendingOpW = 1` on `fcvtmod.w.d` (llvm#69633)
2 parents 2ca870f + e353cd8 commit 10a6f7e

File tree

109 files changed

+4282
-3242
lines changed

Some content is hidden

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

109 files changed

+4282
-3242
lines changed

.github/workflows/release-tasks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
./llvm/utils/release/github-upload-release.py --token ${{ github.token }} --release ${{ steps.validate-tag.outputs.release-version }} upload --files ./*doxygen*.tar.xz
4949
5050
- name: Create Release Notes Artifact
51-
uses: actions/download-artifact@v3
51+
uses: actions/upload-artifact@v3
5252
with:
5353
name: release-notes
5454
path: docs-build/html-export/

clang/cmake/caches/Fuchsia-stage2.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ if(FUCHSIA_ENABLE_LLDB)
368368
liblldb
369369
lldb-server
370370
lldb-argdumper
371+
lldb-dap
371372
)
372373
if(LLDB_ENABLE_PYTHON)
373374
list(APPEND _FUCHSIA_LLDB_COMPONENTS lldb-python-scripts)

clang/lib/Format/UnwrappedLineParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ void UnwrappedLineParser::parse() {
213213
}
214214

215215
// Create line with eof token.
216-
assert(FormatTok->is(tok::eof));
216+
assert(eof());
217217
pushToken(FormatTok);
218218
addUnwrappedLine();
219219

clang/lib/Index/IndexBody.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,15 @@ class BodyIndexer : public RecursiveASTVisitor<BodyIndexer> {
7777
const Stmt *Parent = *It;
7878

7979
if (auto BO = dyn_cast<BinaryOperator>(Parent)) {
80-
if (BO->getOpcode() == BO_Assign && BO->getLHS()->IgnoreParenCasts() == E)
81-
Roles |= (unsigned)SymbolRole::Write;
82-
80+
if (BO->getOpcode() == BO_Assign) {
81+
if (BO->getLHS()->IgnoreParenCasts() == E)
82+
Roles |= (unsigned)SymbolRole::Write;
83+
} else if (auto CA = dyn_cast<CompoundAssignOperator>(Parent)) {
84+
if (CA->getLHS()->IgnoreParenCasts() == E) {
85+
Roles |= (unsigned)SymbolRole::Read;
86+
Roles |= (unsigned)SymbolRole::Write;
87+
}
88+
}
8389
} else if (auto UO = dyn_cast<UnaryOperator>(Parent)) {
8490
if (UO->isIncrementDecrementOp()) {
8591
Roles |= (unsigned)SymbolRole::Read;
@@ -88,12 +94,6 @@ class BodyIndexer : public RecursiveASTVisitor<BodyIndexer> {
8894
Roles |= (unsigned)SymbolRole::AddressOf;
8995
}
9096

91-
} else if (auto CA = dyn_cast<CompoundAssignOperator>(Parent)) {
92-
if (CA->getLHS()->IgnoreParenCasts() == E) {
93-
Roles |= (unsigned)SymbolRole::Read;
94-
Roles |= (unsigned)SymbolRole::Write;
95-
}
96-
9797
} else if (auto CE = dyn_cast<CallExpr>(Parent)) {
9898
if (CE->getCallee()->IgnoreParenCasts() == E) {
9999
addCallRole(Roles, Relations);

clang/unittests/Index/IndexTests.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,31 @@ TEST(IndexTest, NonTypeTemplateParameter) {
428428
WrittenAt(Position(3, 15)))));
429429
}
430430

431+
TEST(IndexTest, ReadWriteRoles) {
432+
std::string Code = R"cpp(
433+
int main() {
434+
int foo = 0;
435+
foo = 2;
436+
foo += 1;
437+
int bar = foo;
438+
}
439+
)cpp";
440+
auto Index = std::make_shared<Indexer>();
441+
IndexingOptions Opts;
442+
Opts.IndexFunctionLocals = true;
443+
tooling::runToolOnCode(std::make_unique<IndexAction>(Index, Opts), Code);
444+
EXPECT_THAT(
445+
Index->Symbols,
446+
AllOf(Contains(AllOf(QName("foo"), HasRole(SymbolRole::Write),
447+
WrittenAt(Position(4, 7)))),
448+
Contains(AllOf(QName("foo"),
449+
HasRole(static_cast<unsigned>(SymbolRole::Read) |
450+
static_cast<unsigned>(SymbolRole::Write)),
451+
WrittenAt(Position(5, 7)))),
452+
Contains(AllOf(QName("foo"), HasRole(SymbolRole::Read),
453+
WrittenAt(Position(6, 17))))));
454+
}
455+
431456
} // namespace
432457
} // namespace index
433458
} // namespace clang

flang/lib/Semantics/check-acc-structure.cpp

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,14 +380,12 @@ CHECK_SIMPLE_CLAUSE(IfPresent, ACCC_if_present)
380380
CHECK_SIMPLE_CLAUSE(Independent, ACCC_independent)
381381
CHECK_SIMPLE_CLAUSE(NoCreate, ACCC_no_create)
382382
CHECK_SIMPLE_CLAUSE(Nohost, ACCC_nohost)
383-
CHECK_SIMPLE_CLAUSE(NumWorkers, ACCC_num_workers)
384383
CHECK_SIMPLE_CLAUSE(Private, ACCC_private)
385384
CHECK_SIMPLE_CLAUSE(Read, ACCC_read)
386385
CHECK_SIMPLE_CLAUSE(Seq, ACCC_seq)
387386
CHECK_SIMPLE_CLAUSE(Tile, ACCC_tile)
388387
CHECK_SIMPLE_CLAUSE(UseDevice, ACCC_use_device)
389388
CHECK_SIMPLE_CLAUSE(Vector, ACCC_vector)
390-
CHECK_SIMPLE_CLAUSE(VectorLength, ACCC_vector_length)
391389
CHECK_SIMPLE_CLAUSE(Wait, ACCC_wait)
392390
CHECK_SIMPLE_CLAUSE(Worker, ACCC_worker)
393391
CHECK_SIMPLE_CLAUSE(Write, ACCC_write)
@@ -541,13 +539,30 @@ void AccStructureChecker::Enter(const parser::AccClause::Gang &g) {
541539
}
542540

543541
void AccStructureChecker::Enter(const parser::AccClause::NumGangs &n) {
544-
CheckAllowed(llvm::acc::Clause::ACCC_num_gangs);
542+
CheckAllowed(llvm::acc::Clause::ACCC_num_gangs,
543+
/*warnInsteadOfError=*/GetContext().directive ==
544+
llvm::acc::Directive::ACCD_serial ||
545+
GetContext().directive == llvm::acc::Directive::ACCD_serial_loop);
545546

546547
if (n.v.size() > 3)
547548
context_.Say(GetContext().clauseSource,
548549
"NUM_GANGS clause accepts a maximum of 3 arguments"_err_en_US);
549550
}
550551

552+
void AccStructureChecker::Enter(const parser::AccClause::NumWorkers &n) {
553+
CheckAllowed(llvm::acc::Clause::ACCC_num_workers,
554+
/*warnInsteadOfError=*/GetContext().directive ==
555+
llvm::acc::Directive::ACCD_serial ||
556+
GetContext().directive == llvm::acc::Directive::ACCD_serial_loop);
557+
}
558+
559+
void AccStructureChecker::Enter(const parser::AccClause::VectorLength &n) {
560+
CheckAllowed(llvm::acc::Clause::ACCC_vector_length,
561+
/*warnInsteadOfError=*/GetContext().directive ==
562+
llvm::acc::Directive::ACCD_serial ||
563+
GetContext().directive == llvm::acc::Directive::ACCD_serial_loop);
564+
}
565+
551566
void AccStructureChecker::Enter(const parser::AccClause::Reduction &reduction) {
552567
CheckAllowed(llvm::acc::Clause::ACCC_reduction);
553568

flang/lib/Semantics/check-directive-structure.h

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ class DirectiveStructureChecker : public virtual BaseChecker {
333333

334334
void CheckRequireAtLeastOneOf(bool warnInsteadOfError = false);
335335

336-
void CheckAllowed(C clause);
336+
void CheckAllowed(C clause, bool warnInsteadOfError = false);
337337

338338
void CheckAtLeastOneClause();
339339

@@ -452,15 +452,21 @@ std::string DirectiveStructureChecker<D, C, PC,
452452
// Check that clauses present on the directive are allowed clauses.
453453
template <typename D, typename C, typename PC, std::size_t ClauseEnumSize>
454454
void DirectiveStructureChecker<D, C, PC, ClauseEnumSize>::CheckAllowed(
455-
C clause) {
455+
C clause, bool warnInsteadOfError) {
456456
if (!GetContext().allowedClauses.test(clause) &&
457457
!GetContext().allowedOnceClauses.test(clause) &&
458458
!GetContext().allowedExclusiveClauses.test(clause) &&
459459
!GetContext().requiredClauses.test(clause)) {
460-
context_.Say(GetContext().clauseSource,
461-
"%s clause is not allowed on the %s directive"_err_en_US,
462-
parser::ToUpperCaseLetters(getClauseName(clause).str()),
463-
parser::ToUpperCaseLetters(GetContext().directiveSource.ToString()));
460+
if (warnInsteadOfError)
461+
context_.Say(GetContext().clauseSource,
462+
"%s clause is not allowed on the %s directive and will be ignored"_port_en_US,
463+
parser::ToUpperCaseLetters(getClauseName(clause).str()),
464+
parser::ToUpperCaseLetters(GetContext().directiveSource.ToString()));
465+
else
466+
context_.Say(GetContext().clauseSource,
467+
"%s clause is not allowed on the %s directive"_err_en_US,
468+
parser::ToUpperCaseLetters(getClauseName(clause).str()),
469+
parser::ToUpperCaseLetters(GetContext().directiveSource.ToString()));
464470
return;
465471
}
466472
if ((GetContext().allowedOnceClauses.test(clause) ||

flang/test/Semantics/OpenACC/acc-serial.f90

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ program openacc_serial_validity
7777
!$acc serial wait(wait1) wait(wait2)
7878
!$acc end serial
7979

80-
!ERROR: NUM_GANGS clause is not allowed on the SERIAL directive
80+
!PORTABILITY: NUM_GANGS clause is not allowed on the SERIAL directive and will be ignored
8181
!$acc serial num_gangs(8)
8282
!$acc end serial
8383

84-
!ERROR: NUM_WORKERS clause is not allowed on the SERIAL directive
84+
!PORTABILITY: NUM_WORKERS clause is not allowed on the SERIAL directive and will be ignored
8585
!$acc serial num_workers(8)
8686
!$acc end serial
8787

88-
!ERROR: VECTOR_LENGTH clause is not allowed on the SERIAL directive
88+
!PORTABILITY: VECTOR_LENGTH clause is not allowed on the SERIAL directive and will be ignored
8989
!$acc serial vector_length(128)
9090
!$acc end serial
9191

libc/config/gpu/entrypoints.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ set(TARGET_LIBC_ENTRYPOINTS
6363
libc.src.stdlib.lldiv
6464
libc.src.stdlib.qsort
6565
libc.src.stdlib.qsort_r
66+
libc.src.stdlib.rand
67+
libc.src.stdlib.srand
6668
libc.src.stdlib.strtod
6769
libc.src.stdlib.strtof
6870
libc.src.stdlib.strtol

libc/include/llvm-libc-types/rpc_opcodes_t.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ typedef enum {
1717
RPC_WRITE_TO_STREAM,
1818
RPC_WRITE_TO_STDOUT_NEWLINE,
1919
RPC_READ_FROM_STREAM,
20+
RPC_READ_FGETS,
2021
RPC_OPEN_FILE,
2122
RPC_CLOSE_FILE,
2223
RPC_MALLOC,

0 commit comments

Comments
 (0)