Skip to content

Commit

Permalink
Merge llvm-project release/17.x llvmorg-17.0.0-rc4-10-g0176e8729ea4
Browse files Browse the repository at this point in the history
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-17.0.0-rc4-10-g0176e8729ea4.

PR:		273753
MFC after:	1 month
  • Loading branch information
DimitryAndric authored and bsdjhb committed Mar 5, 2024
2 parents 66072de + 8a4dda3 commit 5e0f07d
Show file tree
Hide file tree
Showing 249 changed files with 3,393 additions and 2,248 deletions.
6 changes: 3 additions & 3 deletions contrib/llvm-project/clang/include/clang/AST/DeclBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -1702,7 +1702,7 @@ class DeclContext {
};

/// Number of non-inherited bits in FunctionDeclBitfields.
enum { NumFunctionDeclBits = 30 };
enum { NumFunctionDeclBits = 31 };

/// Stores the bits used by CXXConstructorDecl. If modified
/// NumCXXConstructorDeclBits and the accessor
Expand All @@ -1714,12 +1714,12 @@ class DeclContext {
/// For the bits in FunctionDeclBitfields.
uint64_t : NumFunctionDeclBits;

/// 21 bits to fit in the remaining available space.
/// 20 bits to fit in the remaining available space.
/// Note that this makes CXXConstructorDeclBitfields take
/// exactly 64 bits and thus the width of NumCtorInitializers
/// will need to be shrunk if some bit is added to NumDeclContextBitfields,
/// NumFunctionDeclBitfields or CXXConstructorDeclBitfields.
uint64_t NumCtorInitializers : 18;
uint64_t NumCtorInitializers : 17;
uint64_t IsInheritingConstructor : 1;

/// Whether this constructor has a trail-allocated explicit specifier.
Expand Down
14 changes: 11 additions & 3 deletions contrib/llvm-project/clang/include/clang/AST/ExprConcepts.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,21 @@
#ifndef LLVM_CLANG_AST_EXPRCONCEPTS_H
#define LLVM_CLANG_AST_EXPRCONCEPTS_H

#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTConcept.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/AST/DeclarationName.h"
#include "clang/AST/DeclTemplate.h"
#include "clang/AST/DeclarationName.h"
#include "clang/AST/Expr.h"
#include "clang/AST/NestedNameSpecifier.h"
#include "clang/AST/TemplateBase.h"
#include "clang/AST/Type.h"
#include "clang/Basic/SourceLocation.h"
#include "llvm/ADT/STLFunctionalExtras.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/TrailingObjects.h"
#include <utility>
#include <string>
#include <utility>

namespace clang {
class ASTStmtReader;
Expand Down Expand Up @@ -467,6 +468,13 @@ class NestedRequirement : public Requirement {
}
};

using EntityPrinter = llvm::function_ref<void(llvm::raw_ostream &)>;

/// \brief create a Requirement::SubstitutionDiagnostic with only a
/// SubstitutedEntity and DiagLoc using Sema's allocator.
Requirement::SubstitutionDiagnostic *
createSubstDiagAt(Sema &S, SourceLocation Location, EntityPrinter Printer);

} // namespace concepts

/// C++2a [expr.prim.req]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ CODEGENOPT(PrepareForThinLTO , 1, 0) ///< Set when -flto=thin is enabled on the
///< compile step.
CODEGENOPT(LTOUnit, 1, 0) ///< Emit IR to support LTO unit features (CFI, whole
///< program vtable opt).
CODEGENOPT(FatLTO, 1, 0) ///< Set when -ffat-lto-objects is enabled.
CODEGENOPT(EnableSplitLTOUnit, 1, 0) ///< Enable LTO unit splitting to support
/// CFI and traditional whole program
/// devirtualization that require whole
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ def note_consteval_address_accessible : Note<
"is not a constant expression">;
def note_constexpr_uninitialized : Note<
"subobject %0 is not initialized">;
def note_constexpr_uninitialized_base : Note<
"constructor of base class %0 is not called">;
def note_constexpr_static_local : Note<
"control flows through the definition of a %select{static|thread_local}0 variable">;
def note_constexpr_subobject_declared_here : Note<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def DeprecatedStaticAnalyzerFlag : DiagGroup<"deprecated-static-analyzer-flag">;
// Empty DiagGroups are recognized by clang but ignored.
def ODR : DiagGroup<"odr">;
def : DiagGroup<"abi">;
def : DiagGroup<"gnu-empty-initializer">; // Now a C extension, not GNU.
def AbsoluteValue : DiagGroup<"absolute-value">;
def MisspelledAssumption : DiagGroup<"misspelled-assumption">;
def UnknownAssumption : DiagGroup<"unknown-assumption">;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,10 @@ def ext_ms_reserved_user_defined_literal : ExtWarn<
def err_unsupported_string_concat : Error<
"unsupported non-standard concatenation of string literals">;

def warn_unevaluated_string_prefix : Warning<
"encoding prefix '%0' on an unevaluated string literal has no effect"
"%select{| and is incompatible with c++2c}1">,
InGroup<DiagGroup<"invalid-unevaluated-string">>;
def err_unevaluated_string_prefix : Error<
"an unevaluated string literal cannot have an encoding prefix">;
def err_unevaluated_string_udl : Error<
Expand Down
4 changes: 4 additions & 0 deletions contrib/llvm-project/clang/include/clang/Basic/Sanitizers.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@

namespace llvm {
class hash_code;
class Triple;
namespace opt {
class ArgList;
}
} // namespace llvm

namespace clang {

Expand Down
4 changes: 3 additions & 1 deletion contrib/llvm-project/clang/include/clang/Basic/TargetInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -1414,7 +1414,9 @@ class TargetInfo : public TransferrableTargetInfo,

/// Identify whether this target supports IFuncs.
bool supportsIFunc() const {
return getTriple().isOSBinFormatELF() && !getTriple().isOSFuchsia();
return getTriple().isOSBinFormatELF() &&
((getTriple().isOSLinux() && !getTriple().isMusl()) ||
getTriple().isOSFreeBSD());
}

// Validate the contents of the __builtin_cpu_supports(const char*)
Expand Down
52 changes: 1 addition & 51 deletions contrib/llvm-project/clang/include/clang/Basic/riscv_vector.td
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ multiclass RVVIntBinBuiltinSet
multiclass RVVSlideOneBuiltinSet
: RVVOutOp1BuiltinSet<NAME, "csil",
[["vx", "v", "vve"],
["vx", "Uv", "UvUve"]]>;
["vx", "Uv", "UvUvUe"]]>;

multiclass RVVSignedShiftBuiltinSet
: RVVOutOp1BuiltinSet<NAME, "csil",
Expand Down Expand Up @@ -990,56 +990,6 @@ multiclass RVVPseudoVNCVTBuiltin<string IR, string MName, string type_range,
}
}

// Define vread_csr&vwrite_csr described in RVV intrinsics doc.
let HeaderCode =
[{
enum RVV_CSR {
RVV_VSTART = 0,
RVV_VXSAT,
RVV_VXRM,
RVV_VCSR,
};

static __inline__ __attribute__((__always_inline__, __nodebug__))
unsigned long __riscv_vread_csr(enum RVV_CSR __csr) {
unsigned long __rv = 0;
switch (__csr) {
case RVV_VSTART:
__asm__ __volatile__ ("csrr\t%0, vstart" : "=r"(__rv) : : "memory");
break;
case RVV_VXSAT:
__asm__ __volatile__ ("csrr\t%0, vxsat" : "=r"(__rv) : : "memory");
break;
case RVV_VXRM:
__asm__ __volatile__ ("csrr\t%0, vxrm" : "=r"(__rv) : : "memory");
break;
case RVV_VCSR:
__asm__ __volatile__ ("csrr\t%0, vcsr" : "=r"(__rv) : : "memory");
break;
}
return __rv;
}

static __inline__ __attribute__((__always_inline__, __nodebug__))
void __riscv_vwrite_csr(enum RVV_CSR __csr, unsigned long __value) {
switch (__csr) {
case RVV_VSTART:
__asm__ __volatile__ ("csrw\tvstart, %z0" : : "rJ"(__value) : "memory");
break;
case RVV_VXSAT:
__asm__ __volatile__ ("csrw\tvxsat, %z0" : : "rJ"(__value) : "memory");
break;
case RVV_VXRM:
__asm__ __volatile__ ("csrw\tvxrm, %z0" : : "rJ"(__value) : "memory");
break;
case RVV_VCSR:
__asm__ __volatile__ ("csrw\tvcsr, %z0" : : "rJ"(__value) : "memory");
break;
}
}
}] in
def vread_vwrite_csr: RVVHeader;

let HeaderCode =
[{
#define __riscv_vlenb() __builtin_rvv_vlenb()
Expand Down
29 changes: 16 additions & 13 deletions contrib/llvm-project/clang/include/clang/CodeGen/CGFunctionInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,10 @@ class CGFunctionInfo final
/// Whether this is a chain call.
unsigned ChainCall : 1;

/// Whether this function is called by forwarding arguments.
/// This doesn't support inalloca or varargs.
unsigned DelegateCall : 1;

/// Whether this function is a CMSE nonsecure call
unsigned CmseNSCall : 1;

Expand Down Expand Up @@ -616,14 +620,11 @@ class CGFunctionInfo final
CGFunctionInfo() : Required(RequiredArgs::All) {}

public:
static CGFunctionInfo *create(unsigned llvmCC,
bool instanceMethod,
bool chainCall,
const FunctionType::ExtInfo &extInfo,
ArrayRef<ExtParameterInfo> paramInfos,
CanQualType resultType,
ArrayRef<CanQualType> argTypes,
RequiredArgs required);
static CGFunctionInfo *
create(unsigned llvmCC, bool instanceMethod, bool chainCall,
bool delegateCall, const FunctionType::ExtInfo &extInfo,
ArrayRef<ExtParameterInfo> paramInfos, CanQualType resultType,
ArrayRef<CanQualType> argTypes, RequiredArgs required);
void operator delete(void *p) { ::operator delete(p); }

// Friending class TrailingObjects is apparently not good enough for MSVC,
Expand Down Expand Up @@ -663,6 +664,8 @@ class CGFunctionInfo final

bool isChainCall() const { return ChainCall; }

bool isDelegateCall() const { return DelegateCall; }

bool isCmseNSCall() const { return CmseNSCall; }

bool isNoReturn() const { return NoReturn; }
Expand Down Expand Up @@ -749,6 +752,7 @@ class CGFunctionInfo final
ID.AddInteger(getASTCallingConvention());
ID.AddBoolean(InstanceMethod);
ID.AddBoolean(ChainCall);
ID.AddBoolean(DelegateCall);
ID.AddBoolean(NoReturn);
ID.AddBoolean(ReturnsRetained);
ID.AddBoolean(NoCallerSavedRegs);
Expand All @@ -766,17 +770,16 @@ class CGFunctionInfo final
for (const auto &I : arguments())
I.type.Profile(ID);
}
static void Profile(llvm::FoldingSetNodeID &ID,
bool InstanceMethod,
bool ChainCall,
static void Profile(llvm::FoldingSetNodeID &ID, bool InstanceMethod,
bool ChainCall, bool IsDelegateCall,
const FunctionType::ExtInfo &info,
ArrayRef<ExtParameterInfo> paramInfos,
RequiredArgs required,
CanQualType resultType,
RequiredArgs required, CanQualType resultType,
ArrayRef<CanQualType> argTypes) {
ID.AddInteger(info.getCC());
ID.AddBoolean(InstanceMethod);
ID.AddBoolean(ChainCall);
ID.AddBoolean(IsDelegateCall);
ID.AddBoolean(info.getNoReturn());
ID.AddBoolean(info.getProducesResult());
ID.AddBoolean(info.getNoCallerSavedRegs());
Expand Down
14 changes: 9 additions & 5 deletions contrib/llvm-project/clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -2375,11 +2375,6 @@ def fthin_link_bitcode_EQ : Joined<["-"], "fthin-link-bitcode=">,
Flags<[CoreOption, CC1Option]>, Group<f_Group>,
HelpText<"Write minimized bitcode to <file> for the ThinLTO thin link only">,
MarshallingInfoString<CodeGenOpts<"ThinLinkBitcodeFile">>;
defm fat_lto_objects : BoolFOption<"fat-lto-objects",
CodeGenOpts<"FatLTO">, DefaultFalse,
PosFlag<SetTrue, [CC1Option], "Enable">,
NegFlag<SetFalse, [CC1Option], "Disable">,
BothFlags<[CC1Option], " fat LTO object support">>;
def fmacro_backtrace_limit_EQ : Joined<["-"], "fmacro-backtrace-limit=">,
Group<f_Group>, Flags<[NoXarchOption, CC1Option, CoreOption]>,
HelpText<"Set the maximum number of entries to print in a macro expansion backtrace (0 = no limit)">,
Expand Down Expand Up @@ -5097,6 +5092,10 @@ def mretpoline_external_thunk : Flag<["-"], "mretpoline-external-thunk">, Group<
def mno_retpoline_external_thunk : Flag<["-"], "mno-retpoline-external-thunk">, Group<m_x86_Features_Group>;
def mvzeroupper : Flag<["-"], "mvzeroupper">, Group<m_x86_Features_Group>;
def mno_vzeroupper : Flag<["-"], "mno-vzeroupper">, Group<m_x86_Features_Group>;
def mno_gather : Flag<["-"], "mno-gather">, Group<m_x86_Features_Group>,
HelpText<"Disable generation of gather instructions in auto-vectorization(x86 only)">;
def mno_scatter : Flag<["-"], "mno-scatter">, Group<m_x86_Features_Group>,
HelpText<"Disable generation of scatter instructions in auto-vectorization(x86 only)">;

// These are legacy user-facing driver-level option spellings. They are always
// aliases for options that are spelled using the more common Unix / GNU flag
Expand Down Expand Up @@ -5162,6 +5161,7 @@ defm caller_saves : BooleanFFlag<"caller-saves">, Group<clang_ignored_gcc_optimi
defm reorder_blocks : BooleanFFlag<"reorder-blocks">, Group<clang_ignored_gcc_optimization_f_Group>;
defm branch_count_reg : BooleanFFlag<"branch-count-reg">, Group<clang_ignored_gcc_optimization_f_Group>;
defm default_inline : BooleanFFlag<"default-inline">, Group<clang_ignored_gcc_optimization_f_Group>;
defm fat_lto_objects : BooleanFFlag<"fat-lto-objects">, Group<clang_ignored_gcc_optimization_f_Group>;
defm float_store : BooleanFFlag<"float-store">, Group<clang_ignored_gcc_optimization_f_Group>;
defm friend_injection : BooleanFFlag<"friend-injection">, Group<clang_ignored_f_Group>;
defm function_attribute_list : BooleanFFlag<"function-attribute-list">, Group<clang_ignored_f_Group>;
Expand Down Expand Up @@ -7152,6 +7152,10 @@ def _SLASH_QIntel_jcc_erratum : CLFlag<"QIntel-jcc-erratum">,
Alias<mbranches_within_32B_boundaries>;
def _SLASH_arm64EC : CLFlag<"arm64EC">,
HelpText<"Set build target to arm64ec">;
def : CLFlag<"Qgather-">, Alias<mno_gather>,
HelpText<"Disable generation of gather instructions in auto-vectorization(x86 only)">;
def : CLFlag<"Qscatter-">, Alias<mno_scatter>,
HelpText<"Disable generation of scatter instructions in auto-vectorization(x86 only)">;

// Non-aliases:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ class ToolChain {

// Return the DWARF version to emit, in the absence of arguments
// to the contrary.
virtual unsigned GetDefaultDwarfVersion() const { return 5; }
virtual unsigned GetDefaultDwarfVersion() const;

// Some toolchains may have different restrictions on the DWARF version and
// may need to adjust it. E.g. NVPTX may need to enforce DWARF2 even when host
Expand Down
2 changes: 0 additions & 2 deletions contrib/llvm-project/clang/include/clang/Sema/Sema.h
Original file line number Diff line number Diff line change
Expand Up @@ -12694,8 +12694,6 @@ class Sema final {
QualType CheckBitwiseOperands( // C99 6.5.[10...12]
ExprResult &LHS, ExprResult &RHS, SourceLocation Loc,
BinaryOperatorKind Opc);
void diagnoseLogicalInsteadOfBitwise(Expr *Op1, Expr *Op2, SourceLocation Loc,
BinaryOperatorKind Opc);
QualType CheckLogicalOperands( // C99 6.5.[13,14]
ExprResult &LHS, ExprResult &RHS, SourceLocation Loc,
BinaryOperatorKind Opc);
Expand Down
5 changes: 2 additions & 3 deletions contrib/llvm-project/clang/lib/AST/ASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9612,9 +9612,8 @@ bool ASTContext::areLaxCompatibleRVVTypes(QualType FirstType,
const LangOptions::LaxVectorConversionKind LVCKind =
getLangOpts().getLaxVectorConversions();

// If __riscv_v_fixed_vlen != N do not allow GNU vector lax conversion.
if (VecTy->getVectorKind() == VectorType::GenericVector &&
getTypeSize(SecondType) != getRVVTypeSize(*this, BT))
// If __riscv_v_fixed_vlen != N do not allow vector lax conversion.
if (getTypeSize(SecondType) != getRVVTypeSize(*this, BT))
return false;

// If -flax-vector-conversions=all is specified, the types are
Expand Down
27 changes: 10 additions & 17 deletions contrib/llvm-project/clang/lib/AST/ExprConstant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2418,9 +2418,16 @@ static bool CheckEvaluationResult(CheckEvaluationResultKind CERK,
if (const CXXRecordDecl *CD = dyn_cast<CXXRecordDecl>(RD)) {
unsigned BaseIndex = 0;
for (const CXXBaseSpecifier &BS : CD->bases()) {
if (!CheckEvaluationResult(CERK, Info, DiagLoc, BS.getType(),
Value.getStructBase(BaseIndex), Kind,
/*SubobjectDecl=*/nullptr, CheckedTemps))
const APValue &BaseValue = Value.getStructBase(BaseIndex);
if (!BaseValue.hasValue()) {
SourceLocation TypeBeginLoc = BS.getBaseTypeLoc();
Info.FFDiag(TypeBeginLoc, diag::note_constexpr_uninitialized_base)
<< BS.getType() << SourceRange(TypeBeginLoc, BS.getEndLoc());
return false;
}
if (!CheckEvaluationResult(CERK, Info, DiagLoc, BS.getType(), BaseValue,
Kind, /*SubobjectDecl=*/nullptr,
CheckedTemps))
return false;
++BaseIndex;
}
Expand Down Expand Up @@ -15218,14 +15225,6 @@ static bool FastEvaluateAsRValue(const Expr *Exp, Expr::EvalResult &Result,
return true;
}

// FIXME: Evaluating values of large array and record types can cause
// performance problems. Only do so in C++11 for now.
if (Exp->isPRValue() &&
(Exp->getType()->isArrayType() || Exp->getType()->isRecordType()) &&
!Ctx.getLangOpts().CPlusPlus11) {
IsConst = false;
return true;
}
return false;
}

Expand Down Expand Up @@ -15467,12 +15466,6 @@ bool Expr::EvaluateAsInitializer(APValue &Value, const ASTContext &Ctx,
return Name;
});

// FIXME: Evaluating initializers for large array and record types can cause
// performance problems. Only do so in C++11 for now.
if (isPRValue() && (getType()->isArrayType() || getType()->isRecordType()) &&
!Ctx.getLangOpts().CPlusPlus11)
return false;

Expr::EvalStatus EStatus;
EStatus.Diag = &Notes;

Expand Down
Loading

0 comments on commit 5e0f07d

Please sign in to comment.