Skip to content

Commit b73591a

Browse files
committed
Merge tag 'llvmorg-19.1.4' into llvm-19.1.4
LLVM Release 19.1.4
2 parents b35599b + aadaa00 commit b73591a

File tree

57 files changed

+835
-271
lines changed

Some content is hidden

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

57 files changed

+835
-271
lines changed

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/Format/UnwrappedLineParser.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2086,7 +2086,8 @@ void UnwrappedLineParser::parseStructuralElement(
20862086
case tok::kw_switch:
20872087
if (Style.Language == FormatStyle::LK_Java)
20882088
parseSwitch(/*IsExpr=*/true);
2089-
nextToken();
2089+
else
2090+
nextToken();
20902091
break;
20912092
case tok::kw_case:
20922093
// Proto: there are no switch/case statements.
@@ -2637,7 +2638,10 @@ bool UnwrappedLineParser::parseParens(TokenType AmpAmpTokenType) {
26372638
nextToken();
26382639
break;
26392640
case tok::kw_switch:
2640-
parseSwitch(/*IsExpr=*/true);
2641+
if (Style.Language == FormatStyle::LK_Java)
2642+
parseSwitch(/*IsExpr=*/true);
2643+
else
2644+
nextToken();
26412645
break;
26422646
case tok::kw_requires: {
26432647
auto RequiresToken = FormatTok;

clang/lib/Interpreter/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ set(LLVM_LINK_COMPONENTS
1414

1515
if (EMSCRIPTEN AND "lld" IN_LIST LLVM_ENABLE_PROJECTS)
1616
set(WASM_SRC Wasm.cpp)
17+
set(WASM_LINK lldWasm)
1718
endif()
1819

1920
add_clang_library(clangInterpreter
@@ -43,6 +44,7 @@ add_clang_library(clangInterpreter
4344
clangParse
4445
clangSema
4546
clangSerialization
47+
${WASM_LINK}
4648
)
4749

4850
if ((MINGW OR CYGWIN) AND BUILD_SHARED_LIBS)

clang/lib/Sema/SemaConcept.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ static const Expr *SubstituteConstraintExpressionWithoutSatisfaction(
967967
// parameters that the surrounding function hasn't been instantiated yet. Note
968968
// this may happen while we're comparing two templates' constraint
969969
// equivalence.
970-
LocalInstantiationScope ScopeForParameters(S);
970+
LocalInstantiationScope ScopeForParameters(S, /*CombineWithOuterScope=*/true);
971971
if (auto *FD = DeclInfo.getDecl()->getAsFunction())
972972
for (auto *PVD : FD->parameters()) {
973973
if (!PVD->isParameterPack()) {

clang/test/Headers/lasxintrin.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// RUN: %clang_cc1 %s -fsyntax-only -triple loongarch64 -target-feature +lasx
2+
// RUN: %clang_cc1 %s -fsyntax-only -triple loongarch64 -target-feature +lasx -flax-vector-conversions=none
3+
// RUN: %clang_cc1 %s -fsyntax-only -triple loongarch64 -target-feature +lasx -flax-vector-conversions=none -fno-signed-char
4+
5+
#include <lasxintrin.h>

clang/test/Headers/lsxintrin.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// RUN: %clang_cc1 %s -fsyntax-only -triple loongarch64 -target-feature +lsx
2+
// RUN: %clang_cc1 %s -fsyntax-only -triple loongarch64 -target-feature +lsx -flax-vector-conversions=none
3+
// RUN: %clang_cc1 %s -fsyntax-only -triple loongarch64 -target-feature +lsx -flax-vector-conversions=none -fno-signed-char
4+
5+
#include <lsxintrin.h>

0 commit comments

Comments
 (0)