Skip to content

Merge 16.0.6 into emscripten-libs-16 #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
812ea07
Bump version to 16.0.5
tstellar May 17, 2023
2eb26b6
workflows/release-tasks: Remove stray backslash
tstellar May 13, 2023
5729e63
Fix ArgsAsWritten being null for ConceptSpecializationExpr in certain
yeswalrus Mar 29, 2023
8c6c56d
[X86] Don't crash on instruction prefetch intrinsics without PREFETCH…
topperc May 22, 2023
cd93216
Revert "[Driver] Support multi /guard: options"
aeubanks May 17, 2023
17ceb95
Reland "[Driver] Support multi /guard: options"
phoebewang May 18, 2023
07808f6
[llvm-mca] Fix duplicate symbols error
michaelmaitland May 3, 2023
094f771
[Hexagon] Add patterns for bspap/bitreverse for scalar vectors
May 3, 2023
9d0a2a4
[BOLT][CMake] Use correct output paths and passthrough necessary options
petrhosek May 17, 2023
35bd94a
[clang-format] Handle <chrono> ud suffixes in IntegerLiteralSeparator
owenca May 15, 2023
3a69d81
[CMake] Set compatibility policy for lists in LLVM-Config.cmake.
juchem May 22, 2023
8407887
[clang] Fix overly aggressive lifetime checks for parenthesized aggre…
alanzhao1 Apr 13, 2023
87e99de
Revert DSE workarounds, this was causing some problems in main.
tstellar May 30, 2023
b98da4c
[CMake] Don't set absolute paths as install runpaths on ELF platforms…
Apr 19, 2023
e32cbe9
[CMake][AIX] Fixing AIX rpath
Apr 21, 2023
cf85b3e
[clang] Fix crash when handling nested immediate invocations
Fznamznon Apr 5, 2023
ad815b6
[Clang][Sema] Fix invalid cast when validating SVE types within Check…
paulwalker-arm Apr 20, 2023
9c865c2
[lld][WebAssembly] Implement --why-extract flag from the ELF backend
sbc100 Mar 6, 2023
74b5a0a
[lld][WebAssembly] Initial support for stub libraries
sbc100 Dec 7, 2022
4fd1b86
[Analysis][LoongArch] Add sign extension for i32 parameters and returns
Ami-zhang Jun 1, 2023
726af32
[X86][BF16] Fix 2 crashes with vector broadcast
phoebewang Jun 1, 2023
57c54b2
[GVN] Add test for PR63019 (NFC)
nikic May 31, 2023
42f2e6e
[AA] Fix comparison of AliasResults (PR63019)
nikic May 31, 2023
185b81e
[clang] Fix crash when passing a braced-init list to a parentehsized …
alanzhao1 May 30, 2023
10c3bdc
Bump version to 16.0.6
tstellar Jun 10, 2023
7cbf1a2
[lld][WebAssembly] Fix stub library parsing with windows line endings
sbc100 Apr 4, 2023
9338db8
Merge 16.0.6 into emscripten-libs-16
aheejin Aug 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- name: Install Dependencies
run: |
sudo apt-get update \
sudo apt-get update
sudo apt-get install -y \
doxygen \
graphviz \
Expand Down
8 changes: 7 additions & 1 deletion bolt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ endif()

if (BOLT_ENABLE_RUNTIME)
message(STATUS "Building BOLT runtime libraries for X86")
set(extra_args "")
if(CMAKE_SYSROOT)
list(APPEND extra_args -DCMAKE_SYSROOT=${CMAKE_SYSROOT})
endif()
ExternalProject_Add(bolt_rt
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/runtime"
STAMP_DIR ${CMAKE_CURRENT_BINARY_DIR}/bolt_rt-stamps
Expand All @@ -54,8 +58,10 @@ if (BOLT_ENABLE_RUNTIME)
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
-DCMAKE_INSTALL_PREFIX=${LLVM_BINARY_DIR}
-DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX}
-DLLVM_LIBRARY_DIR=${LLVM_LIBRARY_DIR}
${extra_args}
INSTALL_COMMAND ""
BUILD_ALWAYS True
)
install(CODE "execute_process\(COMMAND \${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=\${CMAKE_INSTALL_PREFIX} -P ${CMAKE_CURRENT_BINARY_DIR}/bolt_rt-bins/cmake_install.cmake \)"
Expand Down
6 changes: 3 additions & 3 deletions bolt/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ add_library(bolt_rt_instr STATIC
instr.cpp
${CMAKE_CURRENT_BINARY_DIR}/config.h
)
set_target_properties(bolt_rt_instr PROPERTIES LIBRARY_OUTPUT_DIRECTORY "lib${LLVM_LIBDIR_SUFFIX}")
set_target_properties(bolt_rt_instr PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${LLVM_LIBRARY_DIR}")
add_library(bolt_rt_hugify STATIC
hugify.cpp
${CMAKE_CURRENT_BINARY_DIR}/config.h
)
set_target_properties(bolt_rt_hugify PROPERTIES LIBRARY_OUTPUT_DIRECTORY "lib${LLVM_LIBDIR_SUFFIX}")
set_target_properties(bolt_rt_hugify PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${LLVM_LIBRARY_DIR}")

set(BOLT_RT_FLAGS
-ffreestanding
Expand All @@ -44,7 +44,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES ".*Clang.*")
instr.cpp
${CMAKE_CURRENT_BINARY_DIR}/config.h
)
set_target_properties(bolt_rt_instr_osx PROPERTIES LIBRARY_OUTPUT_DIRECTORY "lib${LLVM_LIBDIR_SUFFIX}")
set_target_properties(bolt_rt_instr_osx PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${LLVM_LIBRARY_DIR}")
target_include_directories(bolt_rt_instr_osx PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_compile_options(bolt_rt_instr_osx PRIVATE
-target x86_64-apple-darwin19.6.0
Expand Down
7 changes: 0 additions & 7 deletions clang-tools-extra/clangd/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@ configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.cfg.py
)

# Copy an empty compile_flags.txt to make sure tests don't pick up arbitrary
# commands from parents.
file(
TOUCH
${CMAKE_CURRENT_BINARY_DIR}/compile_flags.txt
)

add_lit_testsuite(check-clangd "Running the Clangd regression tests"
# clangd doesn't put unittest configs in test/unit like every other project.
# Because of that, this needs to pass two folders here, while every other
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: %check_clang_tidy %s performance-trivially-destructible %t
// RUN: grep -Ev "// *[A-Z-]+:" %s > %t.cpp
// RUN: clang-tidy %t.cpp -checks='-*,performance-trivially-destructible' -fix --
// RUN: clang-tidy %t.cpp -checks='-*,performance-trivially-destructible' -warnings-as-errors='-*,performance-trivially-destructible' --
// RUN: clang-tidy %t.cpp -checks='-*,performance-trivially-destructible' -fix
// RUN: clang-tidy %t.cpp -checks='-*,performance-trivially-destructible' -warnings-as-errors='-*,performance-trivially-destructible'

struct TriviallyDestructible1 {
int a;
Expand Down
2 changes: 1 addition & 1 deletion clang/cmake/caches/Fuchsia-stage2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ set(LLVM_INSTALL_TOOLCHAIN_ONLY ON CACHE BOOL "")
set(LLVM_TOOLCHAIN_TOOLS
dsymutil
llvm-ar
llvm-bolt
llvm-cov
llvm-cxxfilt
llvm-debuginfod-find
Expand Down Expand Up @@ -287,6 +286,7 @@ set(LLVM_TOOLCHAIN_TOOLS
CACHE STRING "")

set(LLVM_DISTRIBUTION_COMPONENTS
bolt
clang
lld
LTO
Expand Down
9 changes: 9 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,12 @@ Bug Fixes in This Version
- Fix crash when attempting to perform parenthesized initialization of an
aggregate with a base class with only non-public constructors.
(`#62296 <https://github.com/llvm/llvm-project/issues/62296>`_)
- Fix crash when handling nested immediate invocations in initializers of global
variables.
(`#58207 <https://github.com/llvm/llvm-project/issues/58207>`_)
- Fix crash when passing a braced initializer list to a parentehsized aggregate
initialization expression.
(`#63008 <https://github.com/llvm/llvm-project/issues/63008>`_).

Bug Fixes to Compiler Builtins
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -824,6 +830,9 @@ Bug Fixes to C++ Support
- Fix default member initializers sometimes being ignored when performing
parenthesized aggregate initialization of templated types.
(`#62266 <https://github.com/llvm/llvm-project/issues/62266>`_)
- Fix overly aggressive lifetime checks for parenthesized aggregate
initialization.
(`#61567 <https://github.com/llvm/llvm-project/issues/61567>`_)

Concepts Specific Fixes:

Expand Down
8 changes: 8 additions & 0 deletions clang/include/clang/AST/ExprConcepts.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class ConceptSpecializationExpr final : public Expr, public ConceptReference {
const ConstraintSatisfaction *Satisfaction);

ConceptSpecializationExpr(const ASTContext &C, ConceptDecl *NamedConcept,
const ASTTemplateArgumentListInfo *ArgsAsWritten,
ImplicitConceptSpecializationDecl *SpecDecl,
const ConstraintSatisfaction *Satisfaction,
bool Dependent,
Expand All @@ -85,6 +86,13 @@ class ConceptSpecializationExpr final : public Expr, public ConceptReference {
const ConstraintSatisfaction *Satisfaction, bool Dependent,
bool ContainsUnexpandedParameterPack);

static ConceptSpecializationExpr *
Create(const ASTContext &C, ConceptDecl *NamedConcept,
const ASTTemplateArgumentListInfo *ArgsAsWritten,
ImplicitConceptSpecializationDecl *SpecDecl,
const ConstraintSatisfaction *Satisfaction, bool Dependent,
bool ContainsUnexpandedParameterPack);

ArrayRef<TemplateArgument> getTemplateArguments() const {
return SpecDecl->getTemplateArguments();
}
Expand Down
3 changes: 2 additions & 1 deletion clang/include/clang/Basic/DiagnosticSemaKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -2124,7 +2124,8 @@ def err_init_conversion_failed : Error<
"exception object|a member subobject|an array element|a new value|a value|a "
"base class|a constructor delegation|a vector element|a block element|a "
"block element|a complex element|a lambda capture|a compound literal "
"initializer|a related result|a parameter of CF audited function}0 "
"initializer|a related result|a parameter of CF audited function|a "
"structured binding|a member subobject}0 "
"%diff{of type $ with an %select{rvalue|lvalue}2 of type $|"
"with an %select{rvalue|lvalue}2 of incompatible type}1,3"
"%select{|: different classes%diff{ ($ vs $)|}5,6"
Expand Down
18 changes: 16 additions & 2 deletions clang/include/clang/Sema/Initialization.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ class alignas(8) InitializedEntity {
/// decomposition declaration.
EK_Binding,

/// The entity being initialized is a non-static data member subobject of an
/// object initialized via parenthesized aggregate initialization.
EK_ParenAggInitMember,

// Note: err_init_conversion_failed in DiagnosticSemaKinds.td uses this
// enum as an index for its first %select. When modifying this list,
// that diagnostic text needs to be updated as well.
Expand Down Expand Up @@ -227,8 +231,10 @@ class alignas(8) InitializedEntity {

/// Create the initialization entity for a member subobject.
InitializedEntity(FieldDecl *Member, const InitializedEntity *Parent,
bool Implicit, bool DefaultMemberInit)
: Kind(EK_Member), Parent(Parent), Type(Member->getType()),
bool Implicit, bool DefaultMemberInit,
bool IsParenAggInit = false)
: Kind(IsParenAggInit ? EK_ParenAggInitMember : EK_Member),
Parent(Parent), Type(Member->getType()),
Variable{Member, Implicit, DefaultMemberInit} {}

/// Create the initialization entity for an array element.
Expand Down Expand Up @@ -388,6 +394,14 @@ class alignas(8) InitializedEntity {
return InitializedEntity(Member->getAnonField(), Parent, Implicit, false);
}

/// Create the initialization entity for a member subobject initialized via
/// parenthesized aggregate init.
static InitializedEntity InitializeMemberFromParenAggInit(FieldDecl *Member) {
return InitializedEntity(Member, /*Parent=*/nullptr, /*Implicit=*/false,
/*DefaultMemberInit=*/false,
/*IsParenAggInit=*/true);
}

/// Create the initialization entity for a default member initializer.
static InitializedEntity
InitializeMemberFromDefaultMemberInitializer(FieldDecl *Member) {
Expand Down
3 changes: 3 additions & 0 deletions clang/include/clang/Sema/Sema.h
Original file line number Diff line number Diff line change
Expand Up @@ -1394,6 +1394,9 @@ class Sema final {
/// A stack of expression evaluation contexts.
SmallVector<ExpressionEvaluationContextRecord, 8> ExprEvalContexts;

// Set of failed immediate invocations to avoid double diagnosing.
llvm::SmallPtrSet<ConstantExpr *, 4> FailedImmediateInvocations;

/// Emit a warning for all pending noderef expressions that we recorded.
void WarnOnPendingNoDerefs(ExpressionEvaluationContextRecord &Rec);

Expand Down
3 changes: 2 additions & 1 deletion clang/lib/AST/ASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,8 @@ canonicalizeImmediatelyDeclaredConstraint(const ASTContext &C, Expr *IDC,
CSE->getNamedConcept()->getLocation(), NewConverted);

Expr *NewIDC = ConceptSpecializationExpr::Create(
C, CSE->getNamedConcept(), CSD, nullptr, CSE->isInstantiationDependent(),
C, CSE->getNamedConcept(), CSE->getTemplateArgsAsWritten(), CSD,
/*Satisfaction=*/nullptr, CSE->isInstantiationDependent(),
CSE->containsUnexpandedParameterPack());

if (auto *OrigFold = dyn_cast<CXXFoldExpr>(IDC))
Expand Down
19 changes: 15 additions & 4 deletions clang/lib/AST/ExprConcepts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ ConceptSpecializationExpr::ConceptSpecializationExpr(
ConceptSpecializationExpr::ConceptSpecializationExpr(EmptyShell Empty)
: Expr(ConceptSpecializationExprClass, Empty) {}

ConceptSpecializationExpr *ConceptSpecializationExpr::Create(
const ASTContext &C, ConceptDecl *NamedConcept,
ImplicitConceptSpecializationDecl *SpecDecl,
const ConstraintSatisfaction *Satisfaction, bool Dependent,
bool ContainsUnexpandedParameterPack) {
return Create(C, NamedConcept, /*ArgsAsWritten*/ nullptr, SpecDecl, Satisfaction,
Dependent, ContainsUnexpandedParameterPack);
}

ConceptSpecializationExpr *ConceptSpecializationExpr::Create(
const ASTContext &C, NestedNameSpecifierLoc NNS,
SourceLocation TemplateKWLoc, DeclarationNameInfo ConceptNameInfo,
Expand All @@ -72,13 +81,14 @@ ConceptSpecializationExpr *ConceptSpecializationExpr::Create(

ConceptSpecializationExpr::ConceptSpecializationExpr(
const ASTContext &C, ConceptDecl *NamedConcept,
const ASTTemplateArgumentListInfo *ArgsAsWritten,
ImplicitConceptSpecializationDecl *SpecDecl,
const ConstraintSatisfaction *Satisfaction, bool Dependent,
bool ContainsUnexpandedParameterPack)
: Expr(ConceptSpecializationExprClass, C.BoolTy, VK_PRValue, OK_Ordinary),
ConceptReference(NestedNameSpecifierLoc(), SourceLocation(),
DeclarationNameInfo(), NamedConcept, NamedConcept,
nullptr),
ArgsAsWritten),
SpecDecl(SpecDecl),
Satisfaction(Satisfaction
? ASTConstraintSatisfaction::Create(C, *Satisfaction)
Expand All @@ -95,12 +105,13 @@ ConceptSpecializationExpr::ConceptSpecializationExpr(

ConceptSpecializationExpr *ConceptSpecializationExpr::Create(
const ASTContext &C, ConceptDecl *NamedConcept,
const ASTTemplateArgumentListInfo *ArgsAsWritten,
ImplicitConceptSpecializationDecl *SpecDecl,
const ConstraintSatisfaction *Satisfaction, bool Dependent,
bool ContainsUnexpandedParameterPack) {
return new (C)
ConceptSpecializationExpr(C, NamedConcept, SpecDecl, Satisfaction,
Dependent, ContainsUnexpandedParameterPack);
return new (C) ConceptSpecializationExpr(C, NamedConcept, ArgsAsWritten,
SpecDecl, Satisfaction, Dependent,
ContainsUnexpandedParameterPack);
}

const TypeConstraint *
Expand Down
1 change: 1 addition & 0 deletions clang/lib/Driver/ToolChains/Clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7801,6 +7801,7 @@ void Clang::AddClangCLArgs(const ArgList &Args, types::ID InputType,
} else {
D.Diag(diag::err_drv_invalid_value) << A->getSpelling() << GuardArgs;
}
A->claim();
}
}

Expand Down
6 changes: 5 additions & 1 deletion clang/lib/Format/IntegerLiteralSeparatorFixer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ IntegerLiteralSeparatorFixer::process(const Environment &Env,
continue;
}
if (Style.isCpp()) {
if (const auto Pos = Text.find_first_of("_i"); Pos != StringRef::npos) {
// Hex alpha digits a-f/A-F must be at the end of the string literal.
StringRef Suffixes = "_himnsuyd";
if (const auto Pos =
Text.find_first_of(IsBase16 ? Suffixes.drop_back() : Suffixes);
Pos != StringRef::npos) {
Text = Text.substr(0, Pos);
Length = Pos;
}
Expand Down
3 changes: 2 additions & 1 deletion clang/lib/Sema/SemaAccess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1651,7 +1651,8 @@ Sema::AccessResult Sema::CheckConstructorAccess(SourceLocation UseLoc,
<< Entity.getBaseSpecifier()->getType() << getSpecialMember(Constructor);
break;

case InitializedEntity::EK_Member: {
case InitializedEntity::EK_Member:
case InitializedEntity::EK_ParenAggInitMember: {
const FieldDecl *Field = cast<FieldDecl>(Entity.getDecl());
PD = PDiag(diag::err_access_field_ctor);
PD << Field->getType() << getSpecialMember(Constructor);
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Sema/SemaDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8693,7 +8693,7 @@ void Sema::CheckVariableDeclarationType(VarDecl *NewVD) {
}

// Check that SVE types are only used in functions with SVE available.
if (T->isSVESizelessBuiltinType() && CurContext->isFunctionOrMethod()) {
if (T->isSVESizelessBuiltinType() && isa<FunctionDecl>(CurContext)) {
const FunctionDecl *FD = cast<FunctionDecl>(CurContext);
llvm::StringMap<bool> CallerFeatureMap;
Context.getFunctionFeatureMap(CallerFeatureMap, FD);
Expand Down
26 changes: 18 additions & 8 deletions clang/lib/Sema/SemaExpr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17805,6 +17805,7 @@ static void EvaluateAndDiagnoseImmediateInvocation(
bool Result = CE->EvaluateAsConstantExpr(
Eval, SemaRef.getASTContext(), ConstantExprKind::ImmediateInvocation);
if (!Result || !Notes.empty()) {
SemaRef.FailedImmediateInvocations.insert(CE);
Expr *InnerExpr = CE->getSubExpr()->IgnoreImplicit();
if (auto *FunctionalCast = dyn_cast<CXXFunctionalCastExpr>(InnerExpr))
InnerExpr = FunctionalCast->getSubExpr();
Expand Down Expand Up @@ -17849,10 +17850,16 @@ static void RemoveNestedImmediateInvocation(
[E](Sema::ImmediateInvocationCandidate Elem) {
return Elem.getPointer() == E;
});
assert(It != IISet.rend() &&
"ConstantExpr marked IsImmediateInvocation should "
"be present");
It->setInt(1); // Mark as deleted
// It is possible that some subexpression of the current immediate
// invocation was handled from another expression evaluation context. Do
// not handle the current immediate invocation if some of its
// subexpressions failed before.
if (It == IISet.rend()) {
if (SemaRef.FailedImmediateInvocations.contains(E))
CurrentII->setInt(1);
} else {
It->setInt(1); // Mark as deleted
}
}
ExprResult TransformConstantExpr(ConstantExpr *E) {
if (!E->isImmediateInvocation())
Expand Down Expand Up @@ -17925,10 +17932,13 @@ HandleImmediateInvocations(Sema &SemaRef,
SemaRef.RebuildingImmediateInvocation)
return;

/// When we have more then 1 ImmediateInvocationCandidates we need to check
/// for nested ImmediateInvocationCandidates. when we have only 1 we only
/// need to remove ReferenceToConsteval in the immediate invocation.
if (Rec.ImmediateInvocationCandidates.size() > 1) {
/// When we have more than 1 ImmediateInvocationCandidates or previously
/// failed immediate invocations, we need to check for nested
/// ImmediateInvocationCandidates in order to avoid duplicate diagnostics.
/// Otherwise we only need to remove ReferenceToConsteval in the immediate
/// invocation.
if (Rec.ImmediateInvocationCandidates.size() > 1 ||
!SemaRef.FailedImmediateInvocations.empty()) {

/// Prevent sema calls during the tree transform from adding pointers that
/// are already in the sets.
Expand Down
Loading