Skip to content

Commit b28a061

Browse files
committed
Merge remote-tracking branch 'upstream/release/19.x' into ldc-release/19.x
2 parents 0a27e96 + cd70802 commit b28a061

File tree

150 files changed

+2515
-547
lines changed

Some content is hidden

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

150 files changed

+2515
-547
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ jobs:
4343
projects: clang
4444
# There is an issue running on "windows-2019".
4545
# See https://github.com/llvm/llvm-project/issues/76601#issuecomment-1873049082.
46-
os_list: '["ubuntu-latest"]'
46+
os_list: '["ubuntu-22.04"]'
4747
python_version: ${{ matrix.python-version }}

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ on:
3939
type: string
4040
# Use windows-2019 due to:
4141
# https://developercommunity.visualstudio.com/t/Prev-Issue---with-__assume-isnan-/1597317
42-
default: '["ubuntu-latest", "windows-2019", "macOS-13"]'
42+
# Use ubuntu-22.04 rather than ubuntu-latest to match the ubuntu
43+
# version in the CI container. Without this, setup-python tries
44+
# to install a python version linked against a newer version of glibc.
45+
# TODO(boomanaiden154): Bump the Ubuntu version once the version in the
46+
# container is bumped.
47+
default: '["ubuntu-22.04", "windows-2019", "macOS-13"]'
4348

4449
python_version:
4550
required: false
@@ -113,7 +118,8 @@ jobs:
113118
run: |
114119
if [ "${{ runner.os }}" == "Linux" ]; then
115120
builddir="/mnt/build/"
116-
mkdir -p $builddir
121+
sudo mkdir -p $builddir
122+
sudo chown gha $builddir
117123
extra_cmake_args="-DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang"
118124
else
119125
builddir="$(pwd)"/build

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,8 @@ Bug Fixes to C++ Support
11231123
- Fixed assertion failure by skipping the analysis of an invalid field declaration. (#GH99868)
11241124
- Fix an issue with dependent source location expressions (#GH106428), (#GH81155), (#GH80210), (#GH85373)
11251125
- Fix handling of ``_`` as the name of a lambda's init capture variable. (#GH107024)
1126-
1126+
- Fixed recognition of ``std::initializer_list`` when it's surrounded with ``extern "C++"`` and exported
1127+
out of a module (which is the case e.g. in MSVC's implementation of ``std`` module). (#GH118218)
11271128

11281129
Bug Fixes to AST Handling
11291130
^^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/Basic/BuiltinsLoongArchLASX.def

Lines changed: 73 additions & 73 deletions
Large diffs are not rendered by default.

clang/include/clang/Basic/BuiltinsLoongArchLSX.def

Lines changed: 66 additions & 66 deletions
Large diffs are not rendered by default.

clang/lib/AST/Decl.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2503,7 +2503,8 @@ bool VarDecl::isUsableInConstantExpressions(const ASTContext &Context) const {
25032503
if (!DefVD->mightBeUsableInConstantExpressions(Context))
25042504
return false;
25052505
// ... and its initializer is a constant initializer.
2506-
if (Context.getLangOpts().CPlusPlus && !DefVD->hasConstantInitialization())
2506+
if ((Context.getLangOpts().CPlusPlus || getLangOpts().C23) &&
2507+
!DefVD->hasConstantInitialization())
25072508
return false;
25082509
// C++98 [expr.const]p1:
25092510
// An integral constant-expression can involve only [...] const variables
@@ -2610,8 +2611,11 @@ bool VarDecl::hasICEInitializer(const ASTContext &Context) const {
26102611
}
26112612

26122613
bool VarDecl::hasConstantInitialization() const {
2613-
// In C, all globals (and only globals) have constant initialization.
2614-
if (hasGlobalStorage() && !getASTContext().getLangOpts().CPlusPlus)
2614+
// In C, all globals and constexpr variables should have constant
2615+
// initialization. For constexpr variables in C check that initializer is a
2616+
// constant initializer because they can be used in constant expressions.
2617+
if (hasGlobalStorage() && !getASTContext().getLangOpts().CPlusPlus &&
2618+
!isConstexpr())
26152619
return true;
26162620

26172621
// In C++, it depends on whether the evaluation at the point of definition

clang/lib/AST/Interp/Interp.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,10 @@ void diagnoseEnumValue(InterpState &S, CodePtr OpPC, const EnumDecl *ED,
925925
}
926926
}
927927

928+
// https://github.com/llvm/llvm-project/issues/102513
929+
#if defined(_WIN32) && !defined(__clang__) && !defined(NDEBUG)
930+
#pragma optimize("", off)
931+
#endif
928932
bool Interpret(InterpState &S, APValue &Result) {
929933
// The current stack frame when we started Interpret().
930934
// This is being used by the ops to determine wheter
@@ -949,6 +953,10 @@ bool Interpret(InterpState &S, APValue &Result) {
949953
}
950954
}
951955
}
956+
// https://github.com/llvm/llvm-project/issues/102513
957+
#if defined(_WIN32) && !defined(__clang__) && !defined(NDEBUG)
958+
#pragma optimize("", on)
959+
#endif
952960

953961
} // namespace interp
954962
} // namespace clang

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7080,8 +7080,8 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) {
70807080
// For C++ standard modules we are done - we will call the module
70817081
// initializer for imported modules, and that will likewise call those for
70827082
// any imports it has.
7083-
if (CXX20ModuleInits && Import->getImportedOwningModule() &&
7084-
!Import->getImportedOwningModule()->isModuleMapModule())
7083+
if (CXX20ModuleInits && Import->getImportedModule() &&
7084+
Import->getImportedModule()->isNamedModule())
70857085
break;
70867086

70877087
// For clang C++ module map modules the initializers for sub-modules are

clang/lib/Driver/Driver.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6189,6 +6189,11 @@ std::string Driver::GetFilePath(StringRef Name, const ToolChain &TC) const {
61896189
if (auto P = SearchPaths(TC.getFilePaths()))
61906190
return *P;
61916191

6192+
SmallString<128> R2(ResourceDir);
6193+
llvm::sys::path::append(R2, "..", "..", Name);
6194+
if (llvm::sys::fs::exists(Twine(R2)))
6195+
return std::string(R2);
6196+
61926197
return std::string(Name);
61936198
}
61946199

clang/lib/Driver/ToolChains/Hexagon.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,10 @@ constructHexagonLinkArgs(Compilation &C, const JobAction &JA,
294294
bool IncStartFiles = !Args.hasArg(options::OPT_nostartfiles);
295295
bool IncDefLibs = !Args.hasArg(options::OPT_nodefaultlibs);
296296
bool UseG0 = false;
297-
const char *Exec = Args.MakeArgString(HTC.GetLinkerPath());
298-
bool UseLLD = (llvm::sys::path::filename(Exec).equals_insensitive("ld.lld") ||
299-
llvm::sys::path::stem(Exec).equals_insensitive("ld.lld"));
297+
bool UseLLD = false;
298+
const char *Exec = Args.MakeArgString(HTC.GetLinkerPath(&UseLLD));
299+
UseLLD = UseLLD || llvm::sys::path::filename(Exec).ends_with("ld.lld") ||
300+
llvm::sys::path::stem(Exec).ends_with("ld.lld");
300301
bool UseShared = IsShared && !IsStatic;
301302
StringRef CpuVer = toolchains::HexagonToolChain::GetTargetCPUVersion(Args);
302303

@@ -378,9 +379,9 @@ constructHexagonLinkArgs(Compilation &C, const JobAction &JA,
378379
if (NeedsXRayDeps)
379380
linkXRayRuntimeDeps(HTC, Args, CmdArgs);
380381

381-
CmdArgs.push_back("-lclang_rt.builtins-hexagon");
382382
if (!Args.hasArg(options::OPT_nolibc))
383383
CmdArgs.push_back("-lc");
384+
CmdArgs.push_back("-lclang_rt.builtins-hexagon");
384385
}
385386
if (D.CCCIsCXX()) {
386387
if (HTC.ShouldLinkCXXStdlib(Args))

0 commit comments

Comments
 (0)