Commit Graph

316001 Commits

Author SHA1 Message Date
Nico Weber a3ff5727b7 [compiler-rt] Make builtins test pass when using i386 gcc as host compiler
Just-built-clang is used to compile the test, but the library is built
with gcc, so the usual 80-bit FPU vs 32-bit SSE mismatch makes the
floating computations not bitwise identical. Fixes PR32910, see there
for details.

This uses the same technique used in all the other *c3* tests, see in
particular mulsc3_test.c.

(It might be cleaner to add compareResultCF to fp_test.h to force the
floats into 32-bit in memory, but this is the less invasive fix.)

Differential Revision: https://reviews.llvm.org/D61684

llvm-svn: 360264
2019-05-08 15:50:21 +00:00
Simon Pilgrim e3eec06dde [AMDGPU] Reapplied BFE canonicalization from D60462
This was committed in rL358887 but reverted in rL360066 due to a x86 regression, really it should be have been pre-committed instead of being part of the SimplifyDemandedBits bitcast patch.

llvm-svn: 360263
2019-05-08 15:49:10 +00:00
David Greene 6c433713e9 [Reassociation] Place moved instructions after landing pads
Reassociation's NegateValue moved instructions to the beginning of
blocks (after PHIs) without checking for exception handling pads.
It's possible for reassociation to move something into an exception
handling block so we need to make sure we don't move things too early
in the block.  This change advances the insertion point past any
exception handling pads.

If the block we want to move into contains a catchswitch, we cannot
move into it.  In that case just create a new neg as if we had not
found an existing neg to move.

Differential Revision: https://reviews.llvm.org/D61089

llvm-svn: 360262
2019-05-08 15:44:24 +00:00
Gabor Marton ce6b78128f [ASTImporter] Fix inequivalence of unresolved exception spec
Summary:
Structural equivalence of methods can falsely report false when the
exception specifier is unresolved (i.e unevaluated or not instantiated).

(This caused one assertion during bitcoin ctu-analysis.)

Reviewers: a_sidorin, shafik, a.sidorin

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D61424

llvm-svn: 360261
2019-05-08 15:23:48 +00:00
Nikita Popov 9fd02a71a3 Revert "[ValueTracking] Improve isKnowNonZero for Ints"
This reverts commit 3b137a4956.

As reported in https://reviews.llvm.org/D60846, this is causing
miscompiles.

llvm-svn: 360260
2019-05-08 14:50:01 +00:00
Petar Jovanovic 4964e3837e [Support] Fix unit test for fs::is_local
Close the temporary file after the test is done using it.
If it is not closed and the file was created on NFS, it will cause the test
to fail. The problem happens in the cleanup process afterwards. It first
tries to delete the file but it is not really deleted. Afterwards, the
program fails to delete the directory containing the file, causing the whole
test to fail.

Patch by Milos Stojanovic.

llvm-svn: 360259
2019-05-08 14:42:13 +00:00
Anastasia Stulova 5b6dda33d1 [Sema][OpenCL] Make address space conversions a bit stricter.
The semantics for converting nested pointers between address
spaces are not very well defined. Some conversions which do not
really carry any meaning only produce warnings, and in some cases
warnings hide invalid conversions, such as 'global int*' to
'local float*'!

This patch changes the logic in checkPointerTypesForAssignment
and checkAddressSpaceCast to fail properly on implicit conversions
that should definitely not be permitted. We also dig deeper into the
pointer types and warn on explicit conversions where the address
space in a nested pointer changes, regardless of whether the address
space is compatible with the corresponding pointer nesting level
on the destination type.

Fixes PR39674!

Patch by ebevhan (Bevin Hansson)!

Differential Revision: https://reviews.llvm.org/D58236

llvm-svn: 360258
2019-05-08 14:23:49 +00:00
Owen Pan 4ba5269f33 [clang-format] Fix the crash when formatting unsupported encodings
Fixes PR33946

Differential Revision: https://reviews.llvm.org/D61559

llvm-svn: 360257
2019-05-08 14:11:12 +00:00
Owen Pan d064c71802 [clang] Fix a bug that reports UTF32 (LE) files as UTF16 (LE) ones
Also fix a typo for the SCSU byte order mark.

Differential Revision: https://reviews.llvm.org/D61628

llvm-svn: 360256
2019-05-08 13:49:17 +00:00
Simon Pilgrim e622451823 [ADT] SmallVector::set_size - fix Wdocumentation. NFCI.
Also fixes a Wshadow warning on MSVC.

llvm-svn: 360255
2019-05-08 13:47:17 +00:00
Aaron Ballman ef317e0561 Allow test to pass after 2030.
Patch by Bernhard M. Wiedemann.

llvm-svn: 360254
2019-05-08 13:42:44 +00:00
Nico Weber cc433095f2 gn build: Merge r360151
llvm-svn: 360253
2019-05-08 13:41:01 +00:00
James Henderson 9ca48f26a3 [NFC]Fix British English -> American English issues
llvm-svn: 360252
2019-05-08 13:30:48 +00:00
James Henderson 5a2b5ca7d2 [llvm-objcopy] Improve error message for unrecognised archive member
Prior to this patch, llvm-objcopy's error messages for archives with
unsupported members only mentioned the archive name, not the member
name, making them unhelpful. This change improves it by approximately
following GNU objcopy's error message syntax of
"<archive name>(<member name>): <problem>".

Reviewed by: grimar

Differential Revision: https://reviews.llvm.org/D61674

llvm-svn: 360251
2019-05-08 13:28:58 +00:00
Aaron Ballman 6de5576af7 Allow 'static' storage specifier on an out-of-line class member template declaration in MSVCCompat mode.
Patch by Soumi Manna.

llvm-svn: 360250
2019-05-08 13:24:36 +00:00
Nikolai Kosjar 2a647e75c5 [libclang] PR41649: Remove pointless duplicate flag. NFC.
llvm-svn: 360249
2019-05-08 13:19:29 +00:00
Simon Pilgrim 87c5e3e78c Fix whitespace mismatches. NFCI.
Tabs are not our friends.

llvm-svn: 360248
2019-05-08 13:02:32 +00:00
Dmitri Gribenko 1902bd9da0 Documentation for bugprone-inaccurate-erase: added an example of a bug that this checker catches
Reviewers: alexfh

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D61644

llvm-svn: 360247
2019-05-08 12:02:31 +00:00
Pavel Labath 2841e6edc8 [DWARF] Centralize user_id <-> DWARFDIE conversions
Summary:
The logic for translating a user_id into a DWARFDIE was replicated in
several places. This removes that redundancy and settles on a single
implementation in SymbolFileDWARF.

The reason for choosing that instead of DIERef was that we were
always immediately converting the returned DIERef into a DWARFDIE
anyway, which meant that one had to specify the SymbolFileDWARF argument
twice (once to get the DIERef, and once to get the actual DIE). Also,
passing a higher-level object (SymbolFileDWARF) into a lower-level one
(DIERef) seemed like a less intuitive arrangement than doing things the
other way around.

Reviewers: JDevlieghere, clayborg, aprantl

Subscribers: tberghammer, jankratochvil, lldb-commits

Differential Revision: https://reviews.llvm.org/D61648

llvm-svn: 360246
2019-05-08 11:43:05 +00:00
Simon Pilgrim 2788ad3ee2 [LegalizeDAG] Assert non-power-of-2 load/store op splits are in range. NFCI.
Fixes static analyzer undefined/out-of-range shift warnings.

llvm-svn: 360245
2019-05-08 11:22:10 +00:00
Simon Pilgrim ec58090491 [Hexagon] Fix cppcheck reduce variable scope warnings. NFCI.
Also fixes a static analyzer "Value stored to 'S2' during its initialization is never read" warning.

llvm-svn: 360244
2019-05-08 11:02:46 +00:00
Andrea Di Biagio d52a542e4c [MCA] Don't add a name to the default code region.
This is done in preparation for a patch that fixes PR41523.

llvm-svn: 360243
2019-05-08 11:00:43 +00:00
Tim Northover 18adcf331b ARM: disallow SP as Rn for Thumb2 TST & TEQ instructions
Using SP in this position is unpredictable in ARMv7. CMP and CMN are not
affected, and of course v8 relaxes this requirement, but that's handled
elsewhere.

llvm-svn: 360242
2019-05-08 10:59:08 +00:00
Simon Pilgrim cced3ecc35 [VPlan] Fix "value never used" static analyzer warning. NFCI.
llvm-svn: 360241
2019-05-08 10:52:26 +00:00
Andrea Di Biagio 86654dd8a0 [MCA] Slightly refactor CodeRegion.h. NFCI
Also, use a SmallVector instead of a std::vector for the code region.

llvm-svn: 360240
2019-05-08 10:44:05 +00:00
Simon Pilgrim 02937dad69 R600InstrInfo.cpp - Add getTransSwizzle assert for the swizzle op index. NFCI.
Fixes static analyzer undefined value warning.

llvm-svn: 360239
2019-05-08 10:39:56 +00:00
Keno Fischer aa1b6f1cfb [polly][SCEV] Expand SCEV matcher cases for new smin/umin ops
These were added in rL360159, but I neglected to update polly at the
same time.

llvm-svn: 360238
2019-05-08 10:36:04 +00:00
Andrea Di Biagio 69b8b17945 [MCA] Remove dead assignment. NFC
llvm-svn: 360237
2019-05-08 10:28:56 +00:00
Simon Pilgrim be9ade93d1 [SIMode] Fix typo in Status constructor
As noted in https://www.viva64.com/en/b/0629/ (Snippet No. 36) and the scan-build CI reports (https://llvm.org/reports/scan-build/report-SIModeRegister.cpp-Status-1-1.html#EndPath), rL348754 introduced a typo in the Status constructor due to argument variable names shadowing the member variable names.

Differential Revision: https://reviews.llvm.org/D61595

llvm-svn: 360236
2019-05-08 10:24:22 +00:00
Simon Pilgrim 2a09a6cfe2 [DebugInfo] Fix use-after-move warning. NFCI.
Don't rely on DWARFAbbreviationDeclarationSet::extract cleaning the struct up for reuse - the analyzers don't like it.

llvm-svn: 360235
2019-05-08 10:09:57 +00:00
Simon Pilgrim 97a0c54179 Fix cppcheck operator precedence warning. NFCI.
llvm-svn: 360234
2019-05-08 10:07:34 +00:00
James Henderson fa11fb33ad [llvm-objcopy] Add --prefix-alloc-sections
This patch adds support for --prefix-alloc-sections, which adds a prefix
to every allocated section names.

It adds a prefix after renaming section names by --rename-section as GNU
objcopy does.

Fixes PR41266: https://bugs.llvm.org/show_bug.cgi?id=41266

Differential Revision: https://reviews.llvm.org/D60042

Patch by Seiya Nuta.

llvm-svn: 360233
2019-05-08 09:49:35 +00:00
Florian Hahn 3c696b3e7c [SCCP] Fix crash when trying to constant-fold terminators multiple times.
If we fold a branch/switch to an unconditional branch to another dead block we
replace the branch with unreachable, to avoid attempting to fold the
unconditional branch.

Reviewers: davide, efriedma, mssimpso, jdoerfert

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D61300

llvm-svn: 360232
2019-05-08 09:09:54 +00:00
Ilya Biryukov 4c32d4fd9f [clang-tidy] Do not show incorrect fix in modernize-make-unique
Summary:
The case when initialize_list hides behind an implicit case was not
handled before.

Reviewers: aaron.ballman

Reviewed By: aaron.ballman

Subscribers: xazax.hun, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D61642

llvm-svn: 360231
2019-05-08 08:52:18 +00:00
Martin Storsjo e96c98f37d [CMake] Install import libraries
Simplify the cmake logic to install both runtime and import
libraries (treated as ARCHIVE), as the later are needed to link
against llvm.

Patch by Julien Schueller!

Differential Revision: https://reviews.llvm.org/D61425

llvm-svn: 360230
2019-05-08 08:37:34 +00:00
QingShan Zhang 5f7c86147d [NFC][PowerPC] Add test for store combine optimization.
llvm-svn: 360229
2019-05-08 07:56:59 +00:00
QingShan Zhang 0e71a6e755 [CodeGenPrepare] Don't split the store if it is volatile
We shouldn't split the store when it is volatile.

Differential Revision: https://reviews.llvm.org/D61169

llvm-svn: 360228
2019-05-08 07:32:12 +00:00
George Rimar 17dbb19f70 [llvm-objcopy] - Fix for "Bug 41775 - SymbolTableSection::addSymbol - shadow variable names"
This is a fix for https://bugs.llvm.org/show_bug.cgi?id=41775,

Problem is in the final line:
Size += this->EntrySize;

I checked that we do not actually need it in this place,
since we always call removeSectionReferences which
calls removeSymbols which updates the Size.

But it worth to keep it, that allows to relax the dependencies.

Differential revision: https://reviews.llvm.org/D61636

llvm-svn: 360227
2019-05-08 07:31:05 +00:00
QingShan Zhang e065af6a42 [NFC] Add a static function to do the endian check
Add a new function to do the endian check, as I will commit another patch later, which will also need the endian check. 

Differential Revision: https://reviews.llvm.org/D61236

llvm-svn: 360226
2019-05-08 07:21:37 +00:00
Leonard Chan aae9da70ff Fix for the greendragon bots.
Adds extra checks for ObjC GC and Ownership.

llvm-svn: 360225
2019-05-08 05:59:25 +00:00
Sam McCall 835d67f6c7 [Sema] Correct typos in return statements so the return types of 'auto' functions are always deduced.
Summary:
e.g.
  auto foo() {
    return no_such_thing; // Return value is a TypoExpr
  }
  using T = decltype(foo()); // Uh-oh, undeduced auto.

Reviewers: rsmith

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D61649

llvm-svn: 360224
2019-05-08 05:49:42 +00:00
Mircea Trofin 0a753938db [llvm] Avoid div by 0 when updating profile weights.
Reviewers: davidxl

Reviewed By: davidxl

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61661

llvm-svn: 360223
2019-05-08 03:57:25 +00:00
Dan Robertson 3b137a4956 [ValueTracking] Improve isKnowNonZero for Ints
Improve isKnownNonZero for integers in order to improve cttz
optimizations.

Differential Revision: https://reviews.llvm.org/D60846

llvm-svn: 360222
2019-05-08 02:25:08 +00:00
Lang Hames e4b4ab6d26 [Support] Add error handling to sys::Process::getPageSize().
This patch changes the return type of sys::Process::getPageSize to
Expected<unsigned> to account for the fact that the underlying syscalls used to
obtain the page size may fail (see below).

For clients who use the page size as an optimization only this patch adds a new
method, getPageSizeEstimate, which calls through to getPageSize but discards
any error returned and substitues a "reasonable" page size estimate estimate
instead. All existing LLVM clients are updated to call getPageSizeEstimate
rather than getPageSize.

On Unix, sys::Process::getPageSize is implemented in terms of getpagesize or
sysconf, depending on which macros are set. The sysconf call is documented to
return -1 on failure. On Darwin getpagesize is implemented in terms of sysconf
and may also fail (though the manpage documentation does not mention this).
These failures have been observed in practice when highly restrictive sandbox
permissions have been applied. Without this patch, the result is that
getPageSize returns -1, which wreaks havoc on any subsequent code that was
assuming a sane page size value.

<rdar://problem/41654857>

Reviewers: dblaikie, echristo

Subscribers: kristina, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D59107

llvm-svn: 360221
2019-05-08 02:11:07 +00:00
Nemanja Ivanovic 83eb9c5b58 Fix buildbot break after r360195
llvm-svn: 360220
2019-05-08 02:03:32 +00:00
Jonas Devlieghere 46d318c2b5 [Docs] Fix incorrect heading and update titles.
This patch fixes two incorrect headings in source.rst which caused it to
show up on the homepage. I also updated the titles to have more sensible
links there.

llvm-svn: 360219
2019-05-08 01:51:26 +00:00
Jonas Devlieghere da9a274a60 [Docs] Re-order homepage: Download -> Build -> Test
I also reformatted some paragraphs to 80 cols.

llvm-svn: 360218
2019-05-08 01:38:12 +00:00
Richard Smith 255b85f03c Split ActOnCallExpr into an ActOnCallExpr to be called by the parser,
and a BuildCallExpr to be called internally within Sema to build /
rebuild calls.

llvm-svn: 360217
2019-05-08 01:36:36 +00:00
Jonas Devlieghere c0b48ab631 Propagate command interpreter errors from lldlbinit
This patch ensures that we propagate errors coming from the lldbinit
file trough the command/script interpreter. Before, if you did something
like command script import syntax_error.py, and the python file
contained a syntax error, lldb wouldn't tell you about it. This changes
with the current patch: errors are now propagated by default.

PS: Jim authored this change and I added testing.

Differential revision: https://reviews.llvm.org/D61579

llvm-svn: 360216
2019-05-08 01:23:47 +00:00
Kostya Serebryany ba670b404e [libFuzzer] extend the test for data flow tracer and coverage; also hopefully fix it on the bot
llvm-svn: 360215
2019-05-08 01:03:05 +00:00