Skip to content

Commit 8ff1b90

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:e4dc7d492c7b into amd-gfx:8283a826cb00
Local branch amd-gfx 8283a82 Merged main:8ff14223536d into amd-gfx:7b33fe85ed62 Remote branch main e4dc7d4 [InstCombine] Remove redundant cast of GEP fold (NFC)
2 parents 8283a82 + e4dc7d4 commit 8ff1b90

File tree

112 files changed

+2921
-507
lines changed

Some content is hidden

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

112 files changed

+2921
-507
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ the [Contributing to LLVM](https://llvm.org/docs/Contributing.html) guide.
3232
## Getting in touch
3333

3434
Join the [LLVM Discourse forums](https://discourse.llvm.org/), [Discord
35-
chat](https://discord.gg/xS7Z362), or #llvm IRC channel on
36-
[OFTC](https://oftc.net/).
35+
chat](https://discord.gg/xS7Z362),
36+
[LLVM Office Hours](https://llvm.org/docs/GettingInvolved.html#office-hours) or
37+
[Regular sync-ups](https://llvm.org/docs/GettingInvolved.html#online-sync-ups).
3738

3839
The LLVM project has adopted a [code of conduct](https://llvm.org/docs/CodeOfConduct.html) for
3940
participants to all modes of communication within the project.

clang/lib/AST/Interp/ByteCodeExprGen.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2549,9 +2549,7 @@ bool ByteCodeExprGen<Emitter>::VisitUnaryOperator(const UnaryOperator *E) {
25492549
return DiscardResult ? this->emitPop(*T, E) : true;
25502550
case UO_AddrOf: // &x
25512551
// We should already have a pointer when we get here.
2552-
if (!this->visit(SubExpr))
2553-
return false;
2554-
return DiscardResult ? this->emitPop(*T, E) : true;
2552+
return this->delegate(SubExpr);
25552553
case UO_Deref: // *x
25562554
return dereference(
25572555
SubExpr, DerefKind::Read,

clang/lib/AST/Interp/Program.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,13 @@ std::optional<unsigned> Program::getOrCreateGlobal(const ValueDecl *VD,
138138
return std::nullopt;
139139
}
140140

141-
std::optional<unsigned> Program::getOrCreateDummy(const ValueDecl *PD) {
141+
std::optional<unsigned> Program::getOrCreateDummy(const ValueDecl *VD) {
142142
// Dedup blocks since they are immutable and pointers cannot be compared.
143-
if (auto It = DummyParams.find(PD);
144-
It != DummyParams.end())
143+
if (auto It = DummyParams.find(VD); It != DummyParams.end())
145144
return It->second;
146145

147146
// Create dummy descriptor.
148-
Descriptor *Desc = allocateDescriptor(PD, std::nullopt);
147+
Descriptor *Desc = allocateDescriptor(VD, std::nullopt);
149148
// Allocate a block for storage.
150149
unsigned I = Globals.size();
151150

@@ -154,7 +153,7 @@ std::optional<unsigned> Program::getOrCreateDummy(const ValueDecl *PD) {
154153
G->block()->invokeCtor();
155154

156155
Globals.push_back(G);
157-
DummyParams[PD] = I;
156+
DummyParams[VD] = I;
158157
return I;
159158
}
160159

clang/lib/AST/Interp/Program.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class Program final {
8383
const Expr *Init = nullptr);
8484

8585
/// Returns or creates a dummy value for unknown declarations.
86-
std::optional<unsigned> getOrCreateDummy(const ValueDecl *PD);
86+
std::optional<unsigned> getOrCreateDummy(const ValueDecl *VD);
8787

8888
/// Creates a global and returns its index.
8989
std::optional<unsigned> createGlobal(const ValueDecl *VD, const Expr *E);

clang/lib/Driver/ToolChains/DragonFly.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,16 @@ void dragonfly::Linker::ConstructJob(Compilation &C, const JobAction &JA,
144144
CmdArgs.push_back("-lm");
145145
}
146146

147+
// Additional linker set-up and flags for Fortran. This is required in order
148+
// to generate executables. As Fortran runtime depends on the C runtime,
149+
// these dependencies need to be listed before the C runtime below (i.e.
150+
// AddRuntTimeLibs).
151+
if (D.IsFlangMode()) {
152+
addFortranRuntimeLibraryPath(ToolChain, Args, CmdArgs);
153+
addFortranRuntimeLibs(ToolChain, CmdArgs);
154+
CmdArgs.push_back("-lm");
155+
}
156+
147157
if (Args.hasArg(options::OPT_pthread))
148158
CmdArgs.push_back("-lpthread");
149159

clang/lib/Driver/ToolChains/FreeBSD.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,20 @@ void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
290290
else
291291
CmdArgs.push_back("-lm");
292292
}
293+
294+
// Additional linker set-up and flags for Fortran. This is required in order
295+
// to generate executables. As Fortran runtime depends on the C runtime,
296+
// these dependencies need to be listed before the C runtime below (i.e.
297+
// AddRuntTimeLibs).
298+
if (D.IsFlangMode()) {
299+
addFortranRuntimeLibraryPath(ToolChain, Args, CmdArgs);
300+
addFortranRuntimeLibs(ToolChain, CmdArgs);
301+
if (Profiling)
302+
CmdArgs.push_back("-lm_p");
303+
else
304+
CmdArgs.push_back("-lm");
305+
}
306+
293307
if (NeedsSanitizerDeps)
294308
linkSanitizerRuntimeDeps(ToolChain, Args, CmdArgs);
295309
if (NeedsXRayDeps)

clang/lib/Driver/ToolChains/Haiku.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,15 @@ void haiku::Linker::ConstructJob(Compilation &C, const JobAction &JA,
9595
if (D.CCCIsCXX() && ToolChain.ShouldLinkCXXStdlib(Args))
9696
ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
9797

98+
// Additional linker set-up and flags for Fortran. This is required in order
99+
// to generate executables. As Fortran runtime depends on the C runtime,
100+
// these dependencies need to be listed before the C runtime below (i.e.
101+
// AddRuntTimeLibs).
102+
if (D.IsFlangMode()) {
103+
addFortranRuntimeLibraryPath(ToolChain, Args, CmdArgs);
104+
addFortranRuntimeLibs(ToolChain, CmdArgs);
105+
}
106+
98107
CmdArgs.push_back("-lgcc");
99108

100109
CmdArgs.push_back("--push-state");

clang/lib/Driver/ToolChains/NetBSD.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,17 @@ void netbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
314314
ToolChain.AddCXXStdlibLibArgs(Args, CmdArgs);
315315
CmdArgs.push_back("-lm");
316316
}
317+
318+
// Additional linker set-up and flags for Fortran. This is required in order
319+
// to generate executables. As Fortran runtime depends on the C runtime,
320+
// these dependencies need to be listed before the C runtime below (i.e.
321+
// AddRuntTimeLibs).
322+
if (D.IsFlangMode()) {
323+
addFortranRuntimeLibraryPath(ToolChain, Args, CmdArgs);
324+
addFortranRuntimeLibs(ToolChain, CmdArgs);
325+
CmdArgs.push_back("-lm");
326+
}
327+
317328
if (NeedsSanitizerDeps)
318329
linkSanitizerRuntimeDeps(ToolChain, Args, CmdArgs);
319330
if (NeedsXRayDeps)

clang/lib/Driver/ToolChains/OpenBSD.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,20 @@ void openbsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
213213
else
214214
CmdArgs.push_back("-lm");
215215
}
216+
217+
// Additional linker set-up and flags for Fortran. This is required in order
218+
// to generate executables. As Fortran runtime depends on the C runtime,
219+
// these dependencies need to be listed before the C runtime below (i.e.
220+
// AddRuntTimeLibs).
221+
if (D.IsFlangMode()) {
222+
addFortranRuntimeLibraryPath(ToolChain, Args, CmdArgs);
223+
addFortranRuntimeLibs(ToolChain, CmdArgs);
224+
if (Profiling)
225+
CmdArgs.push_back("-lm_p");
226+
else
227+
CmdArgs.push_back("-lm");
228+
}
229+
216230
if (NeedsSanitizerDeps) {
217231
CmdArgs.push_back(ToolChain.getCompilerRTArgString(Args, "builtins"));
218232
linkSanitizerRuntimeDeps(ToolChain, Args, CmdArgs);

clang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3163,8 +3163,8 @@ static bool ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args,
31633163
StringRef Val = A->getValue();
31643164
if (Val.contains('=')) {
31653165
auto Split = Val.split('=');
3166-
Opts.PrebuiltModuleFiles.insert(
3167-
{std::string(Split.first), std::string(Split.second)});
3166+
Opts.PrebuiltModuleFiles.insert_or_assign(
3167+
std::string(Split.first), std::string(Split.second));
31683168
}
31693169
}
31703170
for (const auto *A : Args.filtered(OPT_fprebuilt_module_path))
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Tests that we will pick the last `-fmodule-file=<module-name>=<path>` flag
2+
// for <module-name>.
3+
4+
// RUN: rm -rf %t
5+
// RUN: split-file %s %t
6+
// RUN: cd %t
7+
//
8+
// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-module-interface -o %t/a.pcm
9+
// RUN: %clang_cc1 -std=c++20 %t/u.cpp -fmodule-file=a=%t/unexist.pcm \
10+
// RUN: -fmodule-file=a=%t/a.pcm -verify -fsyntax-only
11+
12+
//--- a.cppm
13+
export module a;
14+
export int a();
15+
16+
//--- u.cpp
17+
// expected-no-diagnostics
18+
import a;
19+
int u() {
20+
return a();
21+
}

0 commit comments

Comments
 (0)