summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Do not declare compiler extension member as constserge-sans-paille2020-06-171-1/+1
| | | | | | It keeps them default constructible. (cherry picked from commit e307eeba0137700e75893089cf0de03383d851ca)
* Update compiler extension integration into the build systemserge-sans-paille2020-06-1712-22/+113
| | | | | | | | | | | | The approach here is to create a new (empty) component, `Extensions', where all statically compiled extensions dynamically register their dependencies. That way we're more natively compatible with LLVMBuild and llvm-config. Fixes: https://bugs.llvm.org/show_bug.cgi?id=44870 Differential Revision: https://reviews.llvm.org/D78192 (cherry picked from commit 8f766e382b77eef3102798b49e087d1e4804b984)
* [nfc] Cleanup extension header generationserge-sans-paille2020-06-171-6/+7
| | | | (cherry picked from commit f44a508df629ecc97e0b1345726b12f25927409e)
* Fix compiler extension in standalone modeserge-sans-paille2020-06-174-35/+35
| | | | | | | | | | | | Use a dedicated cmake file to store the extension configured within LLVM. That way, a standalone build of clang can load this cmake file and get all the configured standalone extensions. This patch is related to https://reviews.llvm.org/D74602 Differential Revision: https://reviews.llvm.org/D74757 (cherry picked from commit 3a0f6e699bb6d96dc62dce6faef20ac26cf103fd)
* Fix standalone build interaction with compiler extensionserge-sans-paille2020-06-172-21/+40
| | | | | | | | | | | | As suggested in https://github.com/llvm/llvm-project/issues/120, don't try to generate the extension file from clang, only do the linking step. Fixes the regression introduced in D74464 when running cmake inside the clang directory. Differential Revision: https://reviews.llvm.org/D74602 (cherry picked from commit 87dac7da68ea1e0adac78c59ef1891dcf9632b67)
* Fix integration of pass plugins with llvm dylibserge-sans-paille2020-06-172-2/+2
| | | | | | | | Call llvm_process_pass_plugin from clang when in standalone mode. Differential Revision: https://reviews.llvm.org/D74464 (cherry picked from commit d21664cce1db8debe2528f36b1fbd2b8af9c9401)
* Fix alignment of thunks for ARM/ARM64Martin Storsjö2020-06-173-16/+30
| | | | | | | | | | | | | | The alignment of ARM64 range extension thunks was fixed in 7c816492197a, but ARM range extension thunks, and import and delay import thunks also need aligning (like all code on ARM platforms). I'm adding a test for alignment of ARM64 import thunks - not specifically adding tests for misalignment of all of them though. Differential Revision: https://reviews.llvm.org/D77796 (cherry picked from commit 12c9e2f1110a4fc73562214cf5dd0194b31e87cf)
* [AARch64] Add Marvell ThunderX3T110 supportWei Zhao2020-06-1722-16/+2101
| | | | | | | | | | | This is the first checkin to support Marvell ThunderX3T110. Initial definition of the micro-ops of the instructions in ThunderX3T110 is included. Differential Revision: https://reviews.llvm.org/D78129 (cherry picked from commit 382d3a85e2a9269569e7fb8caa487d7ef57900c6)
* [X86] make sure POP has implicit def/use of stack pointer when materializing ↵Yuanfang Chen2020-06-172-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8-bit immediates for minsize Summary: Otherwise PostRA list scheduler may reorder instruction, such as schedule this ''' pushq $0x8 pop %rbx lea 0x2a0(%rsp),%r15 ''' to ''' pushq $0x8 lea 0x2a0(%rsp),%r15 pop %rbx ''' by mistake. The patch is to prevent this to happen by making sure POP has implicit use of SP. Reviewers: craig.topper Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D77031 (cherry picked from commit ece79f47083babcabde3700c67b90ef19967a5b3)
* [ELF] Don't cause assertion failure if --dynamic-list or --version-script ↵Fangrui Song2020-06-163-1/+14
| | | | | | | | | takes an empty file Fixes PR46184 Report line 1 of the last memory buffer. (cherry picked from commit ac6abc99e2794e4674a8498f817fda19b176bbfe)
* [IndVarSimplify][LoopUtils] Avoid TOCTOU/ordering issues (PR45835)Tom Stellard2020-06-162-34/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Currently, `rewriteLoopExitValues()`'s logic is roughly as following: > Loop over each incoming value in each PHI node. > Query whether the SCEV for that incoming value is high-cost. > Expand the SCEV. > Perform sanity check (`isValidRewrite()`, D51582) > Record the info > Afterwards, see if we can drop the loop given replacements. > Maybe perform replacements. The problem is that we interleave SCEV cost checking and expansion. This is A Problem, because `isHighCostExpansion()` takes special care to not bill for the expansions that were already expanded, and we can reuse. While it makes sense in general - if we know that we will expand some SCEV, all the other SCEV's costs should account for that, which might cause some of them to become non-high-cost too, and cause chain reaction. But that isn't what we are doing here. We expand *all* SCEV's, unconditionally. So every next SCEV's cost will be affected by the already-performed expansions for previous SCEV's. Even if we are not planning on keeping some of the expansions we performed. Worse yet, this current "bonus" depends on the exact PHI node incoming value processing order. This is completely wrong. As an example of an issue, see @dmajor's `pr45835.ll` - if we happen to have a PHI node with two(!) identical high-cost incoming values for the same basic blocks, we would decide first time around that it is high-cost, expand it, and immediately decide that it is not high-cost because we have an expansion that we could reuse (because we expanded it right before, temporarily), and replace the second incoming value but not the first one; thus resulting in a broken PHI. What we instead should do for now, is not perform any expansions until after we've queried all the costs. Later, in particular after `isValidRewrite()` is an assertion (D51582) we could improve upon that, but in a more coherent fashion. See [[ https://bugs.llvm.org/show_bug.cgi?id=45835 | PR45835 ]] Reviewers: dmajor, reames, mkazantsev, fhahn, efriedma Reviewed By: dmajor, mkazantsev Subscribers: smeenai, nikic, hiraditya, javed.absar, llvm-commits, dmajor Tags: #llvm Differential Revision: https://reviews.llvm.org/D79787 (cherry picked from commit b2df96123198deadad74634c978e84912314da26)
* [AArch64] Fix BTI instruction emission.Daniel Kiss2020-06-162-5/+15
| | | | | | | | | | | | | | | | | | | | | | Summary: SCTLR_EL1.BT[01] controls the PACI[AB]SP compatibility with PBYTE 11 (see [1]) This bit will be set to zero so PACI[AB]SP are equal to BTI C instruction only. [1] https://developer.arm.com/docs/ddi0595/b/aarch64-system-registers/sctlr_el1 Reviewers: chill, tamas.petz, pbarrio, ostannard Reviewed By: tamas.petz, ostannard Subscribers: kristof.beyls, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D81746 (cherry picked from commit b8ae3fdfa579dbf366b1bb1cbfdbf8c51db7fa55)
* [AArch64] Fix BTI landing pad generation.Daniel Kiss2020-06-162-0/+35
| | | | | | | | | | In some cases BTI landing pad is inserted even compatible instruction was there already. Meta instruction does not count in this case therefore skip them in the check for first instructions in the function. Differential revision: https://reviews.llvm.org/D74492 (cherry picked from commit d5a186a60014dc1a8c979c978cb32aba7ecb9102)
* [lld][ELF] Mark empty NOLOAD output sections SHT_NOBITS instead of SHT_PROGBITSMatt Schulte2020-06-162-3/+6
| | | | | | | | | | | This fixes PR# 45336. Output sections described in a linker script as NOLOAD with no input sections would be marked as SHT_PROGBITS. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D76981 (cherry picked from commit fdc41aa22c60958e6b6df461174b814a4aae3384)
* [ELF][test] Make tests less address sensitive and delete redundant testsFangrui Song2020-06-167-164/+22
| | | | (cherry picked from commit 09ac859c136b406231ef7547f3800111dd00bc7e)
* [X86] Fold undef elts to 0 in getTargetVShiftByConstNode.Craig Topper2020-06-162-17/+20
| | | | | | | | Similar to D81212. Differential Revision: https://reviews.llvm.org/D81292 (cherry picked from commit 3408dcbdf054ac3cc32a97a6a82a3cf5844be609)
* [X86] Teach combineVectorShiftImm to constant fold undef elements to 0 not ↵Craig Topper2020-06-162-4/+12
| | | | | | | | | | | | | | undef. Shifts are supposed to always shift in zeros or sign bits regardless of their inputs. It's possible the input value may have been replaced with undef by SimplifyDemandedBits, but the shift in zeros are still demanded. This issue was reported to me by ispc from 10.0. Unfortunately their failing test does not fail on trunk. Seems to be because the shl is optimized out earlier now and doesn't become VSHLI. ispc bug https://github.com/ispc/ispc/issues/1771 Differential Revision: https://reviews.llvm.org/D81212 (cherry picked from commit 7c9a89fed8f5d53d61fe3a61a2581a7c28b1b6d2)
* lit googletest.py: Don't raise StopIteration in generatorHans Wennborg2020-06-161-1/+1
| | | | | | | | | | The intention here seems to be to end the generator function, but with modern Python, raising StopIteration causes a runtime error (https://www.python.org/dev/peps/pep-0479/). Differential revision: https://reviews.llvm.org/D79169 (cherry picked from commit 88aad9b9f05702585eb823d0188996f4cf62070a)
* [clangd] Use printf instead of `echo -e` to be compliant with dashKadir Cetinkaya2020-06-161-2/+2
| | | | (cherry picked from commit ca1c21d4b659bfa5edb38c4a54b3050e43c4b51a)
* [clangd] Disable dependency-output lit test on windowsKadir Cetinkaya2020-06-161-0/+1
| | | | (cherry picked from commit a940a246f5e14a8fd44586f609b8a675eb949469)
* ValueMapper does not preserve inline assembly dialect when remapping the typeCraig Topper2020-06-111-1/+2
| | | | | | | | | | Bug report: https://bugs.llvm.org/show_bug.cgi?id=45291 Patch by Tomasz Miąsko Differential Revision: https://reviews.llvm.org/D80066 (cherry picked from commit 5f65faef2c61bfb5e041f74db61665f43a05e9db)
* [X86] Add x, t and g modifiers for inline asmCraig Topper2020-06-113-3/+100
| | | | | | | | | | | | This patch adds the x, t and g modifiers for inline asm from GCC. These will print a vector register as xmm*, ymm* or zmm* respectively. I also fixed register names with modifiers with inteldialect so they are no longer printed with a leading %. Patch by Amanieu d'Antras Differential Revision: https://reviews.llvm.org/D78977 (cherry picked from commit c5f7c039efe7ff09a44cfd252f6cb001ceed6269)
* [clangd] Preserve -nostdinc and --sysroot when calling query driverKadir Cetinkaya2020-06-102-13/+47
| | | | | | | | | | | | | | Solves this issue: https://github.com/clangd/clangd/issues/157 This is my first contribution to an llvm project, so I hope I'm doing it right! Patch by @topisani (Tobias Pisani)! Reviewers: kadircet, klimek Differential Revision: https://reviews.llvm.org/D73811 (cherry picked from commit 6e8d6bc9ec8739ec22b73a23f740f171f452e234)
* [clangd] Fix a crash for accessing a null template decl returned by ↵Haojian Wu2020-06-102-9/+37
| | | | | | | | | | | | | | | | | | | findExplicitReferences. Summary: Fixes https://github.com/clangd/clangd/issues/347. Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D78626 (cherry picked from commit 7d1ee639cb9efea364bec90afe4d1161ec624a7f) Includes some test-only changes from f651c402a221a20f3bc6ea43f70b29326a357010 to support the cherry-picked tests. Test tweaked slightly as it exhibits a separate bug that was fixed on master.
* [Syntax] Merge overlapping top-level macros in TokenBufferSam McCall2020-06-102-9/+50
| | | | | | | | | | | | | | | | | | | Summary: Our previous definition of "top-level" was too informal, and didn't allow for overlapping macros that each directly produce expanded tokens. See D77507 for previous discussion. Fixes http://bugs.llvm.org/show_bug.cgi?id=45428 Reviewers: kadircet, vabridgers Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D77615 (cherry picked from commit d66afd6dde542dc373f87e07fe764c071fe20d76)
* [Syntax] Simplify TokenCollector::Builder, use captured expansion bounds. NFCSam McCall2020-06-101-158/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The motivation here is fixing https://bugs.llvm.org/show_bug.cgi?id=45428, see D77507. The fundamental problem is that a "top-level" expansion wasn't precisely defined. Repairing this concept means that TokenBuffer's "top-level expansion" may not correspond to a single macro expansion. Example: ``` M(2); // expands to 1+2 ``` The expansions overlap, but neither expansion alone yields all the tokens. We need a TokenBuffer::Mapping that corresponds to their union. This is fairly easy to fix in CollectPPExpansions, but the current design of TokenCollector::Builder needs a fix too as it relies on the macro's expansion range rather than the captured expansion bounds. This fix is hard to make due to the way code is reused within Builder. And honestly, I found that code pretty hard to reason about too. The new approach doesn't use the expansion range, but only the expansion location: it assumes an expansion is the contiguous set of expanded tokens with the same expansion location, which seems like a reasonable formalization of the "top-level" notion. And hopefully the control flow is easier to follow too, it's considerably shorter even with more documentation. Reviewers: kadircet Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D77614 (cherry picked from commit ec0b9908952a9f4a19c3eb92ba0fc01cffcb8614)
* [clangd] Increase stack size of the new threads on macOSSam McCall2020-06-102-10/+32
| | | | | | | | | | | | | | | | | | | | Summary: By default it's 512K, which is way to small for clang parser to run on. There is no way to do it via platform-independent API, so it's implemented via pthreads directly in clangd/Threading.cpp. Fixes https://github.com/clangd/clangd/issues/273 Patch by Dmitry Kozhevnikov! Reviewers: ilya-biryukov, sammccall, arphaman Reviewed By: ilya-biryukov, sammccall, arphaman Subscribers: dexonsmith, umanwizard, jfb, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D50993 (cherry picked from commit 69a39dc1f0d08ea43bac03a87bb8bff3937ce2e7)
* [clangd] Make use of SourceOrder to find first initializer in DefineOutlineKadir Cetinkaya2020-06-102-11/+45
| | | | | | | | | | | | | | | | | | | | | Summary: Constructors can have implicit initializers, this was crashing define outline. Make sure we find the first "written" ctor initializer to figure out `:` location. Fixes https://github.com/clangd/clangd/issues/400 Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D80521 (cherry picked from commit eeedbd033612e105755156023bdeec2fba4eca21) Fixes https://github.com/clangd/clangd/issues/418
* [clangd] Filter pch related flags coming from the userKadir Cetinkaya2020-06-101-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: PCH format is unstable, hence using a preamble built with a different version of clang (or even worse, a different compiler) might result in unexpected behaviour. PCH creation on the other hand is something clangd wouldn't want to perform, as it doesn't generate any output files. This patch makes sure clangd drops any PCH related compile commands after parsing the command line args. Fixes https://github.com/clangd/clangd/issues/248 Reviewers: sammccall Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D79669 (cherry picked from commit 35d867a790c2bcf2008b2ee1895ae8af2793b797) Dropped the test as it depends on nontrivial changes from master. The code is very simple and identical to that tested on master. Fixes https://github.com/clangd/clangd/issues/419
* [clangd] Fix early selection for non-vardecl declaratorsKadir Cetinkaya2020-06-103-6/+30
| | | | | | | | | | | | | | | | | | | | | | | Summary: Selection tree was performing an early claim only for VarDecls, but there are other cases where we can have declarators, e.g. FieldDecls. This patch extends the early claim logic to all types of declarators. Fixes https://github.com/clangd/clangd/issues/292 Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D75106 (cherry picked from commit e6b8181895b96740dbe54aca036aa237e0a8363d) Modified the cherry-picked test as diagnostics differ on the branch. Fixes https://github.com/clangd/clangd/issues/421
* [clangd] Disable all dependency outputsKadir Cetinkaya2020-06-102-0/+21
| | | | | | | | | | | | | | | | Summary: Fixes https://github.com/clangd/clangd/issues/322 Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D78833 (cherry picked from commit 294b9d43cae77ea15453ec82203368903db4f538) Fixes https://github.com/clangd/clangd/issues/422
* [clangd][Hover] Handle uninstantiated default argsKadir Cetinkaya2020-06-102-2/+32
| | | | | | | | | | | | | | | | | | | Summary: Default args might exist but be unparsed or uninstantiated. getDefaultArg asserts on those. This patch makes sure we don't crash in such scenarios. Reviewers: sammccall, ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D73723 (cherry-picked from commit 9c903d0373ff940f9143efab8d948edf776de9f1) Fixes https://github.com/clangd/clangd/issues/424
* [clang] Fix crash on visiting null nestedNameSpecifier.Haojian Wu2020-06-102-1/+10
| | | | | | | | | | | | | | Summary: Fix https://github.com/clangd/clangd/issues/293 Reviewers: sammccall Subscribers: ilya-biryukov, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D76320 (cherry picked from commit bd763e2cf7c1d84bab95064cc5cbe542b227b025)
* PR45063: Fix crash on invalid processing an elaborated class template-idRichard Smith2020-06-102-0/+7
| | | | | | with an invalid scope specifier. (cherry picked from commit 44c3a63c74dddeef17e424ec76bd90c8582d8a3c)
* [clang] Persist Attr::IsPackExpansion into the PCHNathan Ridge2020-06-102-0/+28
| | | | | | | | | | | | Summary: Fixes https://github.com/clangd/clangd/issues/309 Subscribers: ilya-biryukov, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D77194 (cherry picked from commit 8b3b7556e9ab6084e9fd337d64dac1c165867d32)
* [clangd] Don't assert when completing a lambda variable inside the lambda.Sam McCall2020-06-105-6/+45
| | | | | | | | | | | | | | | | | | | Summary: This is a fairly ugly hack - we back off several features for any variable whose type isn't deduced, to avoid computing/caching linkage. Better suggestions welcome. Fixes https://github.com/clangd/clangd/issues/274 Reviewers: kadircet, kbobyrev Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D73960 (cherry picked from commit 2629035a009095f62f48413e175437261165ecd7)
* [clangd] Fix modernize-loop-convert "multiple diag in flight" crash.Haojian Wu2020-06-102-9/+35
| | | | | | | | | | | | | | | | | Summary: this maybe not ideal, but it is trivial and does fix the crash. Fixes https://github.com/clangd/clangd/issues/156. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D78715 (cherry picked from commit a466e4be3831848d7ff6ffbe4f57d99de8fb66af)
* [clangd] Add the missing elaborated types in FindTarget.Haojian Wu2020-06-102-0/+11
| | | | | | | | | | | | Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D74025 (cherry picked from commit eaf0c89ec5f866b6cef296c542c030bb2cf8481d)
* [clangd] Handle the missing injectedClassNameType in targetDecl.Haojian Wu2020-06-102-0/+13
| | | | | | | | | | | | Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D73102 (cherry picked from commit 5d4e89975714875a86cb8e62b60d93eebefa4029)
* [clangd] Fix null check in FindTarget.Sam McCall2020-06-101-1/+1
| | | | | | | I've hit this stack trace a few times but don't have a good reproducer. The code is unsafe by inspection, though. (cherry picked from commit 9a5c448a31bacc08e73fcae4636094f9b6e2be6a)
* Don't jump to landing pads in Control Flow OptimizerArthur Eubanks2020-05-282-8/+38
| | | | | | | | | | | | Summary: Likely fixes https://bugs.llvm.org/show_bug.cgi?id=45858. Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D80047 (cherry picked from commit fc937806efd71eb3803b35d0920bb7d76bc3040b)
* [arm] Add big-endian version of pcrel fixups for adr instructionsDimitry Andric2020-05-192-12/+10
| | | | | | | | | | | | | | | | | | | | Summary: In 2e24219d3cbf, a number of ARM pcrel fixups were resolved at assembly time, to solve PR44929. This only covered little-endian ARM however, so add similar fixups for big-endian ARM. Also extend the test case to cover big-endian ARM. Reviewers: hans, psmith, MaskRay Reviewed By: psmith, MaskRay Subscribers: kristof.beyls, hiraditya, danielkiss, emaste, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D79774 (cherry picked from commit fc373522b044e0b150561204958f0d603fb4caba)
* [ARM] Only produce qadd8b under hasV6OpsDavid Green2020-05-192-1/+2
| | | | | | | | | | | | | | When compiling for a arm5te cpu from clang, the +dsp attribute is set. This meant we could try and generate qadd8 instructions where we would end up having no pattern. I've changed the condition here to be hasV6Ops && hasDSP, which is what other parts of ARMISelLowering seem to use for similar instructions. Fixed PR45677. Differential Revision: https://reviews.llvm.org/D78877 (cherry picked from commit 8807139026b64ac40163bb255dad38a1d8054f08)
* [PowerPC] Do not attempt to reuse load for 64-bit FP_TO_UINT without FPCVTNemanja Ivanovic2020-05-192-2/+62
| | | | | | | | | | | | We call the function that attempts to reuse the conversion without checking whether the target matches the constraints that the callee expects. This patch adds the check prior to the call. Fixes: https://bugs.llvm.org/show_bug.cgi?id=43976 Differential revision: https://reviews.llvm.org/D77564 (cherry picked from commit 64b31d96dfd6c05e6d52d8798726dec60502cfde)
* [WebAssembly] Add section names for some DWARF5 sectionsDerek Schuff2020-05-191-1/+11
| | | | | | | | | | | | Summary: Addresses PR44728 but no tests because I've not yet made any attempt to verify correctness of the debug info. Reviewers: sbc100, aardappel Differential Revision: https://reviews.llvm.org/D74656 (cherry picked from commit 2504f14a06872f2e1755a88b3aab7e6bc280bec7)
* [clang] fix undefined behaviour in RawComment::getFormattedText()Oliver Bruns2020-05-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Calling `back()` and `pop_back()` on the empty string is undefined behavior [1,2]. The issue manifested itself as an uncaught `std::out_of_range` exception when running `clangd` compiled on RHEL7 using devtoolset-9. [1] https://en.cppreference.com/w/cpp/string/basic_string/back [2] https://en.cppreference.com/w/cpp/string/basic_string/pop_back Fixes: 1ff7c32fc91c607b690d4bb9cf42f406be8dde68 Reviewers: teemperor, ioeric, cfe-commits Reviewed By: teemperor Subscribers: ilya-biryukov, kadircet, usaxena95 Tags: #clang Differential Revision: https://reviews.llvm.org/D77468 (cherry picked from commit ad7211df6f257e39da2e5a11b2456b4488f32a1e)
* [globalopt] Don't emit DWARF fragments for membersDavid Spickett2020-05-182-6/+79
| | | | | | | | | | | | | | | | of a struct that cover the whole struct This can happen when the rest of the members of are zero length. Following the same pattern applied to the SROA pass in: d7f6f1636d53c3e2faf55cdf20fbb44a1a149df1 Fixes: https://bugs.llvm.org/show_bug.cgi?id=45335 Differential Revision: https://reviews.llvm.org/D78720 (cherry picked from commit 3929429347d398773577b79f7fdb780d4f7ed887)
* Backport 4878aa36d4a [ValueLattice] Add new state for undef constants.Florian Hahn2020-05-1810-68/+1018
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: NOTE: I mostly put it on Phabricator to make it easy for other people to fetch & check if that fixes a bug. This patch backports 4878aa36d4a and required earlier patches onto the release/10.x branch. It includes the following patches: aa5ebfdf205de6d599c1fed3161da3b63b6f0bef [ValueLattice] Make mark* functions public, return if value changed. c1943b42c5b7feff5d0e0c1358d02889e2be165f [ValueLattice] Update markConstantRange to return false equal ranges. e30c257811f62fea21704caa961c61e4559de202 [CVP,SCCP] Precommit test for D75055. 4878aa36d4aa27df644430139fab2734fde4a000 [ValueLattice] Add new state for undef constants. All patches except the last one apply cleanly. For the last one, the changes to SCCP.cpp were stripped, because SCCP does not yet use ValueLattice on release/10.x. Otherwise we would have to pull in more additional changes. Subscribers: tstellar, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D76596
* Enable IBT(Indirect Branch Tracking) in JIT with CET(Control-flow ↵Xiang1 Zhang2020-05-184-8/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enforcement Technology) Do not commit the llvm/test/ExecutionEngine/MCJIT/cet-code-model-lager.ll because it will cause build bot fail(not suitable for window 32 target). Summary: This patch comes from H.J.'s https://github.com/hjl-tools/llvm-project/commit/2bd54ce7fa9e94fcd1118b948e14d1b6fc54dfd2 **This patch fix the failed llvm unit tests which running on CET machine. **(e.g. ExecutionEngine/MCJIT/MCJITTests) The reason we enable IBT at "JIT compiled with CET" is mainly that: the JIT don't know the its caller program is CET enable or not. If JIT's caller program is non-CET, it is no problem JIT generate CET code or not. But if JIT's caller program is CET enabled, JIT must generate CET code or it will cause Control protection exceptions. I have test the patch at llvm-unit-test and llvm-test-suite at CET machine. It passed. and H.J. also test it at building and running VNCserver(Virtual Network Console), it works too. (if not apply this patch, VNCserver will crash at CET machine.) Reviewers: hjl.tools, craig.topper, LuoYuanke, annita.zhang, pengfei Reviewed By: LuoYuanke Subscribers: tstellar, efriedma, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D76900 (cherry picked from commit 01a32f2bd3fad4331cebe9f4faa270d7c082d281)
* CET for Exception HandlePengfei Wang2020-05-182-3/+41
| | | | | | | | | | | | | | | | | | Summary: Bug fix for https://bugs.llvm.org/show_bug.cgi?id=45182 Exception handle may indirectly jump to catch pad, So we should add ENDBR instruction before catch pad instructions. Reviewers: craig.topper, hjl.tools, LuoYuanke, annita.zhang, pengfei Reviewed By: LuoYuanke Subscribers: hiraditya, llvm-commits Patch By: Xiang Zhang (xiangzhangllvm) Differential Revision: https://reviews.llvm.org/D76190 (cherry picked from commit 974d649f8eaf3026ccb9d1b77bdec55da25366e5)
OpenPOWER on IntegriCloud