| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Previously, we would erroneously turn %pcrel_lo(label), where label has
a %pcrel_hi against a weak symbol, into %pcrel_lo(label + offset), as
evaluatePCRelLo would believe the target independent logic was going to
fold it. Moreover, even if that were fixed, shouldForceRelocation lacks
an MCAsmLayout and thus cannot evaluate the %pcrel_hi fixup to a value
and check the symbol, so we would then erroneously constant-fold the
%pcrel_lo whilst leaving the %pcrel_hi intact. After D72197, this same
sequence also occurs for symbols with global binding, which is triggered
in real-world code.
Instead, as discussed in D71978, we introduce a new FKF_IsTarget flag to
avoid these kinds of issues. All the resolution logic happens in one
place, with no coordination required between RISCAsmBackend and
RISCVMCExpr to ensure they implement the same logic twice. Although the
implementation of %pcrel_hi can be left as target independent, we make
it target dependent to ensure that they are handled identically to
%pcrel_lo, otherwise we risk one of them being constant folded but the
other being preserved. This also allows us to properly support fixup
pairs where the instructions are in different fragments.
Reviewers: asb, lenary, efriedma
Reviewed By: efriedma
Subscribers: arichardson, hiraditya, rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73211
(cherry picked from commit 3f5976c97dbfefb4669abcf968bd79a9a64c18e0)
|
|
|
|
|
|
|
|
|
|
|
|
| |
When annotating a symbol with __declspec(selectany), Clang assigns it
comdat 2 while GCC assigns it comdat 3. This patch enables two object
files that contain a __declspec(selectany) symbol, one created by gcc
and the other by clang, to be linked together instead of issuing a
duplicate symbol error.
Differential Revision: https://reviews.llvm.org/D73139
(cherry picked from commit 9dbc1ab23268abce5db98ad9a1e3aef89c371524)
|
|
|
|
|
|
|
|
|
|
| |
After rGb4a99a061f517e60985667e39519f60186cbb469, passing a response file such as -Wp,@a.rsp wasn't working anymore because .rsp expansion happens inside clang's main() function.
This patch adds response file expansion in the -cc1 tool.
Differential Revision: https://reviews.llvm.org/D73120
(cherry picked from commit 68d7f06092e56b17eb0cddf560a9d9fe8afb7dd8)
|
|
|
|
|
|
|
|
|
|
|
| |
CLANG_LINK_CLANG_DYLIB=ON"
This reverts commit df839cfda09dbadc26b8be635f27da75f1f27190.
This change used cmake's list filter operation which was not added
until cmake 3.6.
(cherry picked from commit 4751e4f8c24bc07fdb668dc49ee559b97c1e3c22)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
We were linking all the clang objects and shared libraries into
libclang-cpp.so, which was causing the command line options to be
registered twice.
Reviewers: beanz, mgorny
Reviewed By: beanz, mgorny
Subscribers: mgorny, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68520
(cherry picked from commit df839cfda09dbadc26b8be635f27da75f1f27190)
|
|
|
|
| |
(cherry picked from commit e3d92b7442eaf3319f84bc060492df5b7ac3e9a1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
We don't have control/verify what will be the RHS of the division, so it might
happen to be zero, causing UB.
Reviewers: Vasilis, RKSimon, ABataev
Reviewed By: ABataev
Subscribers: vporpo, ABataev, hiraditya, llvm-commits, vdmitrie
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72740
(cherry picked from commit e1d6d368529322edc658c893c01eaadaf8053ea6)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: Vasilis, RKSimon, ABataev
Reviewed By: RKSimon, ABataev
Subscribers: ABataev, inglorion, dexonsmith, llvm-commits, vdmitrie
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72739
(cherry picked from commit 757fe53994c1792cbdc84526696a0e256345911f)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instantiations for BugproneBranchClone and ReadabilityBracesAroundStatements
Summary: fixes [[ https://bugs.llvm.org/show_bug.cgi?id=32203 | readability-braces-around-statements broken for if constexpr]] and [[ https://bugs.llvm.org/show_bug.cgi?id=44229 | bugprone-branch-clone false positive with template functions and constexpr ]] by disabling the relevant checks on if constexpr statements while inside an instantiated template. This is due to how the else branch of an if constexpr statement is folded away to a null statement if the condition evaluates to false
Reviewers: alexfh, hokein, aaron.ballman, xazax.hun
Reviewed By: aaron.ballman, xazax.hun
Subscribers: rnkovacs, JonasToth, Jim, lebedev.ri, xazax.hun, cfe-commits
Tags: #clang-tools-extra, #clang
Differential Revision: https://reviews.llvm.org/D71980
(cherry picked from commit f9c46229e4ac29053747c96e08c574c6c48d544b)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Without the BFI update, some hot blocks are incorrectly treated as cold code.
This fixes a FDO perf regression in the TSVC benchmark from D71288.
Reviewers: davidxl
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73146
(cherry picked from commit ddbc728828c70728473b47c9f7427aa9514f3d17)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes https://bugs.llvm.org/show_bug.cgi?id=44552. We need to make
sure that the store is reprocessed, because performing DSE may
expose more DSE opportunities.
There is a slight caveat here though: We need to make sure that we
add back the store the worklist first, because that means it will
be processed after the operands of the removed store have been
processed. This is a general bug in InstCombine worklist management
that I hope to address at some point, but for now it means we need
to do this manually rather than just returning the instruction as
changed.
Differential Revision: https://reviews.llvm.org/D72807
(cherry picked from commit 522c030aa9b1dd1881feb5a0d0fa2639b4a5feb7)
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the root def of for renaming is a noop-pseudo instruction like kill,
we would end up without a correct def for the renamed register, causing
miscompiles.
This patch conservatively bails out on any pseudo instruction.
This fixes https://bugs.chromium.org/p/chromium/issues/detail?id=1037912#c70
(cherry picked from commit 300997c41a00b705ca10264c15910dd8d691ab75)
|
|
|
|
|
|
|
|
|
|
|
|
| |
The 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 same problems. Could we either remove (in-process) from CC1Command::Print or add a line break?
Having the last line as a valid invocation is valuable and there might be tools relying on that."
Differential Revision: https://reviews.llvm.org/D72982
(cherry picked from commit 133a7e631cee97965e310f0d110739217427fd3d)
|
|
|
|
|
|
|
|
|
|
|
| |
This change replaces the manual building of executable paths
using llvm::sys::path::append with GetProgramPath.
This enables adding other paths in case executables reside
in different directories and makes the code easier to read.
Differential Revision: https://reviews.llvm.org/D72903
(cherry picked from commit 24d7a0935bea390fc444f6ac8cf02447fe8d6917)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MachineMemOperand
StackColoring::remapInstructions() remaps MachineOperand frame index (e.g. %stack.1 -> %stack.0)
but does not remap FixedStackPseudoSourceValue frame index (e.g. store 4 into %stack.1.ap2.i.i)
referenced by MachineMemoryOperand.
This can cause an assertion failure when LiveDebugValues references a dead stack object.
It is difficult to craft a test case. -g, va_copy and stack-coloring are required.
I can only reproduce it on ppc32.
(cherry picked from commit eaab1bf21e1d6803fd217fe6052537fc33b06837)
(cherry picked from commit 854f7be20a0cb1a95671a16d6cc8200107ee25f4)
(cherry picked from commit 7a8b0b1595e7dc878b48cf9bbaa652087a6895db)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
statements
Summary: This diff expands the SpacesAroundConditions option added in D68346 to include adding spaces to catch statements.
Reviewed By: MyDeveloperDay
Patch by: timwoj
Differential Revision: https://reviews.llvm.org/D72793
(cherry picked from commit ea2be452542c81b04621e26c0d5e83be565f07e2)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This essentially reverts b841e119d77ed0502e3a2e710f26a899bef28b3c.
Such code construct can be used in the following way:
// glibc/stdlib/exit.c
// clang -fuse-ld=lld => succeeded
// clang -fuse-ld=lld -fpie -pie => relocation R_PLT_PC cannot refer to absolute symbol
__attribute__((weak, visibility("hidden"))) extern void __call_tls_dtors();
void __run_exit_handlers() {
if (__call_tls_dtors)
__call_tls_dtors();
}
Since we allow R_PLT_PC in -no-pie mode, it makes sense to allow it in
-pie mode as well.
Reviewed By: pcc
Differential Revision: https://reviews.llvm.org/D72943
(cherry picked from commit 6ab89c3c5df8b679e6ee240a13356309c048fc71)
|
|
|
|
|
|
|
| |
implementation of some builtin""
This should no longer be necessary after
cd4c65f91d5 "Add __warn_memset_zero_len builtin as a workaround for glibc issue"
|
|
|
|
|
|
|
|
|
| |
This reverts commit 921f871ac438175ca8fcfcafdfcfac4d7ddf3905 because it
causes libc++ code to trigger __warn_memset_zero_len.
See https://reviews.llvm.org/D71082.
(cherry picked from commit 3d210ed3d1880c615776b07d1916edb400c245a6)
|
|
|
|
|
|
|
| |
This reverts commit 23058f9dd4d7e18239fd63b6da52549514b45fda. It breaks
builds of cuda code somehow in some cases.
(cherry picked from commit 6b29aa21180cf14bfb619d38fc4826913cabfb66)
|
|
|
|
|
|
|
|
|
|
|
| |
Fix the memory leak pointed out in https://reviews.llvm.org/D70412.
And a second one due to double-allocation.
Reviewed by: Hahnfeld
Differential revision: https://reviews.llvm.org/D72779
(cherry picked from commit 39f746d8def66ef8f5c4d3f1eb4c4cee4baac988)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This assertion was added as part of D70659 but did not account for .bss
input sections. I noticed that this assert was incorrectly triggering
while building FreeBSD for MIPS64. Fixed by relaxing the assert to also
account for SHT_NOBITS input sections and adjust the test
mips-jalr-non-function.s to link a file with a .bss section first.
Reviewed By: MaskRay, grimar
Differential Revision: https://reviews.llvm.org/D72567
(cherry picked from commit 441410be471d5d0a5d1d47cf363de155e397a0c2)
|
|
|
|
|
|
|
|
|
| |
The C11 API specifies that to initialize a recursive mutex,
mtx_plain | mtx_recursive should be used with mtx_init.
Differential Revision: https://reviews.llvm.org/D72809
(cherry picked from commit 3481e5d7ed08d068a4e3427cb1afcd8bf2acafdc)
|
|
|
|
|
|
|
|
|
| |
Glibc issue: https://sourceware.org/bugzilla/show_bug.cgi?id=25399
The fix consist in considering the missing function as a builtin lowered to a nop.
Differential Revision: https://reviews.llvm.org/D72869
(cherry picked from commit d293417931d3a9d46799b42795988ca3b5cfd766)
|
|
|
|
| |
(cherry picked from commit b78e8e0d79c47a6698a0abc10a37b8a253cb6064)
|
|
|
|
|
|
|
|
| |
This needs somewhat careful disambiguation, as C++2a explicit(bool) is a
breaking change. We only enable it in cases where the source construct
could not possibly be anything else.
(cherry picked from commit 45d70806f4386adfb62b0d75949a8aad58e0576f)
|
|
|
|
|
|
|
|
|
|
| |
expanded by the deduced pack.
We recently started also deducing the arity of separately-expanded packs
that are merely mentioned within the pack in question, which is
incorrect.
(cherry picked from commit e8f198dd9e9dabed8d50276465906e7c8827cada)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to -flax-vector-conversions=integer.
Summary:
See proposal on cfe-dev:
http://lists.llvm.org/pipermail/cfe-dev/2019-April/062030.html
Reviewers: SjoerdMeijer, eli.friedman
Subscribers: kristof.beyls, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D67678
(cherry picked from commit b72a8c65e4e34779b6bc9e466203f553f5294486)
|
|
|
|
|
|
| |
long, since clang's <altivec.h> doesn't provide it yet!
(cherry picked from commit 388eaa1270c2762d61b756759b6db8cf15bd3a83)
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix a place that became dependent on it.
This include file was created in October and has a "using namespace llvm". This seems to get exposed to other include files and finally onto cpp files. While this somewhat okay for llvm itself, its bad for other projects that use llvm as a library and includes a header file that picks this up. This was found by ISPC which has some class names at gloal scope with the same names as LLVM.
It looks like RISCV accidentally became dependent on this. I fixed it by reordering some includes in the RISCV code, but maybe we want to change the TableGenEmitter to put "namespace llvm {" in the generated file instead? But we probably want to do the simplest thing first so we can merge it to 10.0.
Differential Revision: https://reviews.llvm.org/D72895
(cherry picked from commit caee96031d3be9f951e4a17c8d3fb1c8b748fb31)
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`{clang,gcc} -nostdlib -r a.c` passes --dynamic-linker to the linker,
and the expected behavior is to ignore it.
If .interp is kept in the relocatable object file, a final link will get
PT_INTERP even if --dynamic-linker is not specified. glibc ld.so expects
to see PT_DYNAMIC and the executable will likely fail to run.
Ignore --dynamic-linker in -r mode as well as -shared.
(cherry picked from commit 2d7a8cf90478cd845ffb39763b0e95b7715322d2)
|
|
|
|
|
|
|
| |
This reverts commit 4624a1e8ac8a3f69cc887403b976f538f587744a. Causing
problems downstream.
(cherry picked from commit 0133cc60e4e230ee2c176c23eff5aa2f4ee17a75)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Flags are clang's default UI is flags.
We can have an env var in addition to that, but in D69825 nobody has yet
mentioned why this needs an env var, so omit it for now. If someone
needs to set the flag via env var, the existing CCC_OVERRIDE_OPTIONS
mechanism works for it (set CCC_OVERRIDE_OPTIONS=+-fno-integrated-cc1
for example).
Also mention the cc1-in-process change in the release notes.
Also spruce up the test a bit so it actually tests something :)
Differential Revision: https://reviews.llvm.org/D72769
(cherry picked from commit 8e5018e990b701391e6c33ba85b012343df67272)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Support @llvm.{return,frame}address selection."
These intrinsics expand to a variable number of instructions so just like in
ISelLowering.cpp we use custom code to deal with them.
Committing Tim's original patch.
Differential Revision: https://reviews.llvm.org/D65656
----
Breaks EXPENSIVE_CHECKS builds.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
if users don't specific -mattr, the default target-feature come
from IR attribute.
Reviewers: lenary, asb
Reviewed By: lenary, asb
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70837
|
|
|
|
| |
This reverts commit 109e4d12edda07bdec139de36d9fdb6f73399f92.
|
| |
|
|
|
|
| |
Fixes "pointer is null" clang static analyzer warning.
|
|
|
|
| |
Use cast<> instead of dyn_cast<> since the pointer is always dereferenced and cast<> will perform the null assertion for us.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Note: this is a reland with a trivial 2 lines fix in ELFState<ELFT>::writeSectionContent.
It adds a check similar to ones we already have for other sections to fix the case revealed
by bots, like http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/60744.
The encoded sequence of Elf*_Relr entries in a SHT_RELR section looks
like [ AAAAAAAA BBBBBBB1 BBBBBBB1 ... AAAAAAAA BBBBBB1 ... ]
i.e. start with an address, followed by any number of bitmaps. The address
entry encodes 1 relocation. The subsequent bitmap entries encode up to 63(31)
relocations each, at subsequent offsets following the last address entry.
More information is here:
https://github.com/llvm-mirror/llvm/blob/master/lib/Object/ELF.cpp#L272
This patch adds a support for these sections.
Differential revision: https://reviews.llvm.org/D71872
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This patch adds a new function to lldbtest: `expect_expr`. This function is supposed to replace the current approach
of calling `expect`/`runCmd` with `expr`, `p` etc.
`expect_expr` allows evaluating expressions and matching their value/summary/type/error message without
having to do any string matching that might allow unintended passes (e.g., `self.expect("expr 3+4", substrs=["7"])`
can unexpectedly pass for results like `(Class7) $0 = 7`, `(int) $7 = 22`, `(int) $0 = 77` and so on).
This only uses the function in a few places to test and demonstrate it. I'll migrate the tests in follow up commits.
Reviewers: JDevlieghere, shafik, labath
Reviewed By: labath
Subscribers: christof, abidh, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D70314
|
|
|
|
| |
in Release builds
|
|
|
|
|
|
| |
Summary:
Test case test14 is missing, adjust the numbering to have a consecutive range.
Also a test commit to verify commit access.
|
|
|
|
| |
Add the missing picture for the documentation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-fdollars-in-identifiers flag.
Summary:
Previously, the -fdollars-in-identifiers flag allows the '$' symbol to be used
in an identifier but the universal character name equivalent '\u0024' is not
allowed.
This patch changes this, so that \u0024 is valid in identifiers.
Reviewers: rsmith, jordan_rose
Reviewed By: rsmith
Subscribers: dexonsmith, simoncook, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71758
|
|
|
|
|
|
| |
This reverts commit 46d11e30ee807accefd14e0b7f306647963a39b5.
It broke bots. E.g. http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/60744
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
LLVM_THREAD_LOCAL
Windows minimum host tools version is now VS2017, which supports C++11
thread_local so use this for LLVM_THREAD_LOCAL instead of
declspec(thread). According to [1], thread_local is implemented with
declspec(thread) so this should be NFC.
[1] https://docs.microsoft.com/en-us/cpp/cpp/thread?view=vs-2017
Differential Revision: https://reviews.llvm.org/D72399
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Implements the following intrinsics:
* @llvm.aarch64.sve.ptest.any
* @llvm.aarch64.sve.ptest.first
* @llvm.aarch64.sve.ptest.last
Reviewers: sdesmalen, efriedma, dancgr, mgudim, cameron.mcinally, rengolin
Reviewed By: efriedma
Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72398
|