summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Swift support: add __attribute__((swift_async_context)) to args.cherry-pick-somethingTim Northover2020-12-1812-1/+59
| | | | This translates to "swiftasync" LLVM attribute.
* IR+AArch64: add a "swiftasync" argument attribute.Tim Northover2020-12-1833-17/+488
| | | | | | | | | | | | | | | | | | | | | | | This extends any frame record created in the function to include that parameter, passed in X22. The new record looks like [X22, FP, LR] in memory, and FP is stored with 0b0001 stored in bits 63:60 (CodeGen assumes they are 0b0000 in normal operation). The effect of this is that tools walking the stack should expect to see one of three values there: * 0b0000 => a normal, non-extended record with just [FP, LR] * 0b0001 => the extended record [X22, FP, LR] * 0b1111 => kernel space, and a non-extended record. All other values are currently reserved. If compiling for arm64e this context pointer is address-discriminated with the discriminator 0xc31a and the DB (process-specific) key. There is also an "i8** @llvm.swift.async.context.addr()" intrinsic providing front-ends access to this slot (and forcing its creation initialized to nullptr if necessary).
* Merge commit 'd104e582838f' from llvm.org/release/11.x into ↵git apple-llvm automerger2020-12-172-1/+9
|\ | | | | | | apple/stable/20200714
| * [CMake] Avoid __FakeVCSRevision.h with no git repositoryJonas Hahnfeld2020-12-172-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Set the return variable to "" in find_first_existing_vc_file to say that there is a repository, but no file to depend on. This works transparently for all other callers that handle undefinedness and equality to an empty string the same way. Use the knowledge to avoid depending on __FakeVCSRevision.h if there is no git repository at all (for example when building a release) as there is no point in regenerating an empty VCSRevision.h. Differential Revision: https://reviews.llvm.org/D92718 (cherry picked from commit 6e890ec7beb0874464a0af9f84e41a987f968b23)
* | Merge commit 'f5f8d86dc4c9' from llvm.org/release/11.x into ↵git apple-llvm automerger2020-12-162-11/+67
|\ \ | |/ | | | | apple/stable/20200714
| * Don't error for zero-length arange entriesJames Henderson2020-12-162-11/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although the DWARF specification states that .debug_aranges entries can't have length zero, these can occur in the wild. There's no particular reason to enforce this part of the spec, since functionally they have no impact. The patch removes the error and introduces a new warning for premature terminator entries which does not stop parsing. This is a relanding of cb3a598c87db, adding the missing obj2yaml part that was needed. Fixes https://bugs.llvm.org/show_bug.cgi?id=46805. See also https://reviews.llvm.org/D71932 which originally introduced the error. Reviewed by: ikudrin, dblaikie, Higuoxing Differential Revision: https://reviews.llvm.org/D85313
* | Merge pull request #2255 from ↵fredriss2020-12-161-4/+14
|\ \ | | | | | | | | | | | | apple/🍒/bastille/2501e911a5a174fc1a07a2a1ac687a2bf0f05ef3 [lldb] Don't depend on psutil in TestCompletion.py
| * | [lldb] Don't depend on psutil in TestCompletion.pyRaphael Isemann2020-12-151-4/+14
|/ / | | | | | | | | | | | | | | psutil isn't reall a dependency of the test suite so this shouldn't be unconditionally be imported here. Instead just check for the process name by looking for the "a.out" string to get the bots green again. (cherry picked from commit 2501e911a5a174fc1a07a2a1ac687a2bf0f05ef3)
* | Merge commit '280e47ea0e83' from llvm.org/release/11.x into ↵git apple-llvm automerger2020-12-154-77/+67
|\ \ | |/ | | | | apple/stable/20200714
| * [AArch64][GlobalISel] Narrow 128-bit regs to 64-bit regs in emitTestBitJessica Paquette2020-12-154-77/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we have a 128-bit register, emitTestBit would incorrectly narrow to 32 bits always. If the bit number was > 32, then we would need a TB(N)ZX. This would cause a crash, as we'd have the wrong register class. (PR48379) This generalizes `narrowExtReg` into `moveScalarRegClass`. This also allows us to remove `widenGPRBankRegIfNeeded` entirely, since `selectCopy` correctly handles SUBREG_TO_REG etc. This does create some codegen changes (since `selectCopy` uses the `all` regclass variants). However, I think that these will likely be optimized away, and we can always improve the `selectCopy` code. It looks like we should revisit `selectCopy` at this point, and possibly refactor it into at least one `emit` function. Differential Revision: https://reviews.llvm.org/D92707 (cherry picked from commit 195a7af0abb26915f962462f69c0f17e3835f78b)
* | Merge commit '9e16c5bfae6e' from llvm.org/release/11.x into ↵git apple-llvm automerger2020-12-152-12/+61
|\ \ | |/ | | | | apple/stable/20200714
| * [AArch64][GlobalISel] Look through a G_ZEXT when trying to match ↵Amara Emerson2020-12-152-12/+61
| | | | | | | | | | | | | | | | | | | | | | | | shift-extended register offsets. The G_ZEXT in these cases seems to actually come from a combine that we do but SelectionDAG doesn't. Looking through it allows us to match "uxtw #2" addressing modes. Differential Revision: https://reviews.llvm.org/D91475 (cherry picked from commit 0b6090699ab542cde24be1565b4d97dbad153cba)
* | Merge commit '6ec777c2f649' from llvm.org/release/11.x into ↵git apple-llvm automerger2020-12-151-0/+14
|\ \ | |/ | | | | apple/stable/20200714
| * [Support] PR42623: Avoid setting the delete-on-close bit if a TempFile ↵Ronald Wampler2020-12-151-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | doesn't reside on a local drive On Windows, after commit 881ba104656c40098d4bc90c52613c08136f0fe1, tools using TempFile would error with "bad file descriptor" when writing the file on a network drive. It appears that setting the delete-on-close bit via SetFileInformationByHandle/FileDispositionInfo prevented it from accessing the file on network drives, and although using FILE_DISPOSITION_INFO seems to work, it causes other troubles. Differential Revision: https://reviews.llvm.org/D81803 (cherry picked from commit 79657e2339b58bc01fe1b85a448bb073d57d90bb)
* | Merge commit 'f684355e0292' from llvm.org/release/11.x into ↵git apple-llvm automerger2020-12-151-4/+3
|\ \ | |/ | | | | apple/stable/20200714
| * [Support][Windows] Fix incorrect GetFinalPathNameByHandleW() return value ↵Aleksandr Platonov2020-12-151-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | check in realPathFromHandle() `GetFinalPathNameByHandleW(,,N,)` returns: - `< N` on success (this value does not include the size of the terminating null character) - `>= N` if buffer is too small (this value includes the size of the terminating null character) So, when `N == Buffer.capacity() - 1`, we need to resize buffer if return value is > `Buffer.capacity() - 2`. Also, we can set `N` to `Buffer.capacity()`. Thus, without this patch `realPathFromHandle()` returns unfilled buffer when length of the final path of the file is equal to `Buffer.capacity()` or `Buffer.capacity() - 1`. Reviewed By: andrewng, amccarth Differential Revision: https://reviews.llvm.org/D86564 (cherry picked from commit ceffd6993c350b57f43cec3b6371b159fc4a3149)
* | Merge pull request #2248 from ↵Shafik Yaghmour2020-12-153-1/+30
|\ \ | | | | | | | | | | | | shafik/70596991_fix_handling_bitfields_in_unions_parsing_dwarf [LLDB] Fix handling of bit-fields in a union
| * | [LLDB] Fix handling of bit-fields in a unionshafik2020-12-153-1/+30
|/ / | | | | | | | | | | | | | | When parsing DWARF and laying out bit-fields we don't properly take into account when they are in a union, they will all have a zero offset. Differential Revision: https://reviews.llvm.org/D91118 (cherry picked from commit bae9aedb341c5f4eceafba2ee1fec7c05d842c97)
* | [sanitizer] Restrict querying VM size on Darwin only to iOS devicesKuba Mracek2020-12-151-1/+1
| | | | | | | | | | | | | | | | We currently do this for SANITIZER_IOS, which includes devices *and* simulators. This change opts out the check for simulators to unify the behavior with macOS, because VM size is really a property of the host OS, and not the simulator. <rdar://problem/72129387> Differential Revision: https://reviews.llvm.org/D93140
* | Merge pull request #2243 from medismailben/apple/stable/20200714Med Ismail Bennani2020-12-154-0/+74
|\ \ | | | | | | [lldb/API] Expose Target::CreateBreakpoint(..., move_to_nearest_code)…
| * | [lldb/API] Expose Target::CreateBreakpoint(..., move_to_nearest_code) overloadMed Ismail Bennani2020-12-154-0/+74
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch exposes the Target::CreateBreakpoint overload with the boolean argument to move to the neareast code to the SBAPI. This is useful when creating column breakpoints to restrict lldb's resolution to the pointed source location, preventing it to go to the next line. rdar://72196842 Differential Revision: https://reviews.llvm.org/D93266 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
* | Merge pull request #2242 from JDevlieghere/llvm.org-release-11.xMishal Shah2020-12-1414-204/+122
|\ \ | | | | | | Revert commits that got automerged from the llvm.org 11.x release branch.
| * | Revert "[lldb] Report old modules from ModuleList::ReplaceEquivalent"Jonas Devlieghere2020-12-143-39/+10
| | | | | | | | | | | | This reverts commit abeec5d081f0dfbee305b70d7641c8e5af9a9335.
| * | Revert "Merge commit 'b618cf7a378d' from llvm.org/release/11.x into ↵Jonas Devlieghere2020-12-1413-165/+112
|/ / | | | | | | | | | | | | apple/stable/20200714" This reverts commit 8760017e4746aff4bc84036ca23ac4c0ffaefc91, reversing changes made to 8711013c8102755c5f5c90f0ed1c024cca0de760.
* | Merge commit '98f575ff55bf' from llvm.org/release/11.x into ↵git apple-llvm automerger2020-12-144-23/+52
|\ \ | |/ | | | | apple/stable/20200714
| * Don't reject calls to MinGW's unusual _setjmp declaration.Richard Smith2020-12-144-23/+52
| | | | | | | | | | | | We now recognize this function as a builtin despite it having an unexpected number of parameters; make sure we don't enforce that it has only 1 argument for its 2 parameters.
* | Merge commit '0312bec0d757' from llvm.org/release/11.x into ↵git apple-llvm automerger2020-12-146-32/+116
|\ \ | |/ | | | | apple/stable/20200714
| * Recognize setjmp and friends as builtins even if jmp_buf is not declared yet.Richard Smith2020-12-146-32/+116
| | | | | | | | | | | | | | This happens in glibc's headers. It's important that we recognize these functions so that we can mark them as returns_twice. Differential Revision: https://reviews.llvm.org/D88518
* | Merge commit 'fdab756331f3' from llvm.org/release/11.x into ↵git apple-llvm automerger2020-12-142-0/+9
|\ \ | |/ | | | | apple/stable/20200714
| * [Sema] Handle objc_super special lookup when checking builtin compatibilityRaul Tambre2020-12-142-0/+9
| | | | | | | | | | | | | | objc_super is special and needs LookupPredefedObjCSuperType() called before performing builtin type comparisons. This fixes an error when compiling macOS headers. A test is added. Differential Revision: https://reviews.llvm.org/D87917
* | Merge commit 'adf845300c9c' from llvm.org/release/11.x into ↵git apple-llvm automerger2020-12-1419-216/+193
|\ \ | |/ | | | | apple/stable/20200714
| * [Sema] Introduce BuiltinAttr, per-declaration builtin-nessRaul Tambre2020-12-1419-216/+193
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of relying on whether a certain identifier is a builtin, introduce BuiltinAttr to specify a declaration as having builtin semantics. This fixes incompatible redeclarations of builtins, as reverting the identifier as being builtin due to one incompatible redeclaration would have broken rest of the builtin calls. Mostly-compatible redeclarations of builtins also no longer have builtin semantics. They don't call the builtin nor inherit their attributes. A long-standing FIXME regarding builtins inside a namespace enclosed in extern "C" not being recognized is also addressed. Due to the more correct handling attributes for builtin functions are added in more places, resulting in more useful warnings. Tests are updated to reflect that. Intrinsics without an inline definition in intrin.h had `inline` and `static` removed as they had no effect and caused them to no longer be recognized as builtins otherwise. A pthread_create() related test is XFAIL-ed, as it relied on it being recognized as a builtin based on its name. The builtin declaration syntax is too restrictive and doesn't allow custom structs, function pointers, etc. It seems to be the only case and fixing this would require reworking the current builtin syntax, so this seems acceptable. Fixes PR45410. Reviewed By: rsmith, yutsumi Differential Revision: https://reviews.llvm.org/D77491
* | Merge commit '200eb1abe2a1' from llvm.org/release/11.x into ↵git apple-llvm automerger2020-12-142-2/+41
|\ \ | |/ | | | | apple/stable/20200714
| * Stop ExtractTypeForDeductionGuide from recursing on TypeSourceInfoErich Keane2020-12-142-2/+41
| | | | | | | | | | | | | | | | | | As reported in PR48177, the type-deduction extraction ends up going into an infinite loop when the type referred to has a recursive definition. This stops recursing and just substitutes the type-source-info the TypeLocBuilder identified when transforming the base. (cherry picked from commit 1c98f984105e552daa83ed8e92c61fba0e401410)
* | Merge commit '700baa009dc6' from llvm.org/release/11.x into ↵git apple-llvm automerger2020-12-143-2/+19
|\ \ | |/ | | | | apple/stable/20200714
| * [MC][ELF] Accept abbreviated form with sh_flags and sh_entsizeTobias Burnus2020-12-143-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | D73999 / commit 75af9da755721123e62b45cd0bc0c5e688a9722a added for LLVM 11 a check that sh_flags and sh_entsize (and sh_type) changes are an error, in line with GNU assembler. However, GNU assembler accepts and GCC generates an abbreviated form: while the first .section contains the flags and entsize, subsequent sections simply contain the name without repeating entsize or flags. Do likewise for better compatibility. See https://bugs.llvm.org/show_bug.cgi?id=48201 Reviewed By: jhenderson, MaskRay Differential Revision: https://reviews.llvm.org/D92052 (cherry picked from commit 1deff4009e0ae661b03682901bf6932297ce7ea1)
* | Merge commit '861b2a24bc49' from llvm.org/release/11.x into ↵git apple-llvm automerger2020-12-142-14/+39
|\ \ | |/ | | | | apple/stable/20200714
| * [KernelAddressSanitizer] Fix globals exclusion for indirect aliasesMarco Elver2020-12-142-14/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | GlobalAlias::getAliasee() may not always point directly to a GlobalVariable. In such cases, try to find the canonical GlobalVariable that the alias refers to. Link: https://github.com/ClangBuiltLinux/linux/issues/1208 Reviewed By: dvyukov, nickdesaulniers Differential Revision: https://reviews.llvm.org/D92846 (cherry picked from commit c28b18af19621e6b5cca257ef7139ba93833df0c)
* | Merge commit '8511a8df838f' from llvm.org/release/11.x into ↵git apple-llvm automerger2020-12-142-17/+27
|\ \ | |/ | | | | apple/stable/20200714
| * [InstCombine] canonicalizeSaturatedAdd(): last fold is only valid for strict ↵Roman Lebedev2020-12-142-17/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | comparison (PR48390) We could create uadd.sat under incorrect circumstances if a select with -1 as the false value was canonicalized by swapping the T/F values. Unlike the other transforms in the same function, it is not invariant to equality. Some alive proofs: https://alive2.llvm.org/ce/z/emmKKL Based on original patch by David Green! Fixes https://bugs.llvm.org/show_bug.cgi?id=48390 Differential Revision: https://reviews.llvm.org/D92717 (cherry picked from commit e6f2a79d7aa01f8dd7f0194f97a50b480e8ede71)
* | Merge commit '934376da5851' from llvm.org/release/11.x into ↵git apple-llvm automerger2020-12-141-0/+178
|\ \ | |/ | | | | apple/stable/20200714
| * [NFC][InstCombine] Add test coverage for @llvm.uadd.sat canonicalizationRoman Lebedev2020-12-141-0/+178
| | | | | | | | | | | | | | | | | | | | The non-strict variants are already handled because they are canonicalized to strict variants by swapping hands in both the select and icmp, and the fold simply considers that strictness is irrelevant here. But that isn't actually true for the last pattern, as PR48390 reports. (cherry picked from commit f16320b90b8381f2e3aac1ec17f39eff06f09ea0)
* | Merge commit 'fc23bc9b30bf' from llvm.org/release/11.x into ↵git apple-llvm automerger2020-12-142-8/+12
|\ \ | |/ | | | | apple/stable/20200714
| * [SemaTemplate] Stop passing insertion position around during VarTemplate ↵Bruno Cardoso Lopes2020-12-142-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instantiation They can get stale at use time because of updates from other recursive specializations. Instead, rely on the existence of previous declarations to add the specialization. Differential Revision: https://reviews.llvm.org/D87853 (cherry picked from commit cffb0dd54d41d8e249d2009467c4beb5b681ba26) This is a re-commit of 8ac709578067f77a7036fe50610277516fa36d50 with some modifications to avoid changing the clang API.
* | Merge commit 'ca8de9ad8895' from llvm.org/release/11.x into ↵git apple-llvm automerger2020-12-142-0/+205
|\ \ | |/ | | | | apple/stable/20200714
| * [X86] Fix crash with i64 bitreverse on 32-bit targets with XOP.Craig Topper2020-12-142-0/+205
| | | | | | | | | | | | | | | | | | | | | | | | | | We unconditionally marked i64 as Custom, but did not install a handler in ReplaceNodeResults when i64 isn't legal type. This leads to ReplaceNodeResults asserting. We have two options to fix this. Only mark i64 as Custom on 64-bit targets and let it expand to two i32 bitreverses which each need a VPPERM. Or the other option is to add the Custom handling to ReplaceNodeResults. This is what I went with. (cherry picked from commit 57c0c4a27575840ae0a48eb9f8455a5ed087c857)
* | Merge commit 'abeec5d081f0' from llvm.org/release/11.x into ↵git apple-llvm automerger2020-12-113-10/+39
|\ \ | |/ | | | | apple/stable/20200714
| * [lldb] Report old modules from ModuleList::ReplaceEquivalentJoseph Tremoulet2020-12-113-10/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows the Target to update its module list when loading a shared module replaces an equivalent one. A testcase is added which hits this codepath -- without the fix, the target reports libbreakpad.so twice in its module list. Reviewed By: jingham Differential Revision: https://reviews.llvm.org/D89157 (cherry picked from commit d20aa7ca422145fb4d07e16c1d0aa7de9e3554ea)
* | Merge commit 'b618cf7a378d' from llvm.org/release/11.x into ↵git apple-llvm automerger2020-12-1413-112/+165
|\ \ | | | | | | | | | apple/stable/20200714
| * \ Merge commit 'b618cf7a378d' from llvm.org/release/11.x into ↵Jason Molenda2020-12-1413-112/+165
| |\ \ | | |/ | | | | | | apple/stable/20200714