mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-26 20:12:44 +00:00
Merge llvm-project release/19.x llvmorg-19.1.3-0-gab51eccf88f5
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvm-project release/19.x llvmorg-19.1.3-0-gab51eccf88f5, a.k.a. 19.1.3 release. PR: 280562 MFC after: 1 month
This commit is contained in:
commit
d686ce931c
@ -25,10 +25,12 @@
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
#include "llvm/ADT/iterator.h"
|
||||
#include "llvm/Support/PointerLikeTypeTraits.h"
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <iterator>
|
||||
#include <new>
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
|
||||
@ -326,29 +328,49 @@ struct LazyOffsetPtr {
|
||||
///
|
||||
/// If the low bit is clear, a pointer to the AST node. If the low
|
||||
/// bit is set, the upper 63 bits are the offset.
|
||||
mutable uint64_t Ptr = 0;
|
||||
static constexpr size_t DataSize = std::max(sizeof(uint64_t), sizeof(T *));
|
||||
alignas(uint64_t) alignas(T *) mutable unsigned char Data[DataSize] = {};
|
||||
|
||||
unsigned char GetLSB() const {
|
||||
return Data[llvm::sys::IsBigEndianHost ? DataSize - 1 : 0];
|
||||
}
|
||||
|
||||
template <typename U> U &As(bool New) const {
|
||||
unsigned char *Obj =
|
||||
Data + (llvm::sys::IsBigEndianHost ? DataSize - sizeof(U) : 0);
|
||||
if (New)
|
||||
return *new (Obj) U;
|
||||
return *std::launder(reinterpret_cast<U *>(Obj));
|
||||
}
|
||||
|
||||
T *&GetPtr() const { return As<T *>(false); }
|
||||
uint64_t &GetU64() const { return As<uint64_t>(false); }
|
||||
void SetPtr(T *Ptr) const { As<T *>(true) = Ptr; }
|
||||
void SetU64(uint64_t U64) const { As<uint64_t>(true) = U64; }
|
||||
|
||||
public:
|
||||
LazyOffsetPtr() = default;
|
||||
explicit LazyOffsetPtr(T *Ptr) : Ptr(reinterpret_cast<uint64_t>(Ptr)) {}
|
||||
explicit LazyOffsetPtr(T *Ptr) : Data() { SetPtr(Ptr); }
|
||||
|
||||
explicit LazyOffsetPtr(uint64_t Offset) : Ptr((Offset << 1) | 0x01) {
|
||||
explicit LazyOffsetPtr(uint64_t Offset) : Data() {
|
||||
assert((Offset << 1 >> 1) == Offset && "Offsets must require < 63 bits");
|
||||
if (Offset == 0)
|
||||
Ptr = 0;
|
||||
SetPtr(nullptr);
|
||||
else
|
||||
SetU64((Offset << 1) | 0x01);
|
||||
}
|
||||
|
||||
LazyOffsetPtr &operator=(T *Ptr) {
|
||||
this->Ptr = reinterpret_cast<uint64_t>(Ptr);
|
||||
SetPtr(Ptr);
|
||||
return *this;
|
||||
}
|
||||
|
||||
LazyOffsetPtr &operator=(uint64_t Offset) {
|
||||
assert((Offset << 1 >> 1) == Offset && "Offsets must require < 63 bits");
|
||||
if (Offset == 0)
|
||||
Ptr = 0;
|
||||
SetPtr(nullptr);
|
||||
else
|
||||
Ptr = (Offset << 1) | 0x01;
|
||||
SetU64((Offset << 1) | 0x01);
|
||||
|
||||
return *this;
|
||||
}
|
||||
@ -356,15 +378,15 @@ public:
|
||||
/// Whether this pointer is non-NULL.
|
||||
///
|
||||
/// This operation does not require the AST node to be deserialized.
|
||||
explicit operator bool() const { return Ptr != 0; }
|
||||
explicit operator bool() const { return isOffset() || GetPtr() != nullptr; }
|
||||
|
||||
/// Whether this pointer is non-NULL.
|
||||
///
|
||||
/// This operation does not require the AST node to be deserialized.
|
||||
bool isValid() const { return Ptr != 0; }
|
||||
bool isValid() const { return isOffset() || GetPtr() != nullptr; }
|
||||
|
||||
/// Whether this pointer is currently stored as an offset.
|
||||
bool isOffset() const { return Ptr & 0x01; }
|
||||
bool isOffset() const { return GetLSB() & 0x01; }
|
||||
|
||||
/// Retrieve the pointer to the AST node that this lazy pointer points to.
|
||||
///
|
||||
@ -375,9 +397,9 @@ public:
|
||||
if (isOffset()) {
|
||||
assert(Source &&
|
||||
"Cannot deserialize a lazy pointer without an AST source");
|
||||
Ptr = reinterpret_cast<uint64_t>((Source->*Get)(OffsT(Ptr >> 1)));
|
||||
SetPtr((Source->*Get)(OffsT(GetU64() >> 1)));
|
||||
}
|
||||
return reinterpret_cast<T*>(Ptr);
|
||||
return GetPtr();
|
||||
}
|
||||
|
||||
/// Retrieve the address of the AST node pointer. Deserializes the pointee if
|
||||
@ -385,7 +407,7 @@ public:
|
||||
T **getAddressOfPointer(ExternalASTSource *Source) const {
|
||||
// Ensure the integer is in pointer form.
|
||||
(void)get(Source);
|
||||
return reinterpret_cast<T**>(&Ptr);
|
||||
return &GetPtr();
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -311,7 +311,9 @@ ARMTargetInfo::ARMTargetInfo(const llvm::Triple &Triple,
|
||||
switch (Triple.getEnvironment()) {
|
||||
case llvm::Triple::Android:
|
||||
case llvm::Triple::GNUEABI:
|
||||
case llvm::Triple::GNUEABIT64:
|
||||
case llvm::Triple::GNUEABIHF:
|
||||
case llvm::Triple::GNUEABIHFT64:
|
||||
case llvm::Triple::MuslEABI:
|
||||
case llvm::Triple::MuslEABIHF:
|
||||
case llvm::Triple::OpenHOS:
|
||||
|
@ -337,6 +337,10 @@ protected:
|
||||
Builder.defineMacro("_GNU_SOURCE");
|
||||
if (this->HasFloat128)
|
||||
Builder.defineMacro("__FLOAT128__");
|
||||
if (Triple.isTime64ABI()) {
|
||||
Builder.defineMacro("_FILE_OFFSET_BITS", "64");
|
||||
Builder.defineMacro("_TIME_BITS", "64");
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
|
@ -1001,6 +1001,24 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr *E, unsigned Type,
|
||||
// Can't find the field referenced by the "counted_by" attribute.
|
||||
return nullptr;
|
||||
|
||||
if (isa<DeclRefExpr>(Base))
|
||||
// The whole struct is specificed in the __bdos. The calculation of the
|
||||
// whole size of the structure can be done in two ways:
|
||||
//
|
||||
// 1) sizeof(struct S) + count * sizeof(typeof(fam))
|
||||
// 2) offsetof(struct S, fam) + count * sizeof(typeof(fam))
|
||||
//
|
||||
// The first will add additional padding after the end of the array,
|
||||
// allocation while the second method is more precise, but not quite
|
||||
// expected from programmers. See
|
||||
// https://lore.kernel.org/lkml/ZvV6X5FPBBW7CO1f@archlinux/ for a
|
||||
// discussion of the topic.
|
||||
//
|
||||
// GCC isn't (currently) able to calculate __bdos on a pointer to the whole
|
||||
// structure. Therefore, because of the above issue, we'll choose to match
|
||||
// what GCC does for consistency's sake.
|
||||
return nullptr;
|
||||
|
||||
// Build a load of the counted_by field.
|
||||
bool IsSigned = CountedByFD->getType()->isSignedIntegerType();
|
||||
Value *CountedByInst = EmitCountedByFieldExpr(Base, FAMDecl, CountedByFD);
|
||||
@ -1031,32 +1049,9 @@ CodeGenFunction::emitFlexibleArrayMemberSize(const Expr *E, unsigned Type,
|
||||
CharUnits Size = Ctx.getTypeSizeInChars(ArrayTy->getElementType());
|
||||
llvm::Constant *ElemSize =
|
||||
llvm::ConstantInt::get(ResType, Size.getQuantity(), IsSigned);
|
||||
Value *FAMSize =
|
||||
Value *Res =
|
||||
Builder.CreateMul(CountedByInst, ElemSize, "", !IsSigned, IsSigned);
|
||||
FAMSize = Builder.CreateIntCast(FAMSize, ResType, IsSigned);
|
||||
Value *Res = FAMSize;
|
||||
|
||||
if (isa<DeclRefExpr>(Base)) {
|
||||
// The whole struct is specificed in the __bdos.
|
||||
const ASTRecordLayout &Layout = Ctx.getASTRecordLayout(OuterRD);
|
||||
|
||||
// Get the offset of the FAM.
|
||||
llvm::Constant *FAMOffset = ConstantInt::get(ResType, Offset, IsSigned);
|
||||
Value *OffsetAndFAMSize =
|
||||
Builder.CreateAdd(FAMOffset, Res, "", !IsSigned, IsSigned);
|
||||
|
||||
// Get the full size of the struct.
|
||||
llvm::Constant *SizeofStruct =
|
||||
ConstantInt::get(ResType, Layout.getSize().getQuantity(), IsSigned);
|
||||
|
||||
// max(sizeof(struct s),
|
||||
// offsetof(struct s, array) + p->count * sizeof(*p->array))
|
||||
Res = IsSigned
|
||||
? Builder.CreateBinaryIntrinsic(llvm::Intrinsic::smax,
|
||||
OffsetAndFAMSize, SizeofStruct)
|
||||
: Builder.CreateBinaryIntrinsic(llvm::Intrinsic::umax,
|
||||
OffsetAndFAMSize, SizeofStruct);
|
||||
}
|
||||
Res = Builder.CreateIntCast(Res, ResType, IsSigned);
|
||||
|
||||
// A negative \p IdxInst or \p CountedByInst means that the index lands
|
||||
// outside of the flexible array member. If that's the case, we want to
|
||||
|
@ -177,10 +177,7 @@ createTargetCodeGenInfo(CodeGenModule &CGM) {
|
||||
else if (ABIStr == "aapcs16")
|
||||
Kind = ARMABIKind::AAPCS16_VFP;
|
||||
else if (CodeGenOpts.FloatABI == "hard" ||
|
||||
(CodeGenOpts.FloatABI != "soft" &&
|
||||
(Triple.getEnvironment() == llvm::Triple::GNUEABIHF ||
|
||||
Triple.getEnvironment() == llvm::Triple::MuslEABIHF ||
|
||||
Triple.getEnvironment() == llvm::Triple::EABIHF)))
|
||||
(CodeGenOpts.FloatABI != "soft" && Triple.isHardFloatABI()))
|
||||
Kind = ARMABIKind::AAPCS_VFP;
|
||||
|
||||
return createARMTargetCodeGenInfo(CGM, Kind);
|
||||
@ -1137,6 +1134,11 @@ void CodeGenModule::Release() {
|
||||
CodeGenOpts.SanitizeCfiCanonicalJumpTables);
|
||||
}
|
||||
|
||||
if (CodeGenOpts.SanitizeCfiICallNormalizeIntegers) {
|
||||
getModule().addModuleFlag(llvm::Module::Override, "cfi-normalize-integers",
|
||||
1);
|
||||
}
|
||||
|
||||
if (LangOpts.Sanitize.has(SanitizerKind::KCFI)) {
|
||||
getModule().addModuleFlag(llvm::Module::Override, "kcfi", 1);
|
||||
// KCFI assumes patchable-function-prefix is the same for all indirectly
|
||||
|
@ -35,7 +35,9 @@ public:
|
||||
case llvm::Triple::EABI:
|
||||
case llvm::Triple::EABIHF:
|
||||
case llvm::Triple::GNUEABI:
|
||||
case llvm::Triple::GNUEABIT64:
|
||||
case llvm::Triple::GNUEABIHF:
|
||||
case llvm::Triple::GNUEABIHFT64:
|
||||
case llvm::Triple::MuslEABI:
|
||||
case llvm::Triple::MuslEABIHF:
|
||||
return true;
|
||||
@ -48,6 +50,7 @@ public:
|
||||
switch (getTarget().getTriple().getEnvironment()) {
|
||||
case llvm::Triple::EABIHF:
|
||||
case llvm::Triple::GNUEABIHF:
|
||||
case llvm::Triple::GNUEABIHFT64:
|
||||
case llvm::Triple::MuslEABIHF:
|
||||
return true;
|
||||
default:
|
||||
|
@ -602,7 +602,8 @@ static llvm::Triple computeTargetTriple(const Driver &D,
|
||||
if (A->getOption().matches(options::OPT_m64) ||
|
||||
A->getOption().matches(options::OPT_maix64)) {
|
||||
AT = Target.get64BitArchVariant().getArch();
|
||||
if (Target.getEnvironment() == llvm::Triple::GNUX32)
|
||||
if (Target.getEnvironment() == llvm::Triple::GNUX32 ||
|
||||
Target.getEnvironment() == llvm::Triple::GNUT64)
|
||||
Target.setEnvironment(llvm::Triple::GNU);
|
||||
else if (Target.getEnvironment() == llvm::Triple::MuslX32)
|
||||
Target.setEnvironment(llvm::Triple::Musl);
|
||||
@ -665,11 +666,13 @@ static llvm::Triple computeTargetTriple(const Driver &D,
|
||||
} else if (ABIName == "n32") {
|
||||
Target = Target.get64BitArchVariant();
|
||||
if (Target.getEnvironment() == llvm::Triple::GNU ||
|
||||
Target.getEnvironment() == llvm::Triple::GNUT64 ||
|
||||
Target.getEnvironment() == llvm::Triple::GNUABI64)
|
||||
Target.setEnvironment(llvm::Triple::GNUABIN32);
|
||||
} else if (ABIName == "64") {
|
||||
Target = Target.get64BitArchVariant();
|
||||
if (Target.getEnvironment() == llvm::Triple::GNU ||
|
||||
Target.getEnvironment() == llvm::Triple::GNUT64 ||
|
||||
Target.getEnvironment() == llvm::Triple::GNUABIN32)
|
||||
Target.setEnvironment(llvm::Triple::GNUABI64);
|
||||
}
|
||||
|
@ -327,6 +327,11 @@ void arm::setFloatABIInTriple(const Driver &D, const ArgList &Args,
|
||||
Triple.setEnvironment(isHardFloat ? llvm::Triple::GNUEABIHF
|
||||
: llvm::Triple::GNUEABI);
|
||||
break;
|
||||
case llvm::Triple::GNUEABIT64:
|
||||
case llvm::Triple::GNUEABIHFT64:
|
||||
Triple.setEnvironment(isHardFloat ? llvm::Triple::GNUEABIHFT64
|
||||
: llvm::Triple::GNUEABIT64);
|
||||
break;
|
||||
case llvm::Triple::EABI:
|
||||
case llvm::Triple::EABIHF:
|
||||
Triple.setEnvironment(isHardFloat ? llvm::Triple::EABIHF
|
||||
@ -414,10 +419,12 @@ arm::FloatABI arm::getDefaultFloatABI(const llvm::Triple &Triple) {
|
||||
return FloatABI::Soft;
|
||||
switch (Triple.getEnvironment()) {
|
||||
case llvm::Triple::GNUEABIHF:
|
||||
case llvm::Triple::GNUEABIHFT64:
|
||||
case llvm::Triple::MuslEABIHF:
|
||||
case llvm::Triple::EABIHF:
|
||||
return FloatABI::Hard;
|
||||
case llvm::Triple::GNUEABI:
|
||||
case llvm::Triple::GNUEABIT64:
|
||||
case llvm::Triple::MuslEABI:
|
||||
case llvm::Triple::EABI:
|
||||
// EABI is always AAPCS, and if it was not marked 'hard', it's softfp
|
||||
|
@ -2694,6 +2694,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
|
||||
case llvm::Triple::thumb:
|
||||
LibDirs.append(begin(ARMLibDirs), end(ARMLibDirs));
|
||||
if (TargetTriple.getEnvironment() == llvm::Triple::GNUEABIHF ||
|
||||
TargetTriple.getEnvironment() == llvm::Triple::GNUEABIHFT64 ||
|
||||
TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF ||
|
||||
TargetTriple.getEnvironment() == llvm::Triple::EABIHF) {
|
||||
TripleAliases.append(begin(ARMHFTriples), end(ARMHFTriples));
|
||||
@ -2705,6 +2706,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
|
||||
case llvm::Triple::thumbeb:
|
||||
LibDirs.append(begin(ARMebLibDirs), end(ARMebLibDirs));
|
||||
if (TargetTriple.getEnvironment() == llvm::Triple::GNUEABIHF ||
|
||||
TargetTriple.getEnvironment() == llvm::Triple::GNUEABIHFT64 ||
|
||||
TargetTriple.getEnvironment() == llvm::Triple::MuslEABIHF ||
|
||||
TargetTriple.getEnvironment() == llvm::Triple::EABIHF) {
|
||||
TripleAliases.append(begin(ARMebHFTriples), end(ARMebHFTriples));
|
||||
|
@ -508,6 +508,7 @@ std::string Linux::getDynamicLinker(const ArgList &Args) const {
|
||||
case llvm::Triple::thumbeb: {
|
||||
const bool HF =
|
||||
Triple.getEnvironment() == llvm::Triple::GNUEABIHF ||
|
||||
Triple.getEnvironment() == llvm::Triple::GNUEABIHFT64 ||
|
||||
tools::arm::getARMFloatABI(*this, Args) == tools::arm::FloatABI::Hard;
|
||||
|
||||
LibDir = "lib";
|
||||
|
@ -2500,6 +2500,11 @@ bool UnwrappedLineParser::parseBracedList(bool IsAngleBracket, bool IsEnum) {
|
||||
// Assume there are no blocks inside a braced init list apart
|
||||
// from the ones we explicitly parse out (like lambdas).
|
||||
FormatTok->setBlockKind(BK_BracedInit);
|
||||
if (!IsAngleBracket) {
|
||||
auto *Prev = FormatTok->Previous;
|
||||
if (Prev && Prev->is(tok::greater))
|
||||
Prev->setFinalizedType(TT_TemplateCloser);
|
||||
}
|
||||
nextToken();
|
||||
parseBracedList();
|
||||
break;
|
||||
|
@ -1508,10 +1508,13 @@ StmtResult Parser::ParseIfStatement(SourceLocation *TrailingElseLoc) {
|
||||
SourceLocation ConstevalLoc;
|
||||
|
||||
if (Tok.is(tok::kw_constexpr)) {
|
||||
Diag(Tok, getLangOpts().CPlusPlus17 ? diag::warn_cxx14_compat_constexpr_if
|
||||
: diag::ext_constexpr_if);
|
||||
IsConstexpr = true;
|
||||
ConsumeToken();
|
||||
// C23 supports constexpr keyword, but only for object definitions.
|
||||
if (getLangOpts().CPlusPlus) {
|
||||
Diag(Tok, getLangOpts().CPlusPlus17 ? diag::warn_cxx14_compat_constexpr_if
|
||||
: diag::ext_constexpr_if);
|
||||
IsConstexpr = true;
|
||||
ConsumeToken();
|
||||
}
|
||||
} else {
|
||||
if (Tok.is(tok::exclaim)) {
|
||||
NotLocation = ConsumeToken();
|
||||
|
@ -69,8 +69,8 @@ public:
|
||||
ExtractTypeForDeductionGuide(
|
||||
Sema &SemaRef,
|
||||
llvm::SmallVectorImpl<TypedefNameDecl *> &MaterializedTypedefs,
|
||||
ClassTemplateDecl *NestedPattern,
|
||||
const MultiLevelTemplateArgumentList *OuterInstantiationArgs)
|
||||
ClassTemplateDecl *NestedPattern = nullptr,
|
||||
const MultiLevelTemplateArgumentList *OuterInstantiationArgs = nullptr)
|
||||
: Base(SemaRef), MaterializedTypedefs(MaterializedTypedefs),
|
||||
NestedPattern(NestedPattern),
|
||||
OuterInstantiationArgs(OuterInstantiationArgs) {
|
||||
@ -1263,10 +1263,25 @@ FunctionTemplateDecl *DeclareAggregateDeductionGuideForTypeAlias(
|
||||
getRHSTemplateDeclAndArgs(SemaRef, AliasTemplate).first;
|
||||
if (!RHSTemplate)
|
||||
return nullptr;
|
||||
|
||||
llvm::SmallVector<TypedefNameDecl *> TypedefDecls;
|
||||
llvm::SmallVector<QualType> NewParamTypes;
|
||||
ExtractTypeForDeductionGuide TypeAliasTransformer(SemaRef, TypedefDecls);
|
||||
for (QualType P : ParamTypes) {
|
||||
QualType Type = TypeAliasTransformer.TransformType(P);
|
||||
if (Type.isNull())
|
||||
return nullptr;
|
||||
NewParamTypes.push_back(Type);
|
||||
}
|
||||
|
||||
auto *RHSDeductionGuide = SemaRef.DeclareAggregateDeductionGuideFromInitList(
|
||||
RHSTemplate, ParamTypes, Loc);
|
||||
RHSTemplate, NewParamTypes, Loc);
|
||||
if (!RHSDeductionGuide)
|
||||
return nullptr;
|
||||
|
||||
for (TypedefNameDecl *TD : TypedefDecls)
|
||||
TD->setDeclContext(RHSDeductionGuide->getTemplatedDecl());
|
||||
|
||||
return BuildDeductionGuideForTypeAlias(SemaRef, AliasTemplate,
|
||||
RHSDeductionGuide, Loc);
|
||||
}
|
||||
|
@ -2665,7 +2665,8 @@ void ASTDeclReader::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) {
|
||||
|
||||
D->setDeclaredWithTypename(Record.readInt());
|
||||
|
||||
if (D->hasTypeConstraint()) {
|
||||
const bool TypeConstraintInitialized = Record.readBool();
|
||||
if (TypeConstraintInitialized && D->hasTypeConstraint()) {
|
||||
ConceptReference *CR = nullptr;
|
||||
if (Record.readBool())
|
||||
CR = Record.readConceptReference();
|
||||
|
@ -1880,7 +1880,7 @@ void ASTDeclWriter::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) {
|
||||
Record.push_back(D->wasDeclaredWithTypename());
|
||||
|
||||
const TypeConstraint *TC = D->getTypeConstraint();
|
||||
assert((bool)TC == D->hasTypeConstraint());
|
||||
Record.push_back(/*TypeConstraintInitialized=*/TC != nullptr);
|
||||
if (TC) {
|
||||
auto *CR = TC->getConceptReference();
|
||||
Record.push_back(CR != nullptr);
|
||||
@ -1898,7 +1898,7 @@ void ASTDeclWriter::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) {
|
||||
if (OwnsDefaultArg)
|
||||
Record.AddTemplateArgumentLoc(D->getDefaultArgument());
|
||||
|
||||
if (!TC && !OwnsDefaultArg &&
|
||||
if (!D->hasTypeConstraint() && !OwnsDefaultArg &&
|
||||
D->getDeclContext() == D->getLexicalDeclContext() &&
|
||||
!D->isInvalidDecl() && !D->hasAttrs() &&
|
||||
!D->isTopLevelDeclInObjCContainer() && !D->isImplicit() &&
|
||||
@ -2561,6 +2561,7 @@ void ASTWriter::WriteDeclAbbrevs() {
|
||||
// TemplateTypeParmDecl
|
||||
Abv->Add(
|
||||
BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 1)); // wasDeclaredWithTypename
|
||||
Abv->Add(BitCodeAbbrevOp(0)); // TypeConstraintInitialized
|
||||
Abv->Add(BitCodeAbbrevOp(0)); // OwnsDefaultArg
|
||||
DeclTemplateTypeParmAbbrev = Stream.EmitAbbrev(std::move(Abv));
|
||||
|
||||
|
@ -11,6 +11,10 @@
|
||||
|
||||
// Before Solaris 11.4, <procfs.h> doesn't work in a largefile environment.
|
||||
#undef _FILE_OFFSET_BITS
|
||||
|
||||
// Avoid conflict between `_TIME_BITS` defined vs. `_FILE_OFFSET_BITS`
|
||||
// undefined in some Linux configurations.
|
||||
#undef _TIME_BITS
|
||||
#include "sanitizer_platform.h"
|
||||
#if SANITIZER_SOLARIS
|
||||
# include <fcntl.h>
|
||||
|
@ -27,7 +27,7 @@
|
||||
// _LIBCPP_VERSION represents the version of libc++, which matches the version of LLVM.
|
||||
// Given a LLVM release LLVM XX.YY.ZZ (e.g. LLVM 17.0.1 == 17.00.01), _LIBCPP_VERSION is
|
||||
// defined to XXYYZZ.
|
||||
# define _LIBCPP_VERSION 190102
|
||||
# define _LIBCPP_VERSION 190103
|
||||
|
||||
# define _LIBCPP_CONCAT_IMPL(_X, _Y) _X##_Y
|
||||
# define _LIBCPP_CONCAT(_X, _Y) _LIBCPP_CONCAT_IMPL(_X, _Y)
|
||||
|
@ -294,7 +294,11 @@ public:
|
||||
|
||||
PAuthTest,
|
||||
|
||||
LastEnvironmentType = PAuthTest
|
||||
GNUT64,
|
||||
GNUEABIT64,
|
||||
GNUEABIHFT64,
|
||||
|
||||
LastEnvironmentType = GNUEABIHFT64
|
||||
};
|
||||
enum ObjectFormatType {
|
||||
UnknownObjectFormat,
|
||||
@ -605,11 +609,12 @@ public:
|
||||
|
||||
bool isGNUEnvironment() const {
|
||||
EnvironmentType Env = getEnvironment();
|
||||
return Env == Triple::GNU || Env == Triple::GNUABIN32 ||
|
||||
Env == Triple::GNUABI64 || Env == Triple::GNUEABI ||
|
||||
Env == Triple::GNUEABIHF || Env == Triple::GNUF32 ||
|
||||
Env == Triple::GNUF64 || Env == Triple::GNUSF ||
|
||||
Env == Triple::GNUX32;
|
||||
return Env == Triple::GNU || Env == Triple::GNUT64 ||
|
||||
Env == Triple::GNUABIN32 || Env == Triple::GNUABI64 ||
|
||||
Env == Triple::GNUEABI || Env == Triple::GNUEABIT64 ||
|
||||
Env == Triple::GNUEABIHF || Env == Triple::GNUEABIHFT64 ||
|
||||
Env == Triple::GNUF32 || Env == Triple::GNUF64 ||
|
||||
Env == Triple::GNUSF || Env == Triple::GNUX32;
|
||||
}
|
||||
|
||||
/// Tests whether the OS is Haiku.
|
||||
@ -866,9 +871,11 @@ public:
|
||||
return (isARM() || isThumb()) &&
|
||||
(getEnvironment() == Triple::EABI ||
|
||||
getEnvironment() == Triple::GNUEABI ||
|
||||
getEnvironment() == Triple::GNUEABIT64 ||
|
||||
getEnvironment() == Triple::MuslEABI ||
|
||||
getEnvironment() == Triple::EABIHF ||
|
||||
getEnvironment() == Triple::GNUEABIHF ||
|
||||
getEnvironment() == Triple::GNUEABIHFT64 ||
|
||||
getEnvironment() == Triple::OpenHOS ||
|
||||
getEnvironment() == Triple::MuslEABIHF || isAndroid()) &&
|
||||
isOSBinFormatELF();
|
||||
@ -1046,6 +1053,22 @@ public:
|
||||
return getArch() == Triple::bpfel || getArch() == Triple::bpfeb;
|
||||
}
|
||||
|
||||
/// Tests if the target forces 64-bit time_t on a 32-bit architecture.
|
||||
bool isTime64ABI() const {
|
||||
EnvironmentType Env = getEnvironment();
|
||||
return Env == Triple::GNUT64 || Env == Triple::GNUEABIT64 ||
|
||||
Env == Triple::GNUEABIHFT64;
|
||||
}
|
||||
|
||||
/// Tests if the target forces hardfloat.
|
||||
bool isHardFloatABI() const {
|
||||
EnvironmentType Env = getEnvironment();
|
||||
return Env == llvm::Triple::GNUEABIHF ||
|
||||
Env == llvm::Triple::GNUEABIHFT64 ||
|
||||
Env == llvm::Triple::MuslEABIHF ||
|
||||
Env == llvm::Triple::EABIHF;
|
||||
}
|
||||
|
||||
/// Tests whether the target supports comdat
|
||||
bool supportsCOMDAT() const {
|
||||
return !(isOSBinFormatMachO() || isOSBinFormatXCOFF() ||
|
||||
|
@ -1784,8 +1784,8 @@ Constant *ConstantFoldFP(double (*NativeFP)(double), const APFloat &V,
|
||||
}
|
||||
|
||||
#if defined(HAS_IEE754_FLOAT128) && defined(HAS_LOGF128)
|
||||
Constant *ConstantFoldFP128(long double (*NativeFP)(long double),
|
||||
const APFloat &V, Type *Ty) {
|
||||
Constant *ConstantFoldFP128(float128 (*NativeFP)(float128), const APFloat &V,
|
||||
Type *Ty) {
|
||||
llvm_fenv_clearexcept();
|
||||
float128 Result = NativeFP(V.convertToQuad());
|
||||
if (llvm_fenv_testexcept()) {
|
||||
|
@ -325,7 +325,9 @@ public:
|
||||
}
|
||||
bool isTargetGNUAEABI() const {
|
||||
return (TargetTriple.getEnvironment() == Triple::GNUEABI ||
|
||||
TargetTriple.getEnvironment() == Triple::GNUEABIHF) &&
|
||||
TargetTriple.getEnvironment() == Triple::GNUEABIT64 ||
|
||||
TargetTriple.getEnvironment() == Triple::GNUEABIHF ||
|
||||
TargetTriple.getEnvironment() == Triple::GNUEABIHFT64) &&
|
||||
!isTargetDarwin() && !isTargetWindows();
|
||||
}
|
||||
bool isTargetMuslAEABI() const {
|
||||
|
@ -241,7 +241,9 @@ ARMBaseTargetMachine::ARMBaseTargetMachine(const Target &T, const Triple &TT,
|
||||
Options.EABIVersion == EABI::Unknown) {
|
||||
// musl is compatible with glibc with regard to EABI version
|
||||
if ((TargetTriple.getEnvironment() == Triple::GNUEABI ||
|
||||
TargetTriple.getEnvironment() == Triple::GNUEABIT64 ||
|
||||
TargetTriple.getEnvironment() == Triple::GNUEABIHF ||
|
||||
TargetTriple.getEnvironment() == Triple::GNUEABIHFT64 ||
|
||||
TargetTriple.getEnvironment() == Triple::MuslEABI ||
|
||||
TargetTriple.getEnvironment() == Triple::MuslEABIHF ||
|
||||
TargetTriple.getEnvironment() == Triple::OpenHOS) &&
|
||||
|
@ -64,6 +64,7 @@ public:
|
||||
|
||||
bool isTargetHardFloat() const {
|
||||
return TargetTriple.getEnvironment() == Triple::GNUEABIHF ||
|
||||
TargetTriple.getEnvironment() == Triple::GNUEABIHFT64 ||
|
||||
TargetTriple.getEnvironment() == Triple::MuslEABIHF ||
|
||||
TargetTriple.getEnvironment() == Triple::EABIHF ||
|
||||
(TargetTriple.isOSBinFormatMachO() &&
|
||||
|
@ -88,15 +88,15 @@ static void adjustBranch(unsigned Size, const MCFixup &Fixup, uint64_t &Value,
|
||||
/// Adjusts the value of a relative branch target before fixup application.
|
||||
static void adjustRelativeBranch(unsigned Size, const MCFixup &Fixup,
|
||||
uint64_t &Value, MCContext *Ctx = nullptr) {
|
||||
// Jumps are relative to the current instruction.
|
||||
Value -= 2;
|
||||
|
||||
// We have one extra bit of precision because the value is rightshifted by
|
||||
// one.
|
||||
signed_width(Size + 1, Value, std::string("branch target"), Fixup, Ctx);
|
||||
|
||||
// Rightshifts the value by one.
|
||||
AVR::fixups::adjustBranchTarget(Value);
|
||||
|
||||
// Jumps are relative to the current instruction.
|
||||
Value -= 1;
|
||||
}
|
||||
|
||||
/// 22-bit absolute fixup.
|
||||
|
@ -202,8 +202,7 @@ public:
|
||||
bool runOnModule(Module &M) override {
|
||||
FeatureBitset Features = coalesceFeatures(M);
|
||||
|
||||
std::string FeatureStr =
|
||||
getFeatureString(Features, WasmTM->getTargetFeatureString());
|
||||
std::string FeatureStr = getFeatureString(Features);
|
||||
WasmTM->setTargetFeatureString(FeatureStr);
|
||||
for (auto &F : M)
|
||||
replaceFeatures(F, FeatureStr);
|
||||
@ -241,17 +240,14 @@ private:
|
||||
return Features;
|
||||
}
|
||||
|
||||
static std::string getFeatureString(const FeatureBitset &Features,
|
||||
StringRef TargetFS) {
|
||||
static std::string getFeatureString(const FeatureBitset &Features) {
|
||||
std::string Ret;
|
||||
for (const SubtargetFeatureKV &KV : WebAssemblyFeatureKV) {
|
||||
if (Features[KV.Value])
|
||||
Ret += (StringRef("+") + KV.Key + ",").str();
|
||||
else
|
||||
Ret += (StringRef("-") + KV.Key + ",").str();
|
||||
}
|
||||
SubtargetFeatures TF{TargetFS};
|
||||
for (std::string const &F : TF.getFeatures())
|
||||
if (!SubtargetFeatures::isEnabled(F))
|
||||
Ret += F + ",";
|
||||
return Ret;
|
||||
}
|
||||
|
||||
|
@ -554,7 +554,9 @@ StringRef ARM::computeDefaultTargetABI(const Triple &TT, StringRef CPU) {
|
||||
switch (TT.getEnvironment()) {
|
||||
case Triple::Android:
|
||||
case Triple::GNUEABI:
|
||||
case Triple::GNUEABIT64:
|
||||
case Triple::GNUEABIHF:
|
||||
case Triple::GNUEABIHFT64:
|
||||
case Triple::MuslEABI:
|
||||
case Triple::MuslEABIHF:
|
||||
case Triple::OpenHOS:
|
||||
@ -635,6 +637,7 @@ StringRef ARM::getARMCPUForArch(const llvm::Triple &Triple, StringRef MArch) {
|
||||
switch (Triple.getEnvironment()) {
|
||||
case llvm::Triple::EABIHF:
|
||||
case llvm::Triple::GNUEABIHF:
|
||||
case llvm::Triple::GNUEABIHFT64:
|
||||
case llvm::Triple::MuslEABIHF:
|
||||
return "arm1176jzf-s";
|
||||
default:
|
||||
|
@ -317,10 +317,13 @@ StringRef Triple::getEnvironmentTypeName(EnvironmentType Kind) {
|
||||
case EABI: return "eabi";
|
||||
case EABIHF: return "eabihf";
|
||||
case GNU: return "gnu";
|
||||
case GNUT64: return "gnut64";
|
||||
case GNUABI64: return "gnuabi64";
|
||||
case GNUABIN32: return "gnuabin32";
|
||||
case GNUEABI: return "gnueabi";
|
||||
case GNUEABIT64: return "gnueabit64";
|
||||
case GNUEABIHF: return "gnueabihf";
|
||||
case GNUEABIHFT64: return "gnueabihft64";
|
||||
case GNUF32: return "gnuf32";
|
||||
case GNUF64: return "gnuf64";
|
||||
case GNUSF: return "gnusf";
|
||||
@ -693,7 +696,9 @@ static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) {
|
||||
.StartsWith("eabi", Triple::EABI)
|
||||
.StartsWith("gnuabin32", Triple::GNUABIN32)
|
||||
.StartsWith("gnuabi64", Triple::GNUABI64)
|
||||
.StartsWith("gnueabihft64", Triple::GNUEABIHFT64)
|
||||
.StartsWith("gnueabihf", Triple::GNUEABIHF)
|
||||
.StartsWith("gnueabit64", Triple::GNUEABIT64)
|
||||
.StartsWith("gnueabi", Triple::GNUEABI)
|
||||
.StartsWith("gnuf32", Triple::GNUF32)
|
||||
.StartsWith("gnuf64", Triple::GNUF64)
|
||||
@ -701,6 +706,7 @@ static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) {
|
||||
.StartsWith("gnux32", Triple::GNUX32)
|
||||
.StartsWith("gnu_ilp32", Triple::GNUILP32)
|
||||
.StartsWith("code16", Triple::CODE16)
|
||||
.StartsWith("gnut64", Triple::GNUT64)
|
||||
.StartsWith("gnu", Triple::GNU)
|
||||
.StartsWith("android", Triple::Android)
|
||||
.StartsWith("musleabihf", Triple::MuslEABIHF)
|
||||
|
@ -1395,7 +1395,7 @@ static void AddParamAndFnBasicAttributes(const CallBase &CB,
|
||||
if (!Arg)
|
||||
continue;
|
||||
|
||||
if (AL.hasParamAttr(I, Attribute::ByVal))
|
||||
if (NewInnerCB->paramHasAttr(I, Attribute::ByVal))
|
||||
// It's unsound to propagate memory attributes to byval arguments.
|
||||
// Even if CalledFunction doesn't e.g. write to the argument,
|
||||
// the call to NewInnerCB may write to its by-value copy.
|
||||
|
@ -161,11 +161,13 @@ void llvm::setKCFIType(Module &M, Function &F, StringRef MangledType) {
|
||||
// Matches CodeGenModule::CreateKCFITypeId in Clang.
|
||||
LLVMContext &Ctx = M.getContext();
|
||||
MDBuilder MDB(Ctx);
|
||||
F.setMetadata(
|
||||
LLVMContext::MD_kcfi_type,
|
||||
MDNode::get(Ctx, MDB.createConstant(ConstantInt::get(
|
||||
Type::getInt32Ty(Ctx),
|
||||
static_cast<uint32_t>(xxHash64(MangledType))))));
|
||||
std::string Type = MangledType.str();
|
||||
if (M.getModuleFlag("cfi-normalize-integers"))
|
||||
Type += ".normalized";
|
||||
F.setMetadata(LLVMContext::MD_kcfi_type,
|
||||
MDNode::get(Ctx, MDB.createConstant(ConstantInt::get(
|
||||
Type::getInt32Ty(Ctx),
|
||||
static_cast<uint32_t>(xxHash64(Type))))));
|
||||
// If the module was compiled with -fpatchable-function-entry, ensure
|
||||
// we use the same patchable-function-prefix.
|
||||
if (auto *MD = mdconst::extract_or_null<ConstantInt>(
|
||||
|
@ -1,8 +1,8 @@
|
||||
#define LLVM_REVISION "llvmorg-19.1.2-0-g7ba7d8e2f7b6"
|
||||
#define LLVM_REVISION "llvmorg-19.1.3-0-gab51eccf88f5"
|
||||
#define LLVM_REPOSITORY "https://github.com/llvm/llvm-project.git"
|
||||
|
||||
#define CLANG_REVISION "llvmorg-19.1.2-0-g7ba7d8e2f7b6"
|
||||
#define CLANG_REVISION "llvmorg-19.1.3-0-gab51eccf88f5"
|
||||
#define CLANG_REPOSITORY "https://github.com/llvm/llvm-project.git"
|
||||
|
||||
#define LLDB_REVISION "llvmorg-19.1.2-0-g7ba7d8e2f7b6"
|
||||
#define LLDB_REVISION "llvmorg-19.1.3-0-gab51eccf88f5"
|
||||
#define LLDB_REPOSITORY "https://github.com/llvm/llvm-project.git"
|
||||
|
@ -1,8 +1,8 @@
|
||||
#define CLANG_VERSION 19.1.2
|
||||
#define CLANG_VERSION_STRING "19.1.2"
|
||||
#define CLANG_VERSION 19.1.3
|
||||
#define CLANG_VERSION_STRING "19.1.3"
|
||||
#define CLANG_VERSION_MAJOR 19
|
||||
#define CLANG_VERSION_MAJOR_STRING "19"
|
||||
#define CLANG_VERSION_MINOR 1
|
||||
#define CLANG_VERSION_PATCHLEVEL 2
|
||||
#define CLANG_VERSION_PATCHLEVEL 3
|
||||
|
||||
#define CLANG_VENDOR "FreeBSD "
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Local identifier in __FreeBSD_version style
|
||||
#define LLD_FREEBSD_VERSION 1500001
|
||||
|
||||
#define LLD_VERSION_STRING "19.1.2 (FreeBSD llvmorg-19.1.2-0-g7ba7d8e2f7b6-" __XSTRING(LLD_FREEBSD_VERSION) ")"
|
||||
#define LLD_VERSION_STRING "19.1.3 (FreeBSD llvmorg-19.1.3-0-gab51eccf88f5-" __XSTRING(LLD_FREEBSD_VERSION) ")"
|
||||
|
@ -1,6 +1,6 @@
|
||||
#define LLDB_VERSION 19.1.2
|
||||
#define LLDB_VERSION_STRING "19.1.2"
|
||||
#define LLDB_VERSION 19.1.3
|
||||
#define LLDB_VERSION_STRING "19.1.3"
|
||||
#define LLDB_VERSION_MAJOR 19
|
||||
#define LLDB_VERSION_MINOR 1
|
||||
#define LLDB_VERSION_PATCH 2
|
||||
#define LLDB_VERSION_PATCH 3
|
||||
/* #undef LLDB_FULL_VERSION_STRING */
|
||||
|
@ -338,10 +338,10 @@
|
||||
#define PACKAGE_NAME "LLVM"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "LLVM 19.1.2"
|
||||
#define PACKAGE_STRING "LLVM 19.1.3"
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "19.1.2"
|
||||
#define PACKAGE_VERSION "19.1.3"
|
||||
|
||||
/* Define to the vendor of this package. */
|
||||
/* #undef PACKAGE_VENDOR */
|
||||
|
@ -176,10 +176,10 @@
|
||||
#define LLVM_VERSION_MINOR 1
|
||||
|
||||
/* Patch version of the LLVM API */
|
||||
#define LLVM_VERSION_PATCH 2
|
||||
#define LLVM_VERSION_PATCH 3
|
||||
|
||||
/* LLVM version string */
|
||||
#define LLVM_VERSION_STRING "19.1.2"
|
||||
#define LLVM_VERSION_STRING "19.1.3"
|
||||
|
||||
/* Whether LLVM records statistics for use with GetStatistics(),
|
||||
* PrintStatistics() or PrintStatisticsJSON()
|
||||
|
@ -1,2 +1,2 @@
|
||||
#define LLVM_REVISION "llvmorg-19.1.2-0-g7ba7d8e2f7b6"
|
||||
#define LLVM_REVISION "llvmorg-19.1.3-0-gab51eccf88f5"
|
||||
#define LLVM_REPOSITORY "https://github.com/llvm/llvm-project.git"
|
||||
|
@ -26,7 +26,8 @@
|
||||
# if __has_builtin(__builtin_verbose_trap)
|
||||
// AppleClang shipped a slightly different version of __builtin_verbose_trap from the upstream
|
||||
// version before upstream Clang actually got the builtin.
|
||||
# if defined(_LIBCPP_APPLE_CLANG_VER) && _LIBCPP_APPLE_CLANG_VER < 17000
|
||||
// TODO: Remove once AppleClang supports the two-arguments version of the builtin.
|
||||
# if defined(_LIBCPP_APPLE_CLANG_VER) && _LIBCPP_APPLE_CLANG_VER < 1700
|
||||
# define _LIBCPP_ASSERTION_HANDLER(message) __builtin_verbose_trap(message)
|
||||
# else
|
||||
# define _LIBCPP_ASSERTION_HANDLER(message) __builtin_verbose_trap("libc++", message)
|
||||
|
@ -148,7 +148,7 @@
|
||||
#define ENABLE_LIBOMPTARGET OPENMP_ENABLE_LIBOMPTARGET
|
||||
|
||||
// Configured cache line based on architecture
|
||||
#if KMP_ARCH_PPC64
|
||||
#if KMP_ARCH_PPC64 || KMP_ARCH_PPC
|
||||
# define CACHE_LINE 128
|
||||
#elif KMP_ARCH_AARCH64_A64FX
|
||||
# define CACHE_LINE 256
|
||||
|
Loading…
Reference in New Issue
Block a user