Remove redundant CXXScopeSpec from TemplateIdAnnotation.A TemplateIdAnnotation represents only a template-id, not a nested-name-specifier plus a template-id. Don't make a redundant copy of the CXXScopeSpec and store it on the template-id annotation.This slightly improves error recovery by more properly handling the case where we would form an invalid CXXScopeSpec while parsing a typename specifier, instead of accidentally putting the token stream into a broken "annot_template_id with a scope specifier, but with no preceding annot_cxxscope token" state.

Remove AllTargetsAsmPrintersIt's been an empty target since r360498 and friends(`git log --grep='Move InstPrinter files to MCTargetDesc.'llvm/lib/Target`), but due to hwo the way these targets are structuredit was silently an empty target without anyone noticing.No behavior change.

[libc] Replace the use of gtest with a new light weight unittestframework.Header files included wrongly using <...> are now included using the internal path names as the new unittest framework allows us to do so.Reviewers: phosek, abrachetDifferential Revision: https://reviews.llvm.org/D72743

Consolidate internal denormal flushing controlsCurrently there are 4 different mechanisms for controlling denormal flushing behavior, and about as many equivalent frontend controls.- AMDGPU uses the fp32-denormals and fp64-f16-denormals subtargetfeatures- NVPTX uses the nvptx-f32ftz attribute- ARM directly uses the denormal-fp-math attribute- Other targets indirectly use denormal-fp-math in one DAGCombine- cl-denorms-are-zero has a corresponding denorms-are-zero attributeAMDGPU wants a distinct control for f32 flushing from f16/f64, and as far as I can tell the same is true for NVPTX (based on the attribute name).Work on consolidating these into the denormal-fp-math attribute, and a new type specific denormal-fp-math-f32 variant. Only ARM seems to support the two different flush modes, so this is overkill for the otheruse cases. Ideally we would error on the unsupported positive-zero modeon other targets from somewhere.Move the logic for selecting the flush mode into the compiler driver, instead of handling it in cc1. denormal-fp-math/denormal-fp-math-f32 arenow both cc1 flags, but denormal-fp-math-f32 is not yet exposed as auser flag.-cl-denorms-are-zero, -fcuda-flush-denormals-to-zero and-fno-cuda-flush-denormals-to-zero will be mapped to-fp-denormal-math-f32=ieee or preserve-sign rather than the old attributes.Stop emitting the denorms-are-zero attribute for the OpenCL flag. It hasno in-tree users. The meaning would also be target dependent, such asthe AMDGPU choice to treat this as only meaning allow flushing of f32and not f16 or f64. The naming is also potentially confusing, since DAZin other contexts refers to instructions implicitly treating inputdenormals as zero, not necessarily flushing output denormals to zero.This also does not attempt to change the behavior for the current attribute. The LangRef now states that the default is ieee behavior, butthis is inaccurate for the current implementation. The clang handling isslightly hacky to avoid touching the existing denormal-fp-math uses.Fixing this will be left for a future patch.AMDGPU is still using the subtarget feature to control the denormal mode, but the new attribute are now emitted. A future change will switchthis and remove the subtarget features.

[WebAssembly] Track frame registers through VReg and local allocationThis change has 2 components:Target-independent: add a method getDwarfFrameBase toTargetFrameLowering. It describes how the Dwarf frame base will beencoded. That can be a register (the default), the CFA (which replacesNVPTX-specific logic in DwarfCompileUnit), or a DW_OP_WASM_locationdescriptr.WebAssembly: Allow WebAssemblyFunctionInfo::getFrameRegister to returnthe correct virtual register instead of FP32/SP32 afterWebAssemblyReplacePhysRegs has run. Make WebAssemblyExplicitLocalsstore the local it allocates for the frame register. Use this localinformation to implement getDwarfFrameBaseThe result is that the DW_AT_frame_base attribute is correctly encodedfor each subprogram, and each param and local variable has a correctDW_AT_location that uses DW_OP_fbreg to refer to the frame base.This is a reland of rG3a05c3969c18 with fixes for the expensive-checks and Windows buildsDifferential Revision: https://reviews.llvm.org/D71681

DebugInfo: Move SectionLabel tracking into CU's addRangeThis makes the SectionLabel handling more resilient - specifically for future PROPELLER work which will have more CU ranges (rather than just one per function).Ultimately it might be nice to make this more general/resilient to arbitrary labels (rather than relying on the labels being created for CU ranges & then being reused by ranges, loclists, and possibly other addresses). It's possible that other (non-rnglist/loclist) uses of addresses will need the addresses to be in SectionLabels earlier (eg: move the CU.addRange to be done on function begin, rather than function end, so during function emission they are already populated for other use).

[lldb/Makefile.rules] Force the default target to be 'all'The test harness invokes the test Makefiles with an explicit 'all' target, but it's handy to be able to recursively call Makefile.rules without speficying a goal.Some time ago, we rewrote some tests in terms of recursive invocations of Makefile.rules. It turns out this had an unintended side effect.While using $(MAKE) for a recursive invocation passes all the variablesset on the command line down, it doesn't pass the make goals. This meansthat those recursive invocations would invoke the default rule. It turnsout the default rule of Makefile.rules is not'all', but $(EXE). This means that ti would work becuase the executableis always needed, but it also means that the created binaries would notfollow some of the other top-level build directives, like MAKE_DSYM.Forcing 'all' to be the default target seems easier than making sure allthe invocations are correct going forward. This patch does this usingthe .DEFAULT_GOAL directive rather than hoisting the 'all' rule to bethe first one of the file. It seems like this explicit approach will beless prone to be broken in the future. Hopefully all the make implementations we use support it.

[lldb/testsuite] Modernize 2 test MakefilesThose old Makefiles used completely ad-hoc rules for building files, which means they didn't obey the test harness' variants.They were somewhat tricky to update as they use very peculiar build flags for some files. For this reason I was careful to compare the buildcommands before and after the change, which is how I found the discrepancy fixed by the previous commit.While some of the make syntax used here might not be easy to grasp for newcomers (per-target variable overrides), it seems better than to haveto repliacte the Makefile.rules logic for the test variants and platformsupport.

[debugserver] Share code between Enable/DisableHardwareWatchpoint (NFC)This extract the common functionality of enabling and disabling hardware watchpoints into a single function.Differential revision: https://reviews.llvm.org/D72971

[mlir] NFC: Rename index_t to index_typemlir currently fails to build on Solaris:

/vol/llvm/src/llvm-project/dist/mlir/lib/Conversion/VectorToLoops/ConvertVectorToLoops.cpp:78:20:error: reference to 'index_t' is ambiguous IndexHandle zero(index_t(0)), one(index_t(1)); ^ /usr/include/sys/types.h:103:16: note: candidate found by name lookupis 'index_t' typedef short index_t; ^ /vol/llvm/src/llvm-project/dist/mlir/include/mlir/EDSC/Builders.h:27:8:note: candidate found by name lookup is 'mlir::edsc::index_t' struct index_t { ^and many more.Given that POSIX reserves all identifiers ending in `_t` 2.2.2 The NameSpace<https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html>,it seems quite unwise to use such identifiers in user code, even more sowithout a distinguished prefix.The following patch fixes this by renaming `index_t` to `index_type`. cases.Tested on `amd64-pc-solaris2.11` and `sparcv9-sun-solaris2.11`.Differential Revision: https://reviews.llvm.org/D72619

[Concepts] Requires ExpressionsImplement support for C++2a requires-expressions.Re-commit after compilation failure on some platforms due to alignmentissues with PointerIntPair.Differential Revision: https://reviews.llvm.org/D50360

[X86] Remove X86ISD::FILD_FLAG and stop gluing nodes together.Summary: I think whatever problem the gluing was fixing has long sincebeen fixed. We don't have any of the restrictions on FP stack stuff thatexisted back when this was first added.I had to change which type we use for FILD in BuildFILD when X86 wasenabled because most of the isel patterns block f32/f64 instructionswhen SSE1/SSE2 are enabled. So I needed to use the f80 pattern, but thisshouldn't have an effect the generated code since there is only one FILDinstruction anyway. We already use f80 explicitly in other other places.Reviewers: RKSimon, spatelReviewed By: RKSimonSubscribers: andrew.w.kaylor, scanon, hiraditya, llvm-commitsTags: #llvmDifferential Revision: https://reviews.llvm.org/D72805

[CodeGen] Move fentry-insert, xray-instrumentation andpatchable-function before addPreEmitPass()This intention is to move patchable-function beforeaarch64-branch-targets(configured in AArch64PassConfig::addPreEmitPass) so that we emit BTIbefore NOPs(see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92424).This also allows addPreEmitPass() passes to know the precise instructionsizes if they want.Tried x86-64 Debug/Release builds of ccls with -fxray-instrument-fxray-instruction-threshold=1. No output difference with this commitand the previous commit.

[clang-format] Add IndentCaseBlocks optionSummary: The documentation for IndentCaseLabels claimed that the "Switch statement body is always indented one level more than case labels". This is technically false for the code block immediately following the label. Its closing bracket aligns with the start of the label.If the case label are not indented, it leads to a style where the closing bracket of the block aligns with the closing bracket of the switch statement, which can be hard to parse.This change introduces a new option, IndentCaseBlocks, which when true treats the block as a scope block (which it technically is).(Note: regenerated ClangFormatStyleOptions.rst usingtools/dump_style.py)Reviewed By: MyDeveloperDayPatch By: capnTags: #clang-format, #clangDifferential Revision: https://reviews.llvm.org/D72276

[ORC] Add weak symbol support to defineMaterializing, fix for PR40074.The MaterializationResponsibility::defineMaterializing method allowsclients to add new definitions that are in the process of beingmaterialized to the JIT. This patch adds support to defineMaterializingfor symbols with weak linkage where the new definitions may be rejectedif another materializer concurrently defines the same symbol. If a weaksymbol is rejected it will not be added to theMaterializationResponsibility's responsibility set. Clients can checkfor membership in the responsibility set via the MaterializationResponsibility::getSymbols() method before resolving any such weak symbols.This patch also adds code to RTDyldObjectLinkingLayer to tag COFF comdatsymbols introduced during codegen as weak, on the assumption that theseare COFF comdat constants. This fixes http://llvm.org/PR40074.

[TargetRegisterInfo] Default trackLivenessAfterRegAlloc() to trueExcept AMDGPU/R600RegisterInfo (a bunch of MIR tests seem to have problems), every target overrides it with true. PostMachineScheduler requires livein information. Not providing it can cause assertion failures in ScheduleDAGInstrs::addSchedBarrierDeps().

[BranchRelaxation] Simplify offset computation and fix a bug inadjustBlockOffsets()If Start!=0, adjustBlockOffsets() may unnecessarily adjust the offset of Start. There is no correctness issue, but it can create more block splits.

[X86] Try to avoid casts around logical vector ops recursively.Currently PromoteMaskArithemtic only looks at a single operation to skipcasts. This means we miss cases where we combine multiple masks.This patch updates PromoteMaskArithemtic to try to recursively promote AND/XOR/AND nodes that terminate in truncates of the right size or constant vectors.Reviewers: craig.topper, RKSimon, spatelReviewed By: RKSimonDifferential Revision: https://reviews.llvm.org/D72524

PR42108 Consistently diagnose binding a reference template parameter toa temporary.We previously failed to materialize a temporary when performing an implicit conversion to a reference type, resulting in our thinking the argument was a value rather than a reference in some cases.

[libc++][libc++abi] Fix or suppress failing tests in single-threadedbuilds.Fix a libc++abi test that was incorrectly checking for threading primitives even when threading was disabled.Additionally, temporarily XFAIL some module tests that fail because the<atomic> header is unsupported but still built as a part of the stdmodule.To properly address this libc++ would either need to produce a different module.modulemap for single-threaded configurations, or it would need tomake the <atomic> header not hard-error and instead be empty forsingle-threaded configurations

[ARM] Favour post inc for MVE loopsWe were previously not necessarily favouring postinc for the MVE loads and stores, leading to extra code prior to the loop to set up the preinc. MVE in general can benefit from postinc (as we don't have unrolled loops), and certain instructions like the VLD2's only post-inc versions are available.Differential Revision: https://reviews.llvm.org/D70790

[ARM] MVE VLDn postincThis adds Post inc variants of the VLD2/4 and VST2/4 instructions in MVE. It uses the same mechanism/nodes as Neon, transforming the intrinsic+add pair into a ARMISD::VLD2_UPD, which gets selected to a post-inc instruction. The code to do that is mostly taken from the existing Neon code, but simplified as less variants are needed.It also fills in some getTgtMemIntrinsic for the arm.mve.vld2/4 instrinsics, which allow the nodes to have MMO's, calculated as the full length to the memory being loaded/stored.Differential Revision: https://reviews.llvm.org/D71194

[llvm-mc] - Produce R_X86_64_PLT32 relocation for branches with JCCopcodes too.The idea is to produce R_X86_64_PLT32 instead of R_X86_64_PC32 forbranches.It fixes https://bugs.llvm.org/show_bug.cgi?id=44397.This patch teaches MC to do that for JCC (jump if condition is met) instructions. The new behavior matches modern GNU as. It is similar toD43383, which did the same for "call/jmp foo", but missed JCC cases.Differential revision: https://reviews.llvm.org/D72831

[IndVarSimplify][LoopUtils] rewriteLoopExitValues. NFCIThis moves `rewriteLoopExitValues()` from IndVarSimplify to LoopUtilsthus making it a generic loop utility function. This allows to rewriteloop exit values by just calling this function without running the wholeIndVarSimplify pass.We use this in D72714 to rematerialise the iteration count in exitblocks, so that we can clean-up loop update expressions inside thehardware-loops later.Differential Revision: https://reviews.llvm.org/D72602

Recommit "[DWARF5][DebugInfo]: Added support for DebugInfo generationfor auto return type for C++ member functions."Summary: This was reverted in 328e0f3dcac52171b8cdedeaba22c98e7fbb75eadue to chromium bot failure. This revision addresses that case.Original commit message: Summary: This patch will provide support for auto return type for the C++member functions. Before this return type of the member function is deducedand stored in the DIE. This patch includes llvm side implementation of this feature. Patch by: Awanish Pandey <Awanish.Pandey@amd.com> Reviewers: dblaikie, aprantl, shafik, alok, SouraVX,jini.susan.george Reviewed by: dblaikie Differential Revision: https://reviews.llvm.org/D70524

[test] On Mac, don't try to use result of sysctl command if calling itfailed.If sysctl is not found at all, let the usual exception propogate so thatthe user can fix their env. If it fails because of the permissionsrequired to read the property then print a warning and continue.Differential Revision: https://reviews.llvm.org/D72278

[lldb/DWARF] Change how we construct a llvm::DWARFContextSummary: The goal of this patch is two-fold. First, it fixes ause-after-free in the construction of the llvm DWARFContext. Thishappened because the construction code was throwing away the lldbDataExtractors it got while reading the sections (unlike their llvmcounterparts, these are also responsible for memory ownership). In mostcases this did not matter, because the sections are just slices of themmapped file data. But this isn't the case for compressed elf sections,in which case the section is decompressed into a heap buffer. A similarthing also happen with object files which are loaded from processmemory.The second goal is to make it explicit which sections go into the llvm DWARFContext -- any access to the sections through both DWARF parsers carries a risk of parsing things twice, so it's better if this is a conscious decision. Also, this avoids loading completely irrelevant sections (e.g. .text). At present, the only section that needs to be present in the llvm DWARFContext is the debug_line_str. Using it through both APIs is not a problem, as there is no parsing involved.The first goal is achieved by loading the sections through the existing lldb DWARFContext APIs, which already do the caching. The second by explicitly enumerating the sections we wish to load.Reviewers: JDevlieghere, aprantlSubscribers: lldb-commitsTags: #lldbDifferential Revision: https://reviews.llvm.org/D72917

[lldb/DWARF] Simplify DWARFDebugInfoEntry::LookupAddressSummary: This method was doing a lot more than it's only caller needed(DWARFDIE::LookupDeepestBlock) needed, so I inline it into the caller, and remove any code which is not actually used. This includes code for searching for the deepest function, and the code for working around incomplete DW_AT_low_pc/high_pc attributes on a compile unit DIE (modern compiler get this right, and this method is called on function DIEs anyway).This also improves our llvm consistency, as llvm::DWARFDebugInfoEntry is just a very simple struct with no nontrivial logic.Reviewers: JDevlieghere, aprantlSubscribers: lldb-commitsTags: #lldbDifferential Revision: https://reviews.llvm.org/D72920

Make SymbolFileDWARF::ParseLineTable use std::sort instead of insertionsortSummary: Motivation: When setting breakpoints in certain projects linesequences are frequently being inserted out of order.Rather than inserting sequences one at a time into a sorted line table,store all the line sequences as we're building them up and sort andflatten afterwards.Reviewers: jdoerfert, labathReviewed By: labathSubscribers: teemperor, labath, mgrang, JDevlieghere, lldb-commitsTags: #lldbDifferential Revision: https://reviews.llvm.org/D72909

[lldb] Don't process symlinks deep inside DWARFUnitSummary: This code is handling debug info paths starting with/proc/self/cwd, which is one of the mechanisms people use to obtain"relocatable" debug info (the idea being that one starts the debuggerwith an appropriate cwd and things "just work").Instead of resolving the symlinks inside DWARFUnit, we can do the same thing more elegantly by hooking into the existing Module path remapping code. Since llvm::DWARFUnit does not support any similar functionality, doing things this way is also a step towards unifying llvm and lldb dwarf parsers.Reviewers: JDevlieghere, aprantl, clayborg, jdoerfertSubscribers: lldb-commitsTags: #lldbDifferential Revision: https://reviews.llvm.org/D71770

[lldb] Allow loading of minidumps with no process idSummary: Normally, on linux we retrieve the process ID from theLinuxProcStatus stream (which is just the contents of /proc/%d/statuspseudo-file).However, this stream is not strictly required (it's a breakpad extension), and we are encountering a fair amount of minidumps which do not have it present. It's not clear whether this is the case with all these minidumps, but the two known situations where this stream can be missing are:- /proc filesystem not mounted (or something to that effect)- process crashing after exhausting (almost) all file descriptors (so the minidump writer may not be able to open the /proc file)Since this is a corner case which will become less and less relevant(crashpad-generated minidumps should not suffer from this problem), I work around this problem by hardcoding the PID to 1 in these cases. Thesame thing is done by the gdb plugin when talking to a stub which doesnot report a process id (e.g. a hardware probe).Reviewers: jingham, clayborgSubscribers: markmentovai, lldb-commitsTags: #lldbDifferential Revision: https://reviews.llvm.org/D70238

[AArch64][SVE] Extend int_aarch64_sve_ld1_gather_immThe ACLE distinguishes between the following addressing modes for gather loads: * "scalar base, vector offset", and * "vector base, scalar offset". For the "vector base, scalar offset"case, the`int_aarch64_sve_ld1_gather_imm` intrinsic was added in 79f2422d. Currently, that intrinsic assumes that the scalar offset is passed as an immediate. As a result, it does not cater for cases where scalar offset is stored in a register.In this patch `int_aarch64_sve_ld1_gather_imm` is extended so that all cases are covered:* `int_aarch64_sve_ld1_gather_imm` is renamed as `int_aarch64_sve_ld1_gather_scalar_offset`* new DAG combine rules are added for GLD1_IMM for scenarios where the offset is a non-immediate scalar or an out-of-range immediate* sve-intrinsics-gather-loads-vector-base.ll is renamed as sve-intrinsics-gather-loads-vector-base-imm-offset.ll* sve-intrinsics-gather-loads-vector-base-scalar-offset.ll is added totest file for non-immediate offsetsSimilar changes are made for scatter store intrinsics.Reviewed By: sdesmalen, efriedmaDifferential Revision: https://reviews.llvm.org/D71773

[ARM,MVE] Fix confusing MC names for MVE VMINA/VMAXA insns.Summary: A recent commit accidentally defined names like `MVE_VMAXAs8`as instances of the multiclass `MVE_VMINA`, and vice versa. This has no effect on the test suite, because nothing directly refers to those instruction names (the isel patterns are generated in Tablegen using`!cast<Instruction>(NAME)` inside a lower-level multiclass). But it means that `llvm-mc -show-inst` was listing VMAXA as VMINA, and it wouldalso affect any further draft code gen patches that use those instruction ids.Reviewers: MarkMurrayARM, dmgreen, miyuki, ostannardReviewed By: dmgreenSubscribers: kristof.beyls, hiraditya, llvm-commitsTags: #llvmDifferential Revision: https://reviews.llvm.org/D73034

[mlir] clarify LangRef wording around control flow in regionsIt was unclear what "exiting a region" meant in the existingformulation. Phrase it in terms of control flow transfer to theoperation enclosing the region.Discussion:https://groups.google.com/a/tensorflow.org/d/msg/mlir/73d2O8gjTuA/xVj1KoCTBAAJ

[lldb] Mark the implicit copy constructor as deleted when a moveconstructor is provided.Summary: CXXRecordDecls that have a move constructor but no copyconstructor need to have their implicit copy constructor marked asdeleted (see C++11 [class.copy]p7, p18) Currently we don't do that whenbuilding an AST with ClangASTContext which causes Sema to realise thatthe AST is malformed and asserting when trying to create an implicit copy constructor for us in the expression:``` Assertion failed: ((data().DefaultedCopyConstructorIsDeleted ||needsOverloadResolutionForCopyConstructor()) && "Copy constructor should not be deleted"), functionsetImplicitCopyConstructorIsDeleted, file include/clang/AST/DeclCXX.h,line 828.```In the test case there is a class `NoCopyCstr` that should have its copyconstructor marked as deleted (as it has a move constructor). When weend up trying to tab complete in the`IndirectlyDeletedCopyCstr` constructor, Sema realises that the`IndirectlyDeletedCopyCstr` has no implicit copy constructor and triesto create one for us. It then realises that`NoCopyCstr` also has no copy constructor it could find via lookup.However because we haven't marked the FieldDecl as having a deleted copyconstructor the`needsOverloadResolutionForCopyConstructor()` returns false and theassert fails.`needsOverloadResolutionForCopyConstructor()` would return true ifduring the time we added the `NoCopyCstr` FieldDecl to`IndirectlyDeletedCopyCstr` we would have actually marked it as having adeleted copy constructor (which would then mark the copy constructor of`IndirectlyDeletedCopyCstr ` as needing overload resolution and Sema ishappy).This patch sets the correct mark when we complete our CXXRecordDecls(which is the time when we know whether a copy constructor has beendeclared). In theory we don't have to do this if we had a Sema aroundwhen building our debug info AST but at the moment we don't have this sothis has to do the job for now.Reviewers: shafikReviewed By: shafikSubscribers: aprantl, JDevlieghere, lldb-commitsTags: #lldbDifferential Revision: https://reviews.llvm.org/D72694

[InstSimplify] fold select of vector constants that include undefelementsAs mentioned in D72643, we'd like to be able to assert that any select of equivalent constants has been removed before we're deep intoInstCombine.But there's a loophole in that assertion for vectors with undef elements that don't match exactly.This patch should close that gap. If we have undefs, we can't safely propagate those unless both constants elements for that lane are undef.Differential Revision: https://reviews.llvm.org/D72958

[ms] [llvm-ml] Add placeholder for llvm-ml, based on llvm-mcAs discussed on the mailing list, I plan to introduce an ml-compatibleMASM assembler as part of providing more of the Windows build tools.This will be similar to llvm-mc, but with different command-lineparameters.This placeholder is purely a stripped-down version of llvm-mc; we'lleventually add support for the Microsoft-style command-line flags, andback it with a MASM parser.Relanding this revision after fixing ARM-compatibility issues.Reviewers: rnk, thakis, RKSimonReviewed By: thakis, RKSimonDifferential Revision: https://reviews.llvm.org/D72679

[Alignment][NFC] Use Align with CreateElementUnorderedAtomicMemCpySummary: This is patch is part of a series to introduce an Alignmenttype. See this thread for context:http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html See thispatch for the introduction of the type: https://reviews.llvm.org/D64790Reviewers: courbet, nicolasvasilacheSubscribers: hiraditya, jfb, mehdi_amini, rriddle, jpienaar, burmako,shauheen, antiagainst, csigg, arpith-jacob, mgester, lucyrfox, herhut,liufengdb, llvm-commitsTags: #llvmDifferential Revision: https://reviews.llvm.org/D73041

[llvm-exegesis][NFC] Disassociate snippet generators from benchmarkrunnersThe addition of `inverse_throughput` mode highlighted the disjointedness of snippet generators and benchmark runners because it used the`UopsSnippetGenerator` with the `LatencyBenchmarkRunner`. To keep thecode consistent tie the snippet generators to parallelization/serialization rather than their benchmark runners.Renaming `LatencySnippetGenerator` -> `SerialSnippetGenerator`. Renaming`UopsSnippetGenerator` -> `ParallelSnippetGenerator`.Differential Revision: https://reviews.llvm.org/D72928

[InstCombine] form copysign from select of FP constants (PR44153)This should be the last step needed to solve the problem in the description of PR44153: https://bugs.llvm.org/show_bug.cgi?id=44153If we're casting an FP value to int, testing its signbit, and then choosing between a value and its negated value, that's a complicated wayof saying "copysign":(bitcast X) < 0 ? -TC : TC --> copysign(TC, X)Differential Revision: https://reviews.llvm.org/D72643

Add support for Linux/Musl ABIDifferential revision: https://reviews.llvm.org/D72701The patch adds a new option ABI for Hexagon. It primary deals with theway variable arguments are passed and is use in the Hexagon Linux Musl environment.If a callee function has a variable argument list, it must perform the following operations to set up its function prologue: 1. Determine the number of registers which could have been used forpassing unnamed arguments. This can be calculated by counting the number of registers used for passing named arguments. For example, if thecallee function is as follows: int foo(int a, ...){ ... } ... then register R0 is used to access the argument ' a '. Theregisters available for passing unnamed arguments are R1, R2, R3, R4, and R5. 2. Determine the number and size of the named arguments on the stack. 3. If the callee has named arguments on the stack, it should copy allof these arguments to a location below the current position on the stack, andthe difference should be the size of the register-saved area pluspadding (if any is necessary). The register-saved area constitutes all the registers that couldhave been used to pass unnamed arguments. If the number of registersforming the register-saved area is odd, it requires 4 bytes of padding; ifthe number is even, no padding is required. This is done to ensure an8-byte alignment on the stack. For example, if the callee is as follows: int foo(int a, ...){ ... } ... then the named arguments should be copied to the followinglocation: current_position - 5 (for R1-R5) * 4 (bytes) - 4 (bytes ofpadding) If the callee is as follows: int foo(int a, int b, ...){ ... } ... then the named arguments should be copied to the followinglocation: current_position - 4 (for R2-R5) * 4 (bytes) - 0 (bytes ofpadding) 4. After any named arguments have been copied, copy all the registersthat could have been used to pass unnamed arguments on the stack. If thenumber of registers is odd, leave 4 bytes of padding and then start copyingthem on the stack; if the number is even, no padding is required. This constitutes the register-saved area. If padding is required, ensure that the start location of padding is 8-byte aligned. If no paddingis required, ensure that the start location of the on-stack copy of the first register which might have a variable argument is 8-bytealigned. 5. Decrement the stack pointer by the size of register saved area plusthe padding. For example, if the callee is as follows: int foo(int a, ...){ ... } ; ... then the decrement value should be the following: 5 (for R1-R5) * 4 (bytes) + 4 (bytes of padding) = 24 bytes The decrement should be performed before the allocframeinstruction. Increment the stack-pointer back by the same amount before returning from the function.

clang-format: [JS] fix `??` opreator wrapping.Summary: clang-format currently treats the nullish coalescing operator`??` like the ternary operator. That causes multiple nullish terms to beeach indented relative to the last `??`, as they would in a ternary.The `??` operator is often used in chains though, and as such more similar to other binary operators, such as `||`. So to fix the indent, set its token type to `||`, so it inherits the same treatment.This opens up the question of operator precedence. However, `??` is required to be parenthesized when mixed with `||` and `&&`, so this is not a problem that can come up in syntactically legal code.Reviewers: krasimirSubscribers: cfe-commitsTags: #clangDifferential Revision: https://reviews.llvm.org/D73026

[OPENMP]Fix PR44578: crash in target construct with captured global.Target regions have implicit outer region which may erroneously capture some globals when it should not. It may lead to a compiler crash at the compile time.

[FileCheck] Make Match unittest more flexibleSummary: FileCheck's Match unittest needs updating whenever some call to initNextPattern() is inserted before its final block of checks. This commit change usage of LineNumber inside the Tester object so that the line number of the current pattern can be queries, thereby making the Match test more solid.Reviewers: jhenderson, jdenny, probinson, grimar, arichardson, rnkReviewed By: jhendersonSubscribers: llvm-commitsTags: #llvmDifferential Revision: https://reviews.llvm.org/D72913

[lldb/Util] Add a utility to run transparently capture and replay tests.This patch introduces a small new utility (lldb-repro) to transparently capture and replay debugger sessions through the command line driver. Its used to test the reproducers by running the test suite twice.During the first run, it captures a reproducer for every lldb invocation and saves it to a well-know location derived from the arguments and current working directory. During the second run, the test suite is run again but this time every invocation of lldb replays the previously recorded session.Differential revision: https://reviews.llvm.org/D72823

[lldb/IOHandler] Improve synchronization between IO handlers.The way the IO handlers are currently managed by the debugger is wrong.The implementation lacks proper synchronization between RunIOHandlerSyncand RunIOHandlers. The latter is meant to be run by the "main thread",while the former is meant to be run synchronously, potentially from adifferent thread.Imagine a scenario where RunIOHandlerSync is called from a differentthread than RunIOHandlers. Both functions manipulate the debugger'sIOHandlerStack. Although the push and pop operations are synchronized,the logic to activate, deactivate and run IO handlers is not.While investigating PR44352, I noticed some weird behavior in theEditline implementation. One of its members (m_editor_status) wasmodified from another thread. This happened because the main thread,while running RunIOHandlers ended up execution the IOHandlerEditlinecreated by the breakpoint callback thread. Even worse, due to the lackof synchronization within the IO handler implementation, both threadsended up executing the same IO handler.Most of the time, the IO handlers don't need to run synchronously. The exception is sourcing commands from external files, like the .lldbinitfile.I've added a (recursive) mutex to prevent another thread from messingwith the IO handlers wile another thread is running one synchronously.It has to be recursive, because we might have to source another filewhen encountering a command source in the original file.Differential revision: https://reviews.llvm.org/D72748

AMDGPU/GlobalISel: Add documentation for RegisterBankInfoDocument some high level strategies that should be used for register bank selection. The constant bus restriction section hasn't actually been implemented yet.

[mlir] Generalize broadcastable trait operandsSummary: Generalize broadcastable trait to variadic operands. Update the documentation that still talked about element type as part of broadcastable trait (that bug was already fixed). Also rename Broadcastable to ResultBroadcastableShape to be more explicit that the trait affects the result shape (it is possible for op to allow broadcastable operands but not have result shape that is broadcast compatible with operands).Doing some intermediate work to have getBroadcastedType take an optional elementType as input and use that if specified, instead of the common element type of type1 and type2 in this function.Differential Revision: https://reviews.llvm.org/D72559

[NFC] small rename of private member in InlineCost.cppSummary: Follow-up from https://reviews.llvm.org/D71733. Also moved an initialization to the base class, where it belonged in the first place.Reviewers: eraman, davidxlReviewed By: davidxlSubscribers: hiraditya, haicheng, llvm-commitsTags: #llvmDifferential Revision: https://reviews.llvm.org/D72949

AMDGPU: Partially merge indirect register write handlinga785209bc2fb switched to using a pseudos instead of manually tying operands on the regular instruction. The VGPR indexing mode path shouldhave the same problems that change attempted to avoid, so these shoulduse the same strategy.Use a single pseudo for the VGPR indexing mode and movreld paths, and expand it based on the subtarget later. These have essentially the sameconstraints, reading the index from m0.Switch from using an offset to the subregister index directly, instead of computing an offset and re-adding it back. Also add missing pseudos for existing register class sizes.

[lld][ELF] Don't apply --fix-cortex-a53-843419 to relocatable links.The code doesn't apply the fix correctly to relocatable links. I could try to fix the code that applies the fix, but it's pointless: we don't actually know what the offset will be in the final executable. So just ignore the flag for relocatable links.Issue discovered building Android.Differential Revision: https://reviews.llvm.org/D72968

[lld][RISCV] Print error when encountering R_RISCV_ALIGNSummary: Unlike R_RISCV_RELAX, which is a linker hint, R_RISCV_ALIGNrequires the support of the linker even when ignoring all R_RISCV_RELAXrelocations. This is because the compiler emits as many NOPs as may berequired for the requested alignment, more than may be requiredpre-relaxation, to allow for the target becoming more unaligned afterrelaxing earlier sequences. This means that the target is often notinitially aligned in the object files, and so the R_RISCV_ALIGNrelocations cannot just be ignored. Since we do not support linkerrelaxation, we must turn these into errors.Reviewers: ruiu, MaskRay, espindolaReviewed By: MaskRaySubscribers: grimar, Jim, emaste, arichardson, asb, rbar, johnrusso,simoncook, sabuasal, niosHD, kito-cheng, shiva0217, zzheng,edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX,jocewei, psnobl, benna, lenary, s.egerton, pzheng, sameer.abuasal,apazos, luismarques, llvm-commitsTags: #llvmDifferential Revision: https://reviews.llvm.org/D71820

[clangd] Fix rename for explicit destructor callsWhen triggering rename of the class name in the code with explicitdestructor calls, rename fails. Consider the following piece of code:``` class Foo;...Foo f; f.~/*...*/Foo();````findExplicitReferences` will report two `ReferenceLoc` for destructorcall: one is comming from `MemberExpr` (i.e. destructor call itself) andwould point to the tilde:``` f.~/*...*/Foo(); ^```And the second one is pointing to the typename and is coming from`TypeLoc`.``` f.~/*...*/Foo(); ^```This causes rename to produce incorrect textual replacements. This patch updates `MemberExpr` handler to detect destructor calls and prevents it from reporting a duplicate reference.Resolves: https://github.com/clangd/clangd/issues/236Reviewers: kadircet, hokeinDifferential Revision: https://reviews.llvm.org/D72638

[LLD][ELF] Add support for INPUT_SECTION_FLAGSThe INPUT_SECTION_FLAGS linker script command is used to constrain the section pattern matching to sections that match certain combinations of flags.There are two ways to express the constraint. withFlags: Section musthave these flags. withoutFlags: Section must not have these flags.The syntax of the command is: INPUT_SECTION_FLAGS '(' sect_flag_list ')' sect_flag_list: NAME| sect_flag_list '&' NAMEWhere NAME matches a section flag name such as SHF_EXECINSTR, or the integer value of a section flag. If the first character of NAME is !then it means must not contain flag.We do not support the rare case of { INPUT_SECTION_FLAGS(flags) filespec} where filespec has no input section description like (.text).As an example from the ld man page: SECTIONS { .text : { INPUT_SECTION_FLAGS (SHF_MERGE & SHF_STRINGS) *(.text) } .text2 : { INPUT_SECTION_FLAGS (!SHF_WRITE) *(.text) }}.text will match sections called .text that have both the SHF_MERGE and SHF_STRINGS flag..text2 will match sections called .text that don't have the SHF_WRITEflag.The flag names accepted are the generic to all targets andSHF_ARM_PURECODE as it is very useful to filter all the pure codesections into a single program header that can be marked execute never.fixes PR44265Differential Revision: https://reviews.llvm.org/D72756

[DAG] Fold extract_vector_elt (scalar_to_vector), K to undef (K != 0)This was unconditionally folding this to the source operand, even if theaccess was out of bounds. Use undef instead of the extract is not thefirst element.This helps with some cases where 3-vectors are legalized and avoidsprocessing the 4th component.Original Patch by: arsenm (Matt Arsenault)Differential Revision: https://reviews.llvm.org/D51589

[llvm-readelf][llvm-readobj] - Fix the indentation when printing dynamictags.This change is similar to one made for llvm-objdump in D72838.llvm-readelf/llvm-readobj tools do not align the "Name/Value" columnproperly. This patch adds a logic to calculate the size of indentationon fly to fix such issues.Differential revision: https://reviews.llvm.org/D72843

[ELF] Refactor uses of getInputSections to improve efficiency NFCAdd new method getFirstInputSection and use instead of getInputSections where appropriate to avoid creation of an unneeded vector of input sections.Differential Revision: https://reviews.llvm.org/D73047

[llvm-exegesis] Fix support for LEA64_32r.Summary: Add unit test to show the issue: We must select an *aliasing*output register, not the exact register.Reviewers: gchateletSubscribers: tschuett, mstojanovic, llvm-commitsTags: #llvmDifferential Revision: https://reviews.llvm.org/D73095

Create a gpu.module operation for the GPU Dialect.Summary: This is based on the use of code constantly checking for anattribute on a model and instead represents the distinct operaion with adifferent op. Instead, this op can be used to provide better filtering.Reverts "Revert "[mlir] Create a gpu.module operation for the GPUDialect.""This reverts commit ac446302ca4145cdc89f377c0c364c29ee303be5 after fixing internal Google issues.This additionally updates ROCDL lowering to use the new gpu.module.Reviewers: herhut, mravishankar, antiagainst, nicolasvasilacheSubscribers: jholewinski, mgorny, mehdi_amini, jpienaar, burmako,shauheen, csigg, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb,llvm-commits, mravishankar, rriddle, antiagainst, bkramerTags: #llvmDifferential Revision: https://reviews.llvm.org/D72921

[Alignment][NFC] Use Align with CreateMaskedLoadSummary: This is patch is part of a series to introduce an Alignmenttype. See this thread for context:http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html See thispatch for the introduction of the type: https://reviews.llvm.org/D64790Reviewers: courbetSubscribers: hiraditya, cfe-commits, llvm-commitsTags: #clang, #llvmDifferential Revision: https://reviews.llvm.org/D73087

[llvm-readobj] - Remove rpath.test.rpath.test checks that DT_RPATH is dumped.We have dynamic-tags.test that tests all dynamic tags and it is better,because also checks llvm-readelf and does not use precompiled binaries.Differential revision: https://reviews.llvm.org/D73093

[Alignment][NFC] Use Align with CreateElementUnorderedAtomicMemMoveSummary: This is patch is part of a series to introduce an Alignmenttype. See this thread for context:http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html See thispatch for the introduction of the type: https://reviews.llvm.org/D64790Reviewers: courbetSubscribers: hiraditya, jfb, llvm-commitsTags: #llvmDifferential Revision: https://reviews.llvm.org/D73050

[clang-tidy] New check: bugprone-misplaced-pointer-arithmetic-in-allocFinds cases where an integer expression is added to the result of amemory allocation function instead of its argument.Differential Revision: https://reviews.llvm.org/D71001

[lldb/DWARF] Fix a leak in line table constructionWe were creating a bunch of LineSequence objects but never deleting them.This fixes the leak and changes the code to use std::unique_ptr, to make it harder to make the same mistake again.

[PowerPC][NFC] Reclaim TSFlags bit 6We removed UseVSXReg flag in https://reviews.llvm.org/D58685 But we didnot reclain the bit 6 it was assigned, this will become confusing and ahole later.. We should reclaim it as early as possible before new bits.Reviewed By: sfertileDifferential Revision: https://reviews.llvm.org/D72649

[ARM] Follow AACPS standard for volatile bit-fields access widthSummary: This patch resumes the work of D16586. According to the AAPCS,volatile bit-fields should be accessed using containers of the widht oftheir declarative type. In such case:``` struct S1 { short a : 1;}``` should be accessed using load and stores of the width(sizeof(short)), where now the compiler does only load the minimumrequired width (char in this case). However, as discussed in D16586, that could overwrite non-volatile bit-fields, which conflicted with Cand C++ object models by creating data race conditions that are not partof the bit-field, e.g.``` struct S2 { short a; int b : 16;}``` Accessing `S2.b` would also access `S2.a`.The AAPCS Release 2019Q1.1(https://static.docs.arm.com/ihi0042/g/aapcs32.pdf) section 8.1 DataTypes, page 35, "Volatile bit-fields - preserving number and width ofcontainer accesses" has been updated to avoid conflict with the C++Memory Model. Now it reads in the note:``` This ABI does not place any restrictions on the access widths ofbit-fields where the container overlaps with a non-bit-field member.This is because the C/C++ memory model defines these as being separate memory locations, which can be accessed by two threadssimultaneously. For this reason, compilers must be permitted to use a narrower memory access width (including splitting the accessinto multiple instructions) to avoid writing to a different memorylocation.```I've updated the patch D16586 to follow such behavior by verifying thatwe only change volatile bit-field access when:- it won't overlap with any other non-bit-field member- we only access memory inside the bounds of the recordRegarding the number of memory accesses, that should be preserved, thatwill be implemented by D67399.Reviewers: rsmith, rjmccall, eli.friedman, ostannardSubscribers: ostannard, kristof.beyls, cfe-commits, carwil, olista01Tags: #clangDifferential Revision: https://reviews.llvm.org/D72932

Update spelling of {analyze,insert,remove}Branch in strings and commentsThese names have been changed from CamelCase to camelCase, but therewere many places (comments mostly) that still used the old names.This change is NFC.

[lldb/Initializers] Move all macOS initializers into PlatformMacOSXPlatformMacOSX is the main entry point to the plugin with the same name. This is part of a greater refactoring to auto generate the initializers.Differential revision: https://reviews.llvm.org/D73116

[HIP] use GetProgramPath for executable discoveryThis change replaces the manual building of executable paths usingllvm::sys::path::append with GetProgramPath. This enables adding otherpaths in case executables reside in different directories and makes thecode easier to read.Differential Revision: https://reviews.llvm.org/D72903

[PowerPC] Delete PPCSubtarget::isDarwin and isDarwinABIhttp://lists.llvm.org/pipermail/llvm-dev/2018-August/125614.htmldevelopers have agreed to remove Darwin support from POWER backends.Reviewed By: sfertileDifferential Revision: https://reviews.llvm.org/D72067

[Codegen] Emit both AssumeAlignedAttr and AllocAlignAttr assumptions ifthey existSummary: We shouldn't be just giving up if we find one of them(like we currently do with `AssumeAlignedAttr`), we should emit themall.As the tests show, even if we materialized good knowledge from`__attribute__((assume_aligned(32)`, it doesn't mean`__attribute__((alloc_align([...])))` info won't be useful. It might be,but that isn't given.Reviewers: erichkeane, jdoerfert, aaron.ballmanReviewed By: erichkeaneSubscribers: cfe-commitsTags: #clangDifferential Revision: https://reviews.llvm.org/D72979

[APFloat] Extend conversion from special stringsAdd support for converting Signaling NaN, and a NaN Payload from string.The NaNs (the string "nan" or "NaN") may be prefixed with 's' or 'S' fordefining a Signaling NaN.A payload for a NaN can be specified as a suffix. It may be aoctal/decimal/hexadecimal number in parentheses or without.Differential Revision: https://reviews.llvm.org/D69773

[lldb] Add a setting to not install the main executableSummary: Add setting target.auto-install-main-executable that controlswhether the main executable should be automatically installed whenconnected to a remote platform even if it does not have an explicitinstall path specified. The default is true as the current behaviour.Reviewers: omjavaid, JDevlieghere, srhines, labath, clayborgReviewed By: clayborgSubscribers: kevin.brodsky, lldb-commits, llvm-commitsTags: #lldbDifferential Revision: https://reviews.llvm.org/D71761

[mlir][ods] Fix StringRef initialization in buildersFor the generated builder taking in unwrapped attribute values, if theargument is a string, we should avoid wrapping it in quotes; otherwisewe are always setting the string attribute to contain the stringargument's name. The quotes come from StrinAttr's`constBuilderCall`, which is reasonable for string literals, but notfunction arguments containing strings.Differential Revision: https://reviews.llvm.org/D72977

[WebAssembly][InstrEmitter] Foundation for multivalue call loweringSummary: WebAssembly is unique among upstream targets in that it doesnot at any point use physical registers to store values. Instead, ituses virtual registers to model positions in its value stack. This means that some target-independent lowering activities that would use physicalregisters need to use virtual registers instead for WebAssembly andsimilar downstream targets. This CL generalizes the existing`usesPhysRegsForPEI` lowering hook to`usesPhysRegsForValues` in preparation for using it in more places.One such place is in InstrEmitter for instructions that have variadic defs. On register machines, it only makes sense for these defs to be physical registers, but for WebAssembly they must be virtual registers like any other values. This CL changes InstrEmitter to check the new target lowering hook to determine whether variadic defs should be physical or virtual registers.These changes are necessary to support a generalized CALL instruction for WebAssembly that is capable of returning an arbitrary number of arguments. Fully implementing that instruction will require additional changes that are described in comments here but left for a follow up commit.Reviewers: aheejin, dschuff, qcolombetSubscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commitsTags: #llvmDifferential Revision: https://reviews.llvm.org/D71484

[scudo][standalone] Allow sched_getaffinity to failSummary: In some configuration, `sched_getaffinity` can fail. Somereasons for that being the lack of `CAP_SYS_NICE` capability or somesyscall filtering and so on.This should not be fatal to the allocator, so in this situation, we willfallback to the `MaxTSDCount` value specified in the allocator configuration.Reviewers: cferris, eugenis, hctim, morehouse, pccSubscribers: #sanitizers, llvm-commitsTags: #sanitizers, #llvmDifferential Revision: https://reviews.llvm.org/D73055

Revert "[lldb] Add a setting to not install the main executable"The commit has been reverted as it does not mention the author of the patch.This reverts commit 7c9bcba644c4fc2178e20060d9ba2ff1f50ae15e.

[lldb] Add a setting to not install the main executableSummary: Add setting target.auto-install-main-executable that controlswhether the main executable should be automatically installed whenconnected to a remote platform even if it does not have an explicitinstall path specified. The default is true as the current behaviour.Reviewers: omjavaid, JDevlieghere, srhines, labath, clayborgReviewed By: clayborgSubscribers: kevin.brodsky, lldb-commits, llvm-commitsTags: #lldbDifferential Revision: https://reviews.llvm.org/D71761

[WebAssembly] Split and recombine multivalue calls for ISelSummary: Multivalue calls both take and return an arbitrary number of arguments, but ISel only supports one or the other in a single instruction. To get around this, calls are modeled as two pseudo instructions during ISel. These pseudo instructions, CALL_PARAMS and CALL_RESULTS, are recombined into a single CALL MachineInstr in a customemit hook.RegStackification and the MC layer will additionally need to be made aware of multivalue calls before the tests will produce correct output.Reviewers: aheejin, dschuffSubscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commitsTags: #llvmDifferential Revision: https://reviews.llvm.org/D71496

[Sema] Avoid Wrange-loop-analysis false positivesWhen Wrange-loop-analysis issues a diagnostic on a dependent type in a template the diagnostic may not be valid for all instantiations.Therefore the diagnostic is suppressed during the instantiation. Nondependent types still issue a diagnostic.The same can happen when using macros. Therefore the diagnostic is disabled for macros.Fixes https://bugs.llvm.org/show_bug.cgi?id=44556Differential Revision: https://reviews.llvm.org/D73007

[clang-tidy] Fix check for Abseil internal namespace accessThis change makes following modifications: * If reference originated from macro expansion, we report locationinside of the macro instead of location where macro is referenced. * If for any reason deduced location is not correct we silently ignoreit.Patch by Gennadiy Rozental (rogeeff@google.com) Reviewed ashttps://reviews.llvm.org/D72484

[lldb/Platform] Re-add ifdef's to guard macOS-only code.I moved the code from the system initializer to PlatformMacOSX. The defines are still necessary because MacOSX is initialized on other platforms where the other platforms are not available.

Allow arbitrary capability name in Thread Safety AnalysisRestricting the names of capabilities to only "role" or "mutex" makes for awkward diagnostic text, such as with: https://chromium-review.googlesource.com/c/chromium/src/+/1948098/19/base/sequence_checker_unittest.nc#33

[lldb/CMake] Add check-lldb-shell and check-lldb-api targets for XcodeThe Xcode generator does not provide the auto-generated targets where you can append a folder name to check-lldb. Instead add two custom lit targets to run just the shell and api tests.

AMDGPU/GlobalISel: Legalize G_PTR_ADD for arbitrary pointersPointers of unrecognized address spaces shoudl be treated as global-likepointers. Even if loads and stores of them aren't handled, dumboperations that just operate on the bits should work.

[lldb/DataFormatters] Fix the `$$deference$$` synthetic childSummary: The ValueObject code checks for a special `$$dereference$$`synthetic child to allow formatter providers to implement a natural dereferencing behavior in `frame variable` for objects like smart pointers.This support was broken when used directly throught the Python API and not trhough `frame variable`. The reason is that SBFrame.FindVariable()will return by default the synthetic variable if it exists, while `framevariable` will not do this eagerly. The code in`ValueObject::Dereference()` accounted for the latter but not for theformer. The fix is trivial. The test change includes additionalcovergage for the already-working bahevior as it wasn't covered by thetestsuite before.This commit also adds a short piece of documentatione explaining that itis possible (even advisable) to provide this synthetic child outstide ofthe range of the normal children.Reviewers: jinghamSubscribers: lldb-commitsTags: #lldbDifferential Revision: https://reviews.llvm.org/D73053

[PATCH] Reland [Clang] Un-break scan-build after integrated-cc1 changeThe issue was reported by @xazax.hun here:https://reviews.llvm.org/D69825#1827826"This patch (D69825) breaks scan-build-py which parses the output of"-###" to get -cc1 command. There might be other tools with the sameproblems. Could we either remove (in-process) from CC1Command::Print oradd a line break?Having the last line as a valid invocation is valuable and there mightbe tools relying on that."Differential Revision: https://reviews.llvm.org/D72982

[IR] Value::getPointerAlignment(): handle pointer constantsSummary: New `@test13` in `Attributor/align.ll` is the main motivation -`null` pointer really does not limit our alignment knowledge, in fact itis fully aligned since it has no bits set.Here we don't special-case `null` pointer because it is somewhatcontroversial to add one more place where we enforce that `null` pointeris zero, but instead we do the more general thing of trying to performconstant-fold of pointer constant to an integer, and perform alignmentinferrment on that.Reviewers: jdoerfert, gchatelet, courbet, sstefan1Reviewed By: jdoerfertSubscribers: hiraditya, arphaman, jfb, llvm-commitsTags: #llvmDifferential Revision: https://reviews.llvm.org/D73131

Fix an over-suspend bug with LaunchInNewTerminalWithAppleScript sessionsWhen launching an inferior in a new terminal window via AppleScript andthe darwin-debug helper program, we could often end up with the inferiorprocess having a too-high suspend count, and it would never resumeexecution.lldb tries to wait until darwin-debug has finished its work and has launched the inferior (WaitForProcessToSIGSTOP) but this wasn't workingcorrectly - and cannot be made to work.This patch removes WaitForProcessToSIGSTOP, adds a special tiny segmentto the darwin-debug executable so it can be identified as that binary(ExecExtraSuspend), and adds code to debugserver to detect this segment. When debugserver sees this segment, it notes that the next exec will bedone with a launch-suspended flag. When the next exec happens,debugserver forces an extra task_resume when we resume the inferior.An alternative approach would be if lldb could detect when the inferiorhas been launched by darwin-debug unambiguously; monitoring when theunix socket between darwin-debug and lldb was closed would have been areasonable way to do this too.<rdar://problem/29760580>Differential Revision: https://reviews.llvm.org/D72963

[lldb/Plugin] Rename AddressSanitizerRuntime for consistency with plugin(NFC)Renames AddressSanitizerRuntime to InstrumentationRuntimeASan to be consistent with the directory structure and plugin name.

[lldb/Plugin] Rename MainThreadCheckerRuntime for consistency withplugin (NFC)Renames MainThreadCheckerRuntime to InstrumentationRuntimeMainThreadChecker to be consistent with the directory structure and plugin name.

List implicit operator== after implicit destructors in a vtable.Summary: We previously listed first declared members, then implicitoperator=, then implicit operator==, then implicit destructors. Perdiscussion on https://github.com/itanium-cxx-abi/cxx-abi/issues/88, putthe implicit equality comparison operators at the very end, after allspecial member functions.This reinstates add2b7e44ada46f30715b5c48823a9e9e317e0c3, reverted in commit 89e43f04ba87a0da6e94863db149669c7536486b, with a fix for 32-bit targets.Reviewers: rjmccallSubscribers: cfe-commitsTags: #clangDifferential Revision: https://reviews.llvm.org/D72897

[Concepts] Placeholder constraints and abbreviated templatesThis patch implements P1141R2 "Yet another approach for constraineddeclarations".General strategy for this patch was:- Expand AutoType to include optional type-constraint, reflecting thewording and easing the integration of constraints.- Replace autos in parameter type specifiers with invented parameters inGetTypeSpecTypeForDeclarator, using the same logic previously used for generic lambdas, now unified with abbreviatedtemplates, by: - Tracking the template parameter lists in the Declarator object - Tracking the template parameter depth before parsing functiondeclarators (at which point we can match template parameters against scope specifiers to know if we have an explicittemplate parameter list to append invented parameters to or not).- When encountering an AutoType in a parameter context we check a stackof InventedTemplateParameterInfo structures that contain the info required to create and accumulate invented templateparameters (fields that were already present in LambdaScopeInfo, which now inherits from this class and is looked upwhen an auto is encountered in a lambda context).Differential Revision: https://reviews.llvm.org/D65042

[clang-tidy] Fix check for generic lambda invented template parametersclang-tidy previously relied on there being no identifier for aTemplateTypeParmDecl for checking whether 'decltype(x)' should beinserted, instead of checking whether or not it is implicit.D65042 added new names for invented generic lambda template parameters,rendering that check incorrect.

[Concepts] Constraint Satisfaction CachingAdd a simple cache for constraint satisfaction results. Whether or notthis simple caching would be permitted in final C++2a is currently beingdiscussed but it is required for acceptable performance so we use it inthe meantime, with the possibility of adding some cache invalidationmechanisms later.Differential Revision: https://reviews.llvm.org/D72552

[libc++] Make sure std::is_scalar returns true for block typesSummary: The compiler already treats them as scalar types, so thelibrary should too. Furthermore, this allows blocks to be used in moreplaces, for example in std::optional, which requires an object type.rdar://problem/57892832Reviewers: dexonsmith, EricWF, mclow.lists Differential Revision:https://reviews.llvm.org/D72708