mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-06 16:40:47 +00:00
Merge llvm-project release/17.x llvmorg-17.0.3-0-g888437e1b600
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-17.0.3-0-g888437e1b600. PR: 273753 MFC after: 1 month
This commit is contained in:
commit
bdb86d1a85
|
@ -699,6 +699,8 @@ void toolchains::MinGW::addClangTargetOptions(
|
|||
}
|
||||
}
|
||||
|
||||
CC1Args.push_back("-fno-use-init-array");
|
||||
|
||||
for (auto Opt : {options::OPT_mthreads, options::OPT_mwindows,
|
||||
options::OPT_mconsole, options::OPT_mdll}) {
|
||||
if (Arg *A = DriverArgs.getLastArgNoClaim(Opt))
|
||||
|
|
|
@ -173,10 +173,12 @@ void UnwrappedLineParser::reset() {
|
|||
CommentsBeforeNextToken.clear();
|
||||
FormatTok = nullptr;
|
||||
MustBreakBeforeNextToken = false;
|
||||
IsDecltypeAutoFunction = false;
|
||||
PreprocessorDirectives.clear();
|
||||
CurrentLines = &Lines;
|
||||
DeclarationScopeStack.clear();
|
||||
NestedTooDeep.clear();
|
||||
NestedLambdas.clear();
|
||||
PPStack.clear();
|
||||
Line->FirstStartColumn = FirstStartColumn;
|
||||
|
||||
|
@ -1757,6 +1759,17 @@ void UnwrappedLineParser::parseStructuralElement(
|
|||
if (parseStructLike())
|
||||
return;
|
||||
break;
|
||||
case tok::kw_decltype:
|
||||
nextToken();
|
||||
if (FormatTok->is(tok::l_paren)) {
|
||||
parseParens();
|
||||
assert(FormatTok->Previous);
|
||||
if (FormatTok->Previous->endsSequence(tok::r_paren, tok::kw_auto,
|
||||
tok::l_paren)) {
|
||||
Line->SeenDecltypeAuto = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case tok::period:
|
||||
nextToken();
|
||||
// In Java, classes have an implicit static member "class".
|
||||
|
@ -1818,6 +1831,7 @@ void UnwrappedLineParser::parseStructuralElement(
|
|||
if (NextLBracesType != TT_Unknown)
|
||||
FormatTok->setFinalizedType(NextLBracesType);
|
||||
if (!tryToParsePropertyAccessor() && !tryToParseBracedList()) {
|
||||
IsDecltypeAutoFunction = Line->SeenDecltypeAuto;
|
||||
// A block outside of parentheses must be the last part of a
|
||||
// structural element.
|
||||
// FIXME: Figure out cases where this is not true, and add projections
|
||||
|
@ -1835,6 +1849,7 @@ void UnwrappedLineParser::parseStructuralElement(
|
|||
}
|
||||
FormatTok->setFinalizedType(TT_FunctionLBrace);
|
||||
parseBlock();
|
||||
IsDecltypeAutoFunction = false;
|
||||
addUnwrappedLine();
|
||||
return;
|
||||
}
|
||||
|
@ -2249,9 +2264,15 @@ bool UnwrappedLineParser::tryToParseLambda() {
|
|||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
FormatTok->setFinalizedType(TT_LambdaLBrace);
|
||||
LSquare.setFinalizedType(TT_LambdaLSquare);
|
||||
|
||||
NestedLambdas.push_back(Line->SeenDecltypeAuto);
|
||||
parseChildBlock();
|
||||
assert(!NestedLambdas.empty());
|
||||
NestedLambdas.pop_back();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -2471,6 +2492,8 @@ bool UnwrappedLineParser::parseParens(TokenType AmpAmpTokenType) {
|
|||
PrevPrev->endsSequence(tok::kw_constexpr, tok::kw_if))));
|
||||
const bool ReturnParens =
|
||||
Style.RemoveParentheses == FormatStyle::RPS_ReturnStatement &&
|
||||
((NestedLambdas.empty() && !IsDecltypeAutoFunction) ||
|
||||
(!NestedLambdas.empty() && !NestedLambdas.back())) &&
|
||||
Prev && Prev->isOneOf(tok::kw_return, tok::kw_co_return) && Next &&
|
||||
Next->is(tok::semi);
|
||||
if ((DoubleParens && !Blacklisted) || ReturnParens) {
|
||||
|
@ -4386,6 +4409,7 @@ void UnwrappedLineParser::addUnwrappedLine(LineLevel AdjustLevel) {
|
|||
Line->MatchingOpeningBlockLineIndex = UnwrappedLine::kInvalidIndex;
|
||||
Line->FirstStartColumn = 0;
|
||||
Line->IsContinuation = false;
|
||||
Line->SeenDecltypeAuto = false;
|
||||
|
||||
if (ClosesWhitesmithsBlock && AdjustLevel == LineLevel::Remove)
|
||||
--Line->Level;
|
||||
|
|
|
@ -61,6 +61,9 @@ struct UnwrappedLine {
|
|||
|
||||
bool MustBeDeclaration;
|
||||
|
||||
/// Whether the parser has seen \c decltype(auto) in this line.
|
||||
bool SeenDecltypeAuto = false;
|
||||
|
||||
/// \c True if this line should be indented by ContinuationIndent in
|
||||
/// addition to the normal indention level.
|
||||
bool IsContinuation = false;
|
||||
|
@ -341,6 +344,14 @@ class UnwrappedLineParser {
|
|||
// statement contains more than some predefined number of nested statements).
|
||||
SmallVector<bool, 8> NestedTooDeep;
|
||||
|
||||
// Keeps a stack of the states of nested lambdas (true if the return type of
|
||||
// the lambda is `decltype(auto)`).
|
||||
SmallVector<bool, 4> NestedLambdas;
|
||||
|
||||
// Whether the parser is parsing the body of a function whose return type is
|
||||
// `decltype(auto)`.
|
||||
bool IsDecltypeAutoFunction = false;
|
||||
|
||||
// Represents preprocessor branch type, so we can find matching
|
||||
// #if/#else/#endif directives.
|
||||
enum PPBranchKind {
|
||||
|
|
|
@ -11166,12 +11166,15 @@ CheckPrintfHandler::checkFormatExpr(const analyze_printf::PrintfSpecifier &FS,
|
|||
ImplicitMatch == ArgType::NoMatchTypeConfusion)
|
||||
Match = ImplicitMatch;
|
||||
assert(Match != ArgType::MatchPromotion);
|
||||
|
||||
// Look through unscoped enums to their underlying type.
|
||||
bool IsEnum = false;
|
||||
bool IsScopedEnum = false;
|
||||
QualType IntendedTy = ExprTy;
|
||||
if (auto EnumTy = ExprTy->getAs<EnumType>()) {
|
||||
IntendedTy = EnumTy->getDecl()->getIntegerType();
|
||||
if (EnumTy->isUnscopedEnumerationType()) {
|
||||
ExprTy = EnumTy->getDecl()->getIntegerType();
|
||||
ExprTy = IntendedTy;
|
||||
// This controls whether we're talking about the underlying type or not,
|
||||
// which we only want to do when it's an unscoped enum.
|
||||
IsEnum = true;
|
||||
|
@ -11183,7 +11186,6 @@ CheckPrintfHandler::checkFormatExpr(const analyze_printf::PrintfSpecifier &FS,
|
|||
// %C in an Objective-C context prints a unichar, not a wchar_t.
|
||||
// If the argument is an integer of some kind, believe the %C and suggest
|
||||
// a cast instead of changing the conversion specifier.
|
||||
QualType IntendedTy = ExprTy;
|
||||
if (isObjCContext() &&
|
||||
FS.getConversionSpecifier().getKind() == ConversionSpecifier::CArg) {
|
||||
if (ExprTy->isIntegralOrUnscopedEnumerationType() &&
|
||||
|
@ -11219,8 +11221,10 @@ CheckPrintfHandler::checkFormatExpr(const analyze_printf::PrintfSpecifier &FS,
|
|||
std::tie(CastTy, CastTyName) = shouldNotPrintDirectly(S.Context, IntendedTy, E);
|
||||
if (!CastTy.isNull()) {
|
||||
// %zi/%zu and %td/%tu are OK to use for NSInteger/NSUInteger of type int
|
||||
// (long in ASTContext). Only complain to pedants.
|
||||
if ((CastTyName == "NSInteger" || CastTyName == "NSUInteger") &&
|
||||
// (long in ASTContext). Only complain to pedants or when they're the
|
||||
// underlying type of a scoped enum (which always needs a cast).
|
||||
if (!IsScopedEnum &&
|
||||
(CastTyName == "NSInteger" || CastTyName == "NSUInteger") &&
|
||||
(AT.isSizeT() || AT.isPtrdiffT()) &&
|
||||
AT.matchesType(S.Context, CastTy))
|
||||
Match = ArgType::NoMatchPedantic;
|
||||
|
@ -11275,20 +11279,15 @@ CheckPrintfHandler::checkFormatExpr(const analyze_printf::PrintfSpecifier &FS,
|
|||
// should be printed as 'long' for 64-bit compatibility.)
|
||||
// Rather than emitting a normal format/argument mismatch, we want to
|
||||
// add a cast to the recommended type (and correct the format string
|
||||
// if necessary).
|
||||
// if necessary). We should also do so for scoped enumerations.
|
||||
SmallString<16> CastBuf;
|
||||
llvm::raw_svector_ostream CastFix(CastBuf);
|
||||
CastFix << (S.LangOpts.CPlusPlus ? "static_cast<" : "(");
|
||||
if (IsScopedEnum) {
|
||||
CastFix << AT.getRepresentativeType(S.Context).getAsString(
|
||||
S.Context.getPrintingPolicy());
|
||||
} else {
|
||||
IntendedTy.print(CastFix, S.Context.getPrintingPolicy());
|
||||
}
|
||||
IntendedTy.print(CastFix, S.Context.getPrintingPolicy());
|
||||
CastFix << (S.LangOpts.CPlusPlus ? ">" : ")");
|
||||
|
||||
SmallVector<FixItHint,4> Hints;
|
||||
if ((!AT.matchesType(S.Context, IntendedTy) && !IsScopedEnum) ||
|
||||
if (AT.matchesType(S.Context, IntendedTy) != ArgType::Match ||
|
||||
ShouldNotPrintDirectly)
|
||||
Hints.push_back(FixItHint::CreateReplacement(SpecRange, os.str()));
|
||||
|
||||
|
@ -11316,7 +11315,7 @@ CheckPrintfHandler::checkFormatExpr(const analyze_printf::PrintfSpecifier &FS,
|
|||
Hints.push_back(FixItHint::CreateInsertion(After, ")"));
|
||||
}
|
||||
|
||||
if (ShouldNotPrintDirectly) {
|
||||
if (ShouldNotPrintDirectly && !IsScopedEnum) {
|
||||
// The expression has a type that should not be printed directly.
|
||||
// We extract the name from the typedef because we don't want to show
|
||||
// the underlying type in the diagnostic.
|
||||
|
|
|
@ -2639,7 +2639,8 @@ static void emitAttributes(RecordKeeper &Records, raw_ostream &OS,
|
|||
OS << ", ";
|
||||
emitFormInitializer(OS, Spellings[0], "0");
|
||||
} else {
|
||||
OS << ", (\n";
|
||||
OS << ", [&]() {\n";
|
||||
OS << " switch (S) {\n";
|
||||
std::set<std::string> Uniques;
|
||||
unsigned Idx = 0;
|
||||
for (auto I = Spellings.begin(), E = Spellings.end(); I != E;
|
||||
|
@ -2647,15 +2648,19 @@ static void emitAttributes(RecordKeeper &Records, raw_ostream &OS,
|
|||
const FlattenedSpelling &S = *I;
|
||||
const auto &Name = SemanticToSyntacticMap[Idx];
|
||||
if (Uniques.insert(Name).second) {
|
||||
OS << " S == " << Name << " ? AttributeCommonInfo::Form";
|
||||
OS << " case " << Name << ":\n";
|
||||
OS << " return AttributeCommonInfo::Form";
|
||||
emitFormInitializer(OS, S, Name);
|
||||
OS << " :\n";
|
||||
OS << ";\n";
|
||||
}
|
||||
}
|
||||
OS << " (llvm_unreachable(\"Unknown attribute spelling!\"), "
|
||||
<< " AttributeCommonInfo::Form";
|
||||
OS << " default:\n";
|
||||
OS << " llvm_unreachable(\"Unknown attribute spelling!\");\n"
|
||||
<< " return AttributeCommonInfo::Form";
|
||||
emitFormInitializer(OS, Spellings[0], "0");
|
||||
OS << "))";
|
||||
OS << ";\n"
|
||||
<< " }\n"
|
||||
<< " }()";
|
||||
}
|
||||
|
||||
OS << ");\n";
|
||||
|
|
|
@ -40,7 +40,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 170002
|
||||
# define _LIBCPP_VERSION 170003
|
||||
|
||||
# define _LIBCPP_CONCAT_IMPL(_X, _Y) _X##_Y
|
||||
# define _LIBCPP_CONCAT(_X, _Y) _LIBCPP_CONCAT_IMPL(_X, _Y)
|
||||
|
|
|
@ -661,6 +661,8 @@ std::optional<Symbol *> ObjFile::createDefined(
|
|||
if (prevailing) {
|
||||
SectionChunk *c = readSection(sectionNumber, def, getName());
|
||||
sparseChunks[sectionNumber] = c;
|
||||
if (!c)
|
||||
return nullptr;
|
||||
c->sym = cast<DefinedRegular>(leader);
|
||||
c->selection = selection;
|
||||
cast<DefinedRegular>(leader)->data = &c->repl;
|
||||
|
|
|
@ -804,7 +804,7 @@ void LazyValueInfoImpl::intersectAssumeOrGuardBlockValueConstantRange(
|
|||
|
||||
static ConstantRange getConstantRangeOrFull(const ValueLatticeElement &Val,
|
||||
Type *Ty, const DataLayout &DL) {
|
||||
if (Val.isConstantRange())
|
||||
if (Val.isConstantRange(/*UndefAllowed*/ false))
|
||||
return Val.getConstantRange();
|
||||
return ConstantRange::getFull(DL.getTypeSizeInBits(Ty));
|
||||
}
|
||||
|
|
|
@ -1402,6 +1402,9 @@ static void ARM64EmitUnwindInfo(MCStreamer &streamer, WinEH::FrameInfo *info,
|
|||
// here, but we'd have to emit the pdata, the xdata header, and the
|
||||
// epilogue scopes later, since they depend on whether the we need to
|
||||
// split the unwind data.
|
||||
//
|
||||
// If this is fixed, remove code in AArch64ISelLowering.cpp that
|
||||
// disables loop alignment on Windows.
|
||||
RawFuncLength = GetAbsDifference(streamer, info->FuncletOrFuncEnd,
|
||||
info->Begin);
|
||||
}
|
||||
|
|
|
@ -1033,7 +1033,12 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM,
|
|||
// Set required alignment.
|
||||
setMinFunctionAlignment(Align(4));
|
||||
// Set preferred alignments.
|
||||
setPrefLoopAlignment(STI.getPrefLoopAlignment());
|
||||
|
||||
// Don't align loops on Windows. The SEH unwind info generation needs to
|
||||
// know the exact length of functions before the alignments have been
|
||||
// expanded.
|
||||
if (!Subtarget->isTargetWindows())
|
||||
setPrefLoopAlignment(STI.getPrefLoopAlignment());
|
||||
setMaxBytesForAlignment(STI.getMaxBytesForLoopAlignment());
|
||||
setPrefFunctionAlignment(STI.getPrefFunctionAlignment());
|
||||
|
||||
|
|
|
@ -15527,7 +15527,7 @@ SDValue PPCTargetLowering::PerformDAGCombine(SDNode *N,
|
|||
break;
|
||||
SDValue ConstOp = DAG.getConstant(Imm, dl, MVT::i32);
|
||||
SDValue NarrowAnd = DAG.getNode(ISD::AND, dl, MVT::i32, NarrowOp, ConstOp);
|
||||
return DAG.getAnyExtOrTrunc(NarrowAnd, dl, N->getValueType(0));
|
||||
return DAG.getZExtOrTrunc(NarrowAnd, dl, N->getValueType(0));
|
||||
}
|
||||
case ISD::SHL:
|
||||
return combineSHL(N, DCI);
|
||||
|
|
|
@ -48539,13 +48539,28 @@ static SDValue combineSetCCMOVMSK(SDValue EFLAGS, X86::CondCode &CC,
|
|||
}
|
||||
|
||||
// MOVMSK(SHUFFLE(X,u)) -> MOVMSK(X) iff every element is referenced.
|
||||
SmallVector<int, 32> ShuffleMask;
|
||||
// Since we peek through a bitcast, we need to be careful if the base vector
|
||||
// type has smaller elements than the MOVMSK type. In that case, even if
|
||||
// all the elements are demanded by the shuffle mask, only the "high"
|
||||
// elements which have highbits that align with highbits in the MOVMSK vec
|
||||
// elements are actually demanded. A simplification of spurious operations
|
||||
// on the "low" elements take place during other simplifications.
|
||||
//
|
||||
// For example:
|
||||
// MOVMSK64(BITCAST(SHUF32 X, (1,0,3,2))) even though all the elements are
|
||||
// demanded, because we are swapping around the result can change.
|
||||
//
|
||||
// To address this, we check that we can scale the shuffle mask to MOVMSK
|
||||
// element width (this will ensure "high" elements match). Its slightly overly
|
||||
// conservative, but fine for an edge case fold.
|
||||
SmallVector<int, 32> ShuffleMask, ScaledMaskUnused;
|
||||
SmallVector<SDValue, 2> ShuffleInputs;
|
||||
if (NumElts <= CmpBits &&
|
||||
getTargetShuffleInputs(peekThroughBitcasts(Vec), ShuffleInputs,
|
||||
ShuffleMask, DAG) &&
|
||||
ShuffleInputs.size() == 1 && !isAnyZeroOrUndef(ShuffleMask) &&
|
||||
ShuffleInputs[0].getValueSizeInBits() == VecVT.getSizeInBits()) {
|
||||
ShuffleInputs[0].getValueSizeInBits() == VecVT.getSizeInBits() &&
|
||||
scaleShuffleElements(ShuffleMask, NumElts, ScaledMaskUnused)) {
|
||||
unsigned NumShuffleElts = ShuffleMask.size();
|
||||
APInt DemandedElts = APInt::getZero(NumShuffleElts);
|
||||
for (int M : ShuffleMask) {
|
||||
|
@ -57239,7 +57254,7 @@ static SDValue combineConcatVectorOps(const SDLoc &DL, MVT VT,
|
|||
// TODO - combineX86ShufflesRecursively should handle shuffle concatenation
|
||||
// but it currently struggles with different vector widths.
|
||||
if (llvm::all_of(Ops, [Op0](SDValue Op) {
|
||||
return Op.getOpcode() == Op0.getOpcode();
|
||||
return Op.getOpcode() == Op0.getOpcode() && Op.hasOneUse();
|
||||
})) {
|
||||
auto ConcatSubOperand = [&](EVT VT, ArrayRef<SDValue> SubOps, unsigned I) {
|
||||
SmallVector<SDValue> Subs;
|
||||
|
|
|
@ -819,11 +819,11 @@ class ModuleAddressSanitizer {
|
|||
private:
|
||||
void initializeCallbacks(Module &M);
|
||||
|
||||
bool InstrumentGlobals(IRBuilder<> &IRB, Module &M, bool *CtorComdat);
|
||||
void instrumentGlobals(IRBuilder<> &IRB, Module &M, bool *CtorComdat);
|
||||
void InstrumentGlobalsCOFF(IRBuilder<> &IRB, Module &M,
|
||||
ArrayRef<GlobalVariable *> ExtendedGlobals,
|
||||
ArrayRef<Constant *> MetadataInitializers);
|
||||
void InstrumentGlobalsELF(IRBuilder<> &IRB, Module &M,
|
||||
void instrumentGlobalsELF(IRBuilder<> &IRB, Module &M,
|
||||
ArrayRef<GlobalVariable *> ExtendedGlobals,
|
||||
ArrayRef<Constant *> MetadataInitializers,
|
||||
const std::string &UniqueModuleId);
|
||||
|
@ -2177,7 +2177,7 @@ void ModuleAddressSanitizer::InstrumentGlobalsCOFF(
|
|||
appendToCompilerUsed(M, MetadataGlobals);
|
||||
}
|
||||
|
||||
void ModuleAddressSanitizer::InstrumentGlobalsELF(
|
||||
void ModuleAddressSanitizer::instrumentGlobalsELF(
|
||||
IRBuilder<> &IRB, Module &M, ArrayRef<GlobalVariable *> ExtendedGlobals,
|
||||
ArrayRef<Constant *> MetadataInitializers,
|
||||
const std::string &UniqueModuleId) {
|
||||
|
@ -2187,7 +2187,7 @@ void ModuleAddressSanitizer::InstrumentGlobalsELF(
|
|||
// false negative odr violations at link time. If odr indicators are used, we
|
||||
// keep the comdat sections, as link time odr violations will be dectected on
|
||||
// the odr indicator symbols.
|
||||
bool UseComdatForGlobalsGC = UseOdrIndicator;
|
||||
bool UseComdatForGlobalsGC = UseOdrIndicator && !UniqueModuleId.empty();
|
||||
|
||||
SmallVector<GlobalValue *, 16> MetadataGlobals(ExtendedGlobals.size());
|
||||
for (size_t i = 0; i < ExtendedGlobals.size(); i++) {
|
||||
|
@ -2237,7 +2237,7 @@ void ModuleAddressSanitizer::InstrumentGlobalsELF(
|
|||
|
||||
// We also need to unregister globals at the end, e.g., when a shared library
|
||||
// gets closed.
|
||||
if (DestructorKind != AsanDtorKind::None) {
|
||||
if (DestructorKind != AsanDtorKind::None && !MetadataGlobals.empty()) {
|
||||
IRBuilder<> IrbDtor(CreateAsanModuleDtor(M));
|
||||
IrbDtor.CreateCall(AsanUnregisterElfGlobals,
|
||||
{IRB.CreatePointerCast(RegisteredFlag, IntptrTy),
|
||||
|
@ -2343,10 +2343,8 @@ void ModuleAddressSanitizer::InstrumentGlobalsWithMetadataArray(
|
|||
// redzones and inserts this function into llvm.global_ctors.
|
||||
// Sets *CtorComdat to true if the global registration code emitted into the
|
||||
// asan constructor is comdat-compatible.
|
||||
bool ModuleAddressSanitizer::InstrumentGlobals(IRBuilder<> &IRB, Module &M,
|
||||
void ModuleAddressSanitizer::instrumentGlobals(IRBuilder<> &IRB, Module &M,
|
||||
bool *CtorComdat) {
|
||||
*CtorComdat = false;
|
||||
|
||||
// Build set of globals that are aliased by some GA, where
|
||||
// getExcludedAliasedGlobal(GA) returns the relevant GlobalVariable.
|
||||
SmallPtrSet<const GlobalVariable *, 16> AliasedGlobalExclusions;
|
||||
|
@ -2364,11 +2362,6 @@ bool ModuleAddressSanitizer::InstrumentGlobals(IRBuilder<> &IRB, Module &M,
|
|||
}
|
||||
|
||||
size_t n = GlobalsToChange.size();
|
||||
if (n == 0) {
|
||||
*CtorComdat = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
auto &DL = M.getDataLayout();
|
||||
|
||||
// A global is described by a structure
|
||||
|
@ -2391,8 +2384,11 @@ bool ModuleAddressSanitizer::InstrumentGlobals(IRBuilder<> &IRB, Module &M,
|
|||
|
||||
// We shouldn't merge same module names, as this string serves as unique
|
||||
// module ID in runtime.
|
||||
GlobalVariable *ModuleName = createPrivateGlobalForString(
|
||||
M, M.getModuleIdentifier(), /*AllowMerging*/ false, kAsanGenPrefix);
|
||||
GlobalVariable *ModuleName =
|
||||
n != 0
|
||||
? createPrivateGlobalForString(M, M.getModuleIdentifier(),
|
||||
/*AllowMerging*/ false, kAsanGenPrefix)
|
||||
: nullptr;
|
||||
|
||||
for (size_t i = 0; i < n; i++) {
|
||||
GlobalVariable *G = GlobalsToChange[i];
|
||||
|
@ -2517,19 +2513,27 @@ bool ModuleAddressSanitizer::InstrumentGlobals(IRBuilder<> &IRB, Module &M,
|
|||
}
|
||||
appendToCompilerUsed(M, ArrayRef<GlobalValue *>(GlobalsToAddToUsedList));
|
||||
|
||||
std::string ELFUniqueModuleId =
|
||||
(UseGlobalsGC && TargetTriple.isOSBinFormatELF()) ? getUniqueModuleId(&M)
|
||||
: "";
|
||||
|
||||
if (!ELFUniqueModuleId.empty()) {
|
||||
InstrumentGlobalsELF(IRB, M, NewGlobals, Initializers, ELFUniqueModuleId);
|
||||
if (UseGlobalsGC && TargetTriple.isOSBinFormatELF()) {
|
||||
// Use COMDAT and register globals even if n == 0 to ensure that (a) the
|
||||
// linkage unit will only have one module constructor, and (b) the register
|
||||
// function will be called. The module destructor is not created when n ==
|
||||
// 0.
|
||||
*CtorComdat = true;
|
||||
} else if (UseGlobalsGC && TargetTriple.isOSBinFormatCOFF()) {
|
||||
InstrumentGlobalsCOFF(IRB, M, NewGlobals, Initializers);
|
||||
} else if (UseGlobalsGC && ShouldUseMachOGlobalsSection()) {
|
||||
InstrumentGlobalsMachO(IRB, M, NewGlobals, Initializers);
|
||||
instrumentGlobalsELF(IRB, M, NewGlobals, Initializers,
|
||||
getUniqueModuleId(&M));
|
||||
} else if (n == 0) {
|
||||
// When UseGlobalsGC is false, COMDAT can still be used if n == 0, because
|
||||
// all compile units will have identical module constructor/destructor.
|
||||
*CtorComdat = TargetTriple.isOSBinFormatELF();
|
||||
} else {
|
||||
InstrumentGlobalsWithMetadataArray(IRB, M, NewGlobals, Initializers);
|
||||
*CtorComdat = false;
|
||||
if (UseGlobalsGC && TargetTriple.isOSBinFormatCOFF()) {
|
||||
InstrumentGlobalsCOFF(IRB, M, NewGlobals, Initializers);
|
||||
} else if (UseGlobalsGC && ShouldUseMachOGlobalsSection()) {
|
||||
InstrumentGlobalsMachO(IRB, M, NewGlobals, Initializers);
|
||||
} else {
|
||||
InstrumentGlobalsWithMetadataArray(IRB, M, NewGlobals, Initializers);
|
||||
}
|
||||
}
|
||||
|
||||
// Create calls for poisoning before initializers run and unpoisoning after.
|
||||
|
@ -2537,7 +2541,6 @@ bool ModuleAddressSanitizer::InstrumentGlobals(IRBuilder<> &IRB, Module &M,
|
|||
createInitializerPoisonCalls(M, ModuleName);
|
||||
|
||||
LLVM_DEBUG(dbgs() << M);
|
||||
return true;
|
||||
}
|
||||
|
||||
uint64_t
|
||||
|
@ -2601,10 +2604,10 @@ bool ModuleAddressSanitizer::instrumentModule(Module &M) {
|
|||
assert(AsanCtorFunction || ConstructorKind == AsanCtorKind::None);
|
||||
if (AsanCtorFunction) {
|
||||
IRBuilder<> IRB(AsanCtorFunction->getEntryBlock().getTerminator());
|
||||
InstrumentGlobals(IRB, M, &CtorComdat);
|
||||
instrumentGlobals(IRB, M, &CtorComdat);
|
||||
} else {
|
||||
IRBuilder<> IRB(*C);
|
||||
InstrumentGlobals(IRB, M, &CtorComdat);
|
||||
instrumentGlobals(IRB, M, &CtorComdat);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#define LLVM_REVISION "llvmorg-17.0.2-0-gb2417f51dbbd"
|
||||
#define LLVM_REVISION "llvmorg-17.0.3-0-g888437e1b600"
|
||||
#define LLVM_REPOSITORY "https://github.com/llvm/llvm-project.git"
|
||||
|
||||
#define CLANG_REVISION "llvmorg-17.0.2-0-gb2417f51dbbd"
|
||||
#define CLANG_REVISION "llvmorg-17.0.3-0-g888437e1b600"
|
||||
#define CLANG_REPOSITORY "https://github.com/llvm/llvm-project.git"
|
||||
|
||||
#define LLDB_REVISION "llvmorg-17.0.2-0-gb2417f51dbbd"
|
||||
#define LLDB_REVISION "llvmorg-17.0.3-0-g888437e1b600"
|
||||
#define LLDB_REPOSITORY "https://github.com/llvm/llvm-project.git"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#define CLANG_VERSION 17.0.2
|
||||
#define CLANG_VERSION_STRING "17.0.2"
|
||||
#define CLANG_VERSION 17.0.3
|
||||
#define CLANG_VERSION_STRING "17.0.3"
|
||||
#define CLANG_VERSION_MAJOR 17
|
||||
#define CLANG_VERSION_MAJOR_STRING "17"
|
||||
#define CLANG_VERSION_MINOR 0
|
||||
#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 1500000
|
||||
|
||||
#define LLD_VERSION_STRING "17.0.2 (FreeBSD llvmorg-17.0.2-0-gb2417f51dbbd-" __XSTRING(LLD_FREEBSD_VERSION) ")"
|
||||
#define LLD_VERSION_STRING "17.0.3 (FreeBSD llvmorg-17.0.3-0-g888437e1b600-" __XSTRING(LLD_FREEBSD_VERSION) ")"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#define LLDB_VERSION 17.0.2
|
||||
#define LLDB_VERSION_STRING "17.0.2"
|
||||
#define LLDB_VERSION 17.0.3
|
||||
#define LLDB_VERSION_STRING "17.0.3"
|
||||
#define LLDB_VERSION_MAJOR 17
|
||||
#define LLDB_VERSION_MINOR 0
|
||||
#define LLDB_VERSION_PATCH 2
|
||||
#define LLDB_VERSION_PATCH 3
|
||||
/* #undef LLDB_FULL_VERSION_STRING */
|
||||
|
|
|
@ -344,10 +344,10 @@
|
|||
#define PACKAGE_NAME "LLVM"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "LLVM 17.0.2"
|
||||
#define PACKAGE_STRING "LLVM 17.0.3"
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION "17.0.2"
|
||||
#define PACKAGE_VERSION "17.0.3"
|
||||
|
||||
/* Define to the vendor of this package. */
|
||||
/* #undef PACKAGE_VENDOR */
|
||||
|
|
|
@ -73,10 +73,10 @@
|
|||
#define LLVM_VERSION_MINOR 0
|
||||
|
||||
/* Patch version of the LLVM API */
|
||||
#define LLVM_VERSION_PATCH 2
|
||||
#define LLVM_VERSION_PATCH 3
|
||||
|
||||
/* LLVM version string */
|
||||
#define LLVM_VERSION_STRING "17.0.2"
|
||||
#define LLVM_VERSION_STRING "17.0.3"
|
||||
|
||||
/* Whether LLVM records statistics for use with GetStatistics(),
|
||||
* PrintStatistics() or PrintStatisticsJSON()
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#define LLVM_REVISION "llvmorg-17.0.2-0-gb2417f51dbbd"
|
||||
#define LLVM_REVISION "llvmorg-17.0.3-0-g888437e1b600"
|
||||
#define LLVM_REPOSITORY "https://github.com/llvm/llvm-project.git"
|
||||
|
|
Loading…
Reference in a new issue