Adrian Prantl [Fri, 21 Dec 2018 01:09:15 +0000 (01:09 +0000)]
Add an assertion to aid in tracking down a bug
llvm-svn: 349865
Adrian Prantl [Fri, 21 Dec 2018 01:09:14 +0000 (01:09 +0000)]
Remove ineffective (misspelled) sanitizer option
llvm-svn: 349864
George Karpenkov [Fri, 21 Dec 2018 00:26:19 +0000 (00:26 +0000)]
Revert "Revert "[driver] [analyzer] Fix a backward compatibility issue after r348038.""
This reverts commit
144927939587b790c0536f4ff08245043fc8d733.
Fixes the bug in the original commit.
llvm-svn: 349863
Artem Dergachev [Fri, 21 Dec 2018 00:18:58 +0000 (00:18 +0000)]
[analyzer] RetainCount: Suppress retain detection heuristic on some CM methods.
If it ends with "Retain" like CFRetain and returns a CFTypeRef like CFRetain,
then it is not necessarily a CFRetain. But it is indeed true that these two
return something retained.
Differential Revision: https://reviews.llvm.org/D55907
rdar://problem/
39390714
llvm-svn: 349862
Adrian Prantl [Thu, 20 Dec 2018 23:50:32 +0000 (23:50 +0000)]
Fix typo
llvm-svn: 349861
Rui Ueyama [Thu, 20 Dec 2018 23:47:39 +0000 (23:47 +0000)]
Remove dead code.
This code is no-op because of r349849.
Differential Revision: https://reviews.llvm.org/D55962
llvm-svn: 349859
Jonas Devlieghere [Thu, 20 Dec 2018 23:45:26 +0000 (23:45 +0000)]
Fix stack-buffer-overflow in lldb_private::Host::FindProcesses
Found by the address sanitizer on GreenDragon:
http://green.lab.llvm.org/green/view/LLDB/job/lldb-sanitized/1628/console
llvm-svn: 349858
Eli Friedman [Thu, 20 Dec 2018 23:39:54 +0000 (23:39 +0000)]
[ARM] Complete the Thumb1 shift+and->shift+shift transforms.
This saves materializing the immediate. The additional forms are less
common (they don't usually show up for bitfield insert/extract), but
they're still relevant.
I had to add a new target hook to prevent DAGCombine from reversing the
transform. That isn't the only possible way to solve the conflict, but
it seems straightforward enough.
Differential Revision: https://reviews.llvm.org/D55630
llvm-svn: 349857
Kuba Mracek [Thu, 20 Dec 2018 23:38:19 +0000 (23:38 +0000)]
[lldb] Add a "display-recognized-arguments" target setting to show recognized arguments by default
Differential Revision: https://reviews.llvm.org/D55954
llvm-svn: 349856
Zachary Turner [Thu, 20 Dec 2018 23:32:37 +0000 (23:32 +0000)]
[NativePDB] Create VarDecls for global variables.
Previously we would create these for local variables but not for
global variables.
Also updated existing tests which created global variables to check
for them in the resulting AST.
llvm-svn: 349854
Volodymyr Sapsai [Thu, 20 Dec 2018 23:26:29 +0000 (23:26 +0000)]
[CodeGen] Fix a test from r349848 by replacing `objc_` with `llvm.objc.`
llvm-svn: 349853
Vitaly Buka [Thu, 20 Dec 2018 23:25:26 +0000 (23:25 +0000)]
Revert "[asan] Disable test on powerpc64be"
Now the test is passing on that bot. Some incremental build issues?
This reverts commit
e00b5a5229ae02088d9f32a4e328eaa08abaf354.
llvm-svn: 349852
Adrian Prantl [Thu, 20 Dec 2018 23:16:47 +0000 (23:16 +0000)]
Disable a few tests on the green dragon sanitzier bot.
These are tests that found actual, but hard to fix, bugs that are
tracked elsewhere. Leaving them red only distracts from new failures
this bot finds.
llvm-svn: 349851
Rui Ueyama [Thu, 20 Dec 2018 22:54:41 +0000 (22:54 +0000)]
Simplify. NFC.
llvm-svn: 349850
Fangrui Song [Thu, 20 Dec 2018 22:46:01 +0000 (22:46 +0000)]
[ELF] Move IsNeeded logic from SymbolTable::addShared to MarkLive, and check IsUsedInRegularObj
Summary:
In glibc, libc.so is a linker script with an as-needed dependency on ld-linux-x86-64.so.2
GROUP ( /lib/x86_64-linux-gnu/libc.so.6 /usr/lib/x86_64-linux-gnu/libc_nonshared.a AS_NEEDED ( /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 ) )
ld-linux-x86-64.so.2 (as-needed) defines some symbols which resolve undefined references in libc.so.6, it will therefore be added as a DT_NEEDED entry, which isn't necessary.
The test case as-needed-not-in-regular.s emulates the libc.so scenario, where ld.bfd and gold don't add DT_NEEDED for a.so
The relevant code in gold/resolve.cc:
// If we have a non-WEAK reference from a regular object to a
// dynamic object, mark the dynamic object as needed.
if (to->is_from_dynobj() && to->in_reg() && !to->is_undef_binding_weak())
to->object()->set_is_needed();
in_reg() appears to do something similar to IsUsedInRegularObj.
This patch makes lld do the similar thing, but moves the check from
addShared to a later stage MarkLive where all symbols are scanned.
Reviewers: ruiu, pcc, espindola
Reviewed By: ruiu
Subscribers: emaste, arichardson, llvm-commits
Differential Revision: https://reviews.llvm.org/D55902
llvm-svn: 349849
Volodymyr Sapsai [Thu, 20 Dec 2018 22:43:26 +0000 (22:43 +0000)]
[CodeGen] Fix assertion on emitting cleanup for object with inlined inherited constructor and non-trivial destructor.
Fixes assertion
> Assertion failed: (isa<X>(Val) && "cast<Ty>() argument of incompatible type!"), function cast, file llvm/Support/Casting.h, line 255.
It was triggered by trying to cast `FunctionDecl` to `CXXMethodDecl` as
`CGF.CurCodeDecl` in `CallBaseDtor::Emit`. It was happening because
cleanups were emitted in `ScalarExprEmitter::VisitExprWithCleanups`
after destroying `InlinedInheritingConstructorScope`, so
`CodeGenFunction.CurCodeDecl` didn't correspond to expected cleanup decl.
Fix the assertion by emitting cleanups before leaving
`InlinedInheritingConstructorScope` and changing `CurCodeDecl`.
Test cases based on a patch by Shoaib Meenai.
Fixes PR36748.
rdar://problem/
45805151
Reviewers: rsmith, rjmccall
Reviewed By: rjmccall
Subscribers: jkorous, dexonsmith, cfe-commits, smeenai, compnerd
Differential Revision: https://reviews.llvm.org/D55543
llvm-svn: 349848
Chen Zheng [Thu, 20 Dec 2018 22:37:05 +0000 (22:37 +0000)]
[InstCombine] [NFC] testcases for canonicalize MUL with NEG operand
llvm-svn: 349847
Tom Stellard [Thu, 20 Dec 2018 22:36:02 +0000 (22:36 +0000)]
Fix Windows build failures caused by r349839
llvm-svn: 349846
Erik Pilkington [Thu, 20 Dec 2018 22:32:04 +0000 (22:32 +0000)]
Add support for namespaces on #pragma clang attribute
Namespaces are introduced by adding an "identifier." before a
push/pop directive. Pop directives with namespaces can only pop a
attribute group that was pushed with the same namespace. Push and pop
directives that don't opt into namespaces have the same semantics.
This is necessary to prevent a pitfall of using multiple #pragma
clang attribute directives spread out in a large file, particularly
when macros are involved. It isn't easy to see which pop corripsonds
to which push, so its easy to inadvertently pop the wrong group.
Differential revision: https://reviews.llvm.org/D55628
llvm-svn: 349845
Vitaly Buka [Thu, 20 Dec 2018 22:29:54 +0000 (22:29 +0000)]
[asan] Disable test on powerpc64be
llvm-svn: 349844
Artem Dergachev [Thu, 20 Dec 2018 22:29:49 +0000 (22:29 +0000)]
Revert "[driver] [analyzer] Fix a backward compatibility issue after r348038."
This reverts commits r349824, r349828, r349835.
More buildbot failures were noticed.
Differential Revision: https://reviews.llvm.org/D55823
rdar://problem/
46504165
llvm-svn: 349843
Alex Lorenz [Thu, 20 Dec 2018 22:11:11 +0000 (22:11 +0000)]
[ObjC] Messages to 'self' in class methods that return 'instancetype' should
use the pointer to the class as the result type of the message
Prior to this commit, messages to self in class methods were treated as instance
methods to a Class value. When these methods returned instancetype the compiler
only saw id through the instancetype, and not the Interface *. This caused
problems when that return value was a receiver in a message send, as the
compiler couldn't select the right method declaration and had to rely on a
selection from the global method pool.
This commit modifies the semantics of such message sends and uses class messages
that are dispatched to the interface that corresponds to the class that contains
the class method. This ensures that instancetypes are correctly interpreted by
the compiler. This change is safe under ARC (as self can't be reassigned),
however, it also applies to MRR code as we are assuming that the user isn't
doing anything unreasonable.
rdar://
20940997
Differential Revision: https://reviews.llvm.org/D36790
llvm-svn: 349841
Tom Stellard [Thu, 20 Dec 2018 22:04:36 +0000 (22:04 +0000)]
cmake: Remove uses of add_llvm_loadable_module macro
This was removed from llvm in r349839.
llvm-svn: 349840
Tom Stellard [Thu, 20 Dec 2018 22:04:08 +0000 (22:04 +0000)]
cmake: Remove add_llvm_loadable_module()
Summary:
This function is very similar to add_llvm_library(), so this patch merges it
into add_llvm_library() and replaces all calls to add_llvm_loadable_module(lib ...)
with add_llvm_library(lib MODULE ...)
Reviewers: philip.pfaffe, beanz, chandlerc
Reviewed By: philip.pfaffe
Subscribers: chapuni, mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D51748
llvm-svn: 349839
Nico Weber [Thu, 20 Dec 2018 21:57:12 +0000 (21:57 +0000)]
[gn check] Unbreak check-lld if llvm_install_binutils_symlinks is false
The check-lld target was missing the dependency on llvm-nm and llvm-objdump in that case.
Differential Revision: https://reviews.llvm.org/D55941
llvm-svn: 349836
Artem Dergachev [Thu, 20 Dec 2018 21:56:49 +0000 (21:56 +0000)]
[driver] [analyzer] Fix redundant test output.
The -c flag causes a .o file to appear every time we run a test.
Remove it.
Differential Revision: https://reviews.llvm.org/D55823
rdar://problem/
46504165
llvm-svn: 349835
Nico Weber [Thu, 20 Dec 2018 21:56:16 +0000 (21:56 +0000)]
[gn build] Add build file for clang/lib/CodeGen and llvm/lib/ProfileData/Coverage
Differential Revision: https://reviews.llvm.org/D55931
llvm-svn: 349834
Nico Weber [Thu, 20 Dec 2018 21:55:28 +0000 (21:55 +0000)]
[gn build] Add build files for clang/lib/{Frontend,Frontend/Rewrite,Serialization}
Differential Revision: https://reviews.llvm.org/D55930
llvm-svn: 349833
Nico Weber [Thu, 20 Dec 2018 21:54:13 +0000 (21:54 +0000)]
[gn build] Add build file for clang/lib/Driver
Mostly boring, except for the spurious dependency on StaticAnalyzer/Checkers --
see comments in the code.
Differential Revision: https://reviews.llvm.org/D55927
llvm-svn: 349832
Nico Weber [Thu, 20 Dec 2018 21:53:05 +0000 (21:53 +0000)]
[gn build] Add build file for clang/lib/Parse
Nothing really interesting. One thing to consider is where the clang_tablegen()
invocations that generate files that are private to a library should be. The
CMake build puts them in clang/include/clang/Parse (in this case), but maybe
putting them right in clang/lib/Parse/BUILD.gn makes mor sense. (For
clang_tablegen() calls that generate .inc files used by the public headers,
putting the call in the public BUILD file makes sense.)
For now, I've put the build file in the public header folder, since that
matches CMake and what I did in the last 2 clang patches, but I'm not sure I
like this.
Differential Revision: https://reviews.llvm.org/D55925
llvm-svn: 349831
Nico Weber [Thu, 20 Dec 2018 21:51:46 +0000 (21:51 +0000)]
[gn build] Add build files for clang-format and lib/{Format,Rewrite,Tooling/Core,Tooling/Inclusions}
Differential Revision: https://reviews.llvm.org/D55924
llvm-svn: 349830
Artem Dergachev [Thu, 20 Dec 2018 21:45:33 +0000 (21:45 +0000)]
[driver] [analyzer] Fix buildbots after r349824.
Buildbots can't find the linker, which we don't really need in our tests.
Differential Revision: https://reviews.llvm.org/D55823
rdar://problem/
46504165
llvm-svn: 349828
Martin Storsjo [Thu, 20 Dec 2018 21:35:59 +0000 (21:35 +0000)]
[llvm-objcopy] [COFF] Avoid memcpy() with null parameters in more places. NFC.
This fixes all cases of errors in asan+ubsan builds.
Also use std::copy instead of if+memcpy in the previously updated spot,
for consistency.
llvm-svn: 349826
Haibo Huang [Thu, 20 Dec 2018 21:33:59 +0000 (21:33 +0000)]
Declares __cpu_model as dso local
__builtin_cpu_supports and __builtin_cpu_is use information in __cpu_model to decide cpu features. Before this change, __cpu_model was not declared as dso local. The generated code looks up the address in GOT when reading __cpu_model. This makes it impossible to use these functions in ifunc, because at that time GOT entries have not been relocated. This change makes it dso local.
Differential Revision: https://reviews.llvm.org/D53850
llvm-svn: 349825
Artem Dergachev [Thu, 20 Dec 2018 21:26:40 +0000 (21:26 +0000)]
[driver] [analyzer] Fix a backward compatibility issue after r348038.
Since r348038 we emit an error every time an -analyzer-config option is not
found. The driver, however, suppresses this error with another flag,
-analyzer-config-compatibility-mode, so backwards compatibility is maintained,
while analyzer developers still enjoy the new typo-free experience.
The backwards compatibility turns out to be still broken when the -analyze
action is not specified; it is still possible to specify -analyzer-config
in that case. This should be fixed now.
Patch by Kristóf Umann!
Differential Revision: https://reviews.llvm.org/D55823
rdar://problem/
46504165
llvm-svn: 349824
Michael Kruse [Thu, 20 Dec 2018 21:24:54 +0000 (21:24 +0000)]
[CodeGen] Generate llvm.loop.parallel_accesses instead of llvm.mem.parallel_loop_access metadata.
Instead of generating llvm.mem.parallel_loop_access metadata, generate
llvm.access.group on instructions and llvm.loop.parallel_accesses on
loops. There is one access group per generated loop.
This is clang part of D52116/r349725.
Differential Revision: https://reviews.llvm.org/D52117
llvm-svn: 349823
Jessica Paquette [Thu, 20 Dec 2018 21:14:15 +0000 (21:14 +0000)]
[GlobalISel][AArch64] Add G_FCEIL to isPreISelGenericFloatingPointOpcode
If you don't do this, then if you hit a G_LOAD in getInstrMapping, you'll end
up with GPRs on the G_FCEIL instead of FPRs. This causes a fallback.
Add it to the switch, and add a test verifying that this happens.
llvm-svn: 349822
Jonas Devlieghere [Thu, 20 Dec 2018 21:02:55 +0000 (21:02 +0000)]
[API] Remove redundants get() from smart pointers. NFC
Removes redundant calls to ::get() from smart pointers in the source/API
directory..
llvm-svn: 349821
Richard Smith [Thu, 20 Dec 2018 20:58:53 +0000 (20:58 +0000)]
Make the "too many braces in scalar initialization" extension cause
SFINAE failures.
llvm-svn: 349820
David Blaikie [Thu, 20 Dec 2018 20:46:55 +0000 (20:46 +0000)]
DebugInfo: Fix for missing comp_dir handling with r349207
When deciding lazily whether a CU would be split or non-split I
accidentally dropped some handling for the line tables comp_dir (by
doing it lazily it was too late to be handled properly by the MC line
table code).
Move that bit of the code back to the non-lazy place.
llvm-svn: 349819
Jonas Devlieghere [Thu, 20 Dec 2018 20:44:23 +0000 (20:44 +0000)]
[dotest] Consider unexpected passes as failures.
Unexpected successes should be considered failures because they can hide
regressions when not addressed. When a test is fixed and not re-enabled,
it can easily regress without us noticing.
I couldn't find a good way to make this change other than changing it in
the unittest2 framework. I know this is less than optimal but since we
have the dependency checked in and the change is pretty fundamental to
the framework I think it's not unreasonable.
Differential revision: https://reviews.llvm.org/D55835
llvm-svn: 349818
Evgeniy Stepanov [Thu, 20 Dec 2018 20:36:33 +0000 (20:36 +0000)]
[sanitizer] Support running without fd 0,1,2.
Summary:
Support running with no open file descriptors (as may happen to
"init" process on linux).
* Remove a check that writing to stderr succeeds.
* When opening a file (ex. for log_path option), dup the new fd out of
[0, 2] range to avoid confusing the program.
(2nd attempt, this time without the sanitizer_rtems change)
Reviewers: pcc, vitalybuka
Subscribers: kubamracek, llvm-commits
Differential Revision: https://reviews.llvm.org/D55801
llvm-svn: 349817
Aaron Ballman [Thu, 20 Dec 2018 20:35:01 +0000 (20:35 +0000)]
Fix the example checker plugin after r349812.
llvm-svn: 349816
Aaron Ballman [Thu, 20 Dec 2018 20:32:59 +0000 (20:32 +0000)]
Fix build failures from r349812 due to a missing argument.
llvm-svn: 349815
Louis Dionne [Thu, 20 Dec 2018 20:28:56 +0000 (20:28 +0000)]
[NFC][pstl] Re-run Clang-format on the whole repository
llvm-svn: 349814
Stella Stamenova [Thu, 20 Dec 2018 20:26:05 +0000 (20:26 +0000)]
[lldbsuite] Un-xfail several tests in TestInferiorCrashing on Windows
Several of the tests are now passing. This change is enabling them.
llvm-svn: 349813
Aaron Ballman [Thu, 20 Dec 2018 20:20:20 +0000 (20:20 +0000)]
Allow direct navigation to static analysis checker documentation through SARIF exports.
This adds anchors to all of the documented checks so that you can directly link to a check by a stable name. This is useful because the SARIF file format has a field for specifying a URI to documentation for a rule and some viewers, like CodeSonar, make use of this information. These links are then exposed through the SARIF exporter.
llvm-svn: 349812
Bruno Ricci [Thu, 20 Dec 2018 20:05:11 +0000 (20:05 +0000)]
[Sema] Don't try to account for the size of an incomplete type in CheckArrayAccess
When checking that the array access is not out-of-bounds in CheckArrayAccess
it is possible that the type of the base expression after IgnoreParenCasts is
incomplete, even though the type of the base expression before IgnoreParenCasts
is complete. In this case we have no information about whether the array access
is out-of-bounds and we should just bail-out instead. This fixes PR39746 which
was caused by trying to obtain the size of an incomplete type.
Differential Revision: https://reviews.llvm.org/D55862
Reviewed By: efriedma
llvm-svn: 349811
Martin Storsjo [Thu, 20 Dec 2018 19:48:39 +0000 (19:48 +0000)]
[llvm-objcopy] [COFF] Don't call memcpy() with a null argument. NFC.
It is invalid to call memcpy with a null pointer, even if the size
is zero.
This should fix the sanitizer buildbot.
llvm-svn: 349808
Nikita Popov [Thu, 20 Dec 2018 19:46:52 +0000 (19:46 +0000)]
[ConstantFolding] Consolidate and extend bitcount intrinsic tests; NFC
Move constant folding tests into ConstantFolding/bitcount.ll and drop
various tests in other places. Add coverage for undefs.
llvm-svn: 349806
Nikita Popov [Thu, 20 Dec 2018 19:46:46 +0000 (19:46 +0000)]
[ConstantFolding] Add undef tests for overflow intrinsics; NFC
llvm-svn: 349805
Nikita Popov [Thu, 20 Dec 2018 19:46:43 +0000 (19:46 +0000)]
[ConstantFolding] Regenerate test checks; NFC
Bring overflow-ops.ll into current format. Remove redundant entry
blocks.
llvm-svn: 349804
Nikita Popov [Thu, 20 Dec 2018 19:46:39 +0000 (19:46 +0000)]
[ConstantFolding] Add tests for funnel shifts with undef operands; NFC
llvm-svn: 349803
Nikita Popov [Thu, 20 Dec 2018 19:46:35 +0000 (19:46 +0000)]
[ConstantFolding] Add tests for sat add/sub with undefs; NFC
llvm-svn: 349802
Nikita Popov [Thu, 20 Dec 2018 19:46:30 +0000 (19:46 +0000)]
[ConstantFolding] Split up saturating add/sub tests; NFC
Split each test into a separate function.
llvm-svn: 349801
Eli Friedman [Thu, 20 Dec 2018 19:46:14 +0000 (19:46 +0000)]
[MC] [AArch64] Correctly resolve ":abs_g1:3" etc.
We have to treat constructs like this as if they were "symbolic", to use
the correct codepath to resolve them. This mostly only affects movz
etc. because the other uses of classifySymbolRef conservatively treat
everything that isn't a constant as if it were a symbol.
Differential Revision: https://reviews.llvm.org/D55906
llvm-svn: 349800
Eli Friedman [Thu, 20 Dec 2018 19:38:07 +0000 (19:38 +0000)]
[MC] [AArch64] Support resolving fixups for abs_g0 etc.
This requires a bit more code than other fixups, to distingush between
abs_g0/abs_g1/etc. Actually, I think some of the other fixups are
missing some checks, but I won't try to address that here.
I haven't seen any real-world code that uses a construct like this, but
it clearly should work, and we're considering using it in the
implementation of localescape/localrecover on Windows (see
https://reviews.llvm.org/D53540). I've verified that binutils produces
the same code as llvm-mc for the testcase.
This currently doesn't include support for the *_s variants (that
requires a bit more work to set the opcode).
Differential Revision: https://reviews.llvm.org/D55896
llvm-svn: 349799
Artem Dergachev [Thu, 20 Dec 2018 19:36:06 +0000 (19:36 +0000)]
Revert "[analyzer] pr38668: Do not attempt to cast loaded values..."
This reverts commit r349701.
The patch was incorrect. The whole point of CastRetrievedVal()
is to handle the case in which the type from which the cast is made
(i.e., the "type" of value `V`) has nothing to do with the type of
the region it was loaded from (i.e., `R->getValueType()`).
Differential Revision: https://reviews.llvm.org/D55875
rdar://problem/
45062567
llvm-svn: 349798
Simon Pilgrim [Thu, 20 Dec 2018 19:01:13 +0000 (19:01 +0000)]
[X86] Auto upgrade XOP/AVX512 rotation intrinsics to generic funnel shift intrinsics (clang)
This emits FSHL/FSHR generic intrinsics for the XOP VPROT and AVX512 VPROL/VPROR rotation intrinsics.
LLVM counterpart: https://reviews.llvm.org/D55938
Differential Revision: https://reviews.llvm.org/D55937
llvm-svn: 349796
Simon Pilgrim [Thu, 20 Dec 2018 19:01:07 +0000 (19:01 +0000)]
[X86] Auto upgrade XOP/AVX512 rotation intrinsics to generic funnel shift intrinsics (llvm)
This emits FSHL/FSHR generic intrinsics for the XOP VPROT and AVX512 VPROL/VPROR rotation intrinsics.
Clang counterpart: https://reviews.llvm.org/D55937
Differential Revision: https://reviews.llvm.org/D55938
llvm-svn: 349795
Florian Hahn [Thu, 20 Dec 2018 18:49:09 +0000 (18:49 +0000)]
[LAA] Avoid generating RT checks for known deps preventing vectorization.
If we found unsafe dependences other than 'unknown', we already know at
compile time that they are unsafe and the runtime checks should always
fail. So we can avoid generating them in those cases.
This should have no negative impact on performance as the runtime checks
that would be created previously should always fail. As a sanity check,
I measured the test-suite, spec2k and spec2k6 and there were no regressions.
Reviewers: Ayal, anemet, hsaito
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D55798
llvm-svn: 349794
Adrian Prantl [Thu, 20 Dec 2018 18:47:17 +0000 (18:47 +0000)]
Add missing -oso-prepend-path to dsymutil test.
Thanks to Galina Kistanova for pointing this out!
llvm-svn: 349793
Louis Dionne [Thu, 20 Dec 2018 18:39:47 +0000 (18:39 +0000)]
[CMake] Add libunwind when 'all' is being passed as LLVM_ENABLE_PROJECTS
Reviewers: zturner
Subscribers: mgorny, jkorous, dexonsmith, llvm-commits
Differential Revision: https://reviews.llvm.org/D55942
llvm-svn: 349792
Stella Stamenova [Thu, 20 Dec 2018 18:23:08 +0000 (18:23 +0000)]
[lit] Skip stop-hook test on Windows
This test is now marked as unsupported on Windows - it is not technically "unsupported" on Windows, but it fails because "expr ptr" does not evaluate correctly. However, the error message contains the expected string, so the test "passes" despite the fact that the commands failed
The following bug has been opened for it: llvm.org/pr40119
llvm-svn: 349784
Stella Stamenova [Thu, 20 Dec 2018 18:21:17 +0000 (18:21 +0000)]
[lldbsuite] Un-xfail TestMiniDump and TestThreadJump
Both of these are now passing. I've resolved the bugs as well for verification.
llvm-svn: 349783
Pete Cooper [Thu, 20 Dec 2018 18:05:41 +0000 (18:05 +0000)]
Use @llvm.objc.clang.arc.use intrinsic instead of clang.arc.use function.
Calls to this function are deleted in the ARC optimizer. However when the ARC
optimizer was updated to use intrinsics instead of functions (r349534), the corresponding
clang change (r349535) to use intrinsics missed this one so it wasn't being deleted.
llvm-svn: 349782
Stella Stamenova [Thu, 20 Dec 2018 18:00:20 +0000 (18:00 +0000)]
[lldbsuite] Un-xfail TestEvents on Windows
There are a couple of tests in TestEvents that are now passing.
llvm-svn: 349781
Louis Dionne [Thu, 20 Dec 2018 17:55:31 +0000 (17:55 +0000)]
[libcxx] Fix order checking in unordered_multimap tests.
Some tests assume that iteration through an unordered multimap elements
will return them in the same order as at the container creation. This
assumption is not true since the container is unordered, so that no
specific order of elements is ever guaranteed for such container. This
patch introduces checks verifying that any iteration will return elements
exactly from a set of valid values and without repetition, but in no
particular order.
Reviewed as https://reviews.llvm.org/D54838.
Thanks to Andrey Maksimov for the patch.
llvm-svn: 349780
Michael Trent [Thu, 20 Dec 2018 17:51:17 +0000 (17:51 +0000)]
Add PLATFORM constants for iOS, tvOS, and watchOS simulators
Summary:
Add PLATFORM constants for iOS, tvOS, and watchOS simulators, as well
as human readable names for these constants, to the Mach-O file format
header files.
rdar://
46854119
Reviewers: ab, davide
Reviewed By: ab, davide
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D55905
llvm-svn: 349779
Yonghong Song [Thu, 20 Dec 2018 17:40:23 +0000 (17:40 +0000)]
[BPF] Disable relocation for .BTF.ext section
Build llvm with assertion on, and then build bcc against this llvm.
Run any bcc tool with debug=8 (turning on -g for clang compilation),
you will get the following assertion errors,
/home/yhs/work/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp:888:
void llvm::RuntimeDyldELF::resolveBPFRelocation(const llvm::SectionEntry&, uint64_t,
uint64_t, uint32_t, int64_t): Assertion `Value <= (4294967295U)' failed.
The .BTF.ext ELF section uses Fixup's to get the instruction
offsets. The data width of the Fixup is 4 bytes since we only need
the insn offset within the section.
This caused the above error though since R_BPF_64_32 expects
4-byte value and the Runtime Dyld tried to resolve the actual
insn address which is 8 bytes.
Actually the offset within the section is all what we need.
Therefore, there is no need to perform any kind of relocation
for .BTF.ext section and such relocation will actually cause
incorrect result.
This patch changed BPFELFObjectWriter::getRelocType() such that
for Fixup Kind FK_Data_4, if the relocation Target is a temporary
symbol, let us skip the relocation (ELF::R_BPF_NONE).
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Yonghong Song <yhs@fb.com>
llvm-svn: 349778
Brock Wyma [Thu, 20 Dec 2018 17:33:45 +0000 (17:33 +0000)]
[CodeView] Emit global variables within lexical scopes to limit visibility
Emit static locals within the correct lexical scope so variables with the same
name will not confuse the debugger into getting the wrong value.
Differential Revision: https://reviews.llvm.org/D55336
llvm-svn: 349777
Aaron Ballman [Thu, 20 Dec 2018 17:28:32 +0000 (17:28 +0000)]
Correct the diagnose_if attribute documentation. Fixes PR35845.
llvm-svn: 349776
Stella Stamenova [Thu, 20 Dec 2018 17:19:56 +0000 (17:19 +0000)]
[lldbsuite] Skip TestConflictingSymbol (test_shadowed) on Windows
The test is "passing" on windows, but it is a false positive. Skip it on Windows until it is fixed on all platforms.
llvm-svn: 349775
Michael Kruse [Thu, 20 Dec 2018 17:11:02 +0000 (17:11 +0000)]
[InstCombine] Preserve access-group metadata.
Preserve llvm.access.group metadata when combining store instructions.
This was forgotten in r349725.
Fixes llvm.org/PR40117
llvm-svn: 349774
Sanjay Patel [Thu, 20 Dec 2018 17:05:57 +0000 (17:05 +0000)]
[x86] add test to show missed movddup load fold; NFC
llvm-svn: 349773
Sean Fertile [Thu, 20 Dec 2018 17:00:33 +0000 (17:00 +0000)]
[PPC64] Add toc-optimizations for got based relocations.
Differential Revision: https://reviews.llvm.org/D54907
llvm-svn: 349772
Amilendra Kodithuwakku [Thu, 20 Dec 2018 16:44:26 +0000 (16:44 +0000)]
Test commit
Fix a simple typo.
llvm-svn: 349771
Krzysztof Parzyszek [Thu, 20 Dec 2018 16:39:20 +0000 (16:39 +0000)]
[Hexagon] Add patterns for funnel shifts
llvm-svn: 349770
Ilya Biryukov [Thu, 20 Dec 2018 16:27:19 +0000 (16:27 +0000)]
[clangd] Try to workaround test failure by increasing the timeouts
Ideally we'd figure out a way to run this test without any sleeps, this
workaround is only there to avoid annoying people with test failures
around the holiday period when everyone is on vacation.
llvm-svn: 349769
Haojian Wu [Thu, 20 Dec 2018 15:39:12 +0000 (15:39 +0000)]
[clangd] Expose FileStatus to LSP.
Summary:
Add an LSP extension "textDocument/clangd.fileStatus" to emit file-status information.
Reviewers: ilya-biryukov
Subscribers: javed.absar, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D55363
llvm-svn: 349768
Tatyana Krasnukha [Thu, 20 Dec 2018 15:05:43 +0000 (15:05 +0000)]
Overload GetMemoryRegions for the ProcessMinidump
Differential Revision: https://reviews.llvm.org/D55841
llvm-svn: 349767
Tatyana Krasnukha [Thu, 20 Dec 2018 15:02:58 +0000 (15:02 +0000)]
Replace MemoryRegionInfoSP with values and cleanup related code
Differential Revision: https://reviews.llvm.org/D55472
llvm-svn: 349766
Simon Pilgrim [Thu, 20 Dec 2018 14:56:44 +0000 (14:56 +0000)]
[SelectionDAGBuilder] Enable funnel shift building to custom rotates
This patch enables funnel shift -> rotate building for all ROTL/ROTR custom/legal operations.
AFAICT X86 was the last target that was missing modulo support (PR38243), but I've tried to CC stakeholders for every target that has ROTL/ROTR custom handling for their final OK.
Differential Revision: https://reviews.llvm.org/D55747
llvm-svn: 349765
Alex Bradbury [Thu, 20 Dec 2018 14:52:15 +0000 (14:52 +0000)]
[RISCV] Properly evaluate fixup_riscv_pcrel_lo12
This is a update to D43157 to correctly handle fixup_riscv_pcrel_lo12.
Notable changes:
Rebased onto trunk
Handle and test S-type
Test case pcrel-hilo.s is merged into relocations.s
D43157 description:
VK_RISCV_PCREL_LO has to be handled specially. The MCExpr inside is
actually the location of an auipc instruction with a VK_RISCV_PCREL_HI fixup
pointing to the real target.
Differential Revision: https://reviews.llvm.org/D54029
Patch by Chih-Mao Chen and Michael Spencer.
llvm-svn: 349764
Simon Pilgrim [Thu, 20 Dec 2018 14:38:35 +0000 (14:38 +0000)]
[X86][AVX512] Don't custom lower v16i8 rotations.
As discussed on D55747, the expansion to (wider) shifts is better on all AVX512 cases, not just BWI.
llvm-svn: 349763
David Carlier [Thu, 20 Dec 2018 14:25:43 +0000 (14:25 +0000)]
[Sanitizer] Enable vis api on FreeBSD
Reviewers: krytarowski
Reviewed By: krytarowski
Differential Revision: https://reviews.llvm.org/D55923
llvm-svn: 349762
Ulrich Weigand [Thu, 20 Dec 2018 14:24:17 +0000 (14:24 +0000)]
[SystemZ] "Generic" vector assembler instructions shoud clobber CC
There are several vector instructions which may or may not set the
condition code register, depending on the value of an argument.
For codegen, we use two versions of the instruction, one that sets
CC and one that doesn't, which hard-code appropriate values of that
argument. But we also have a "generic" version of the instruction
that is used for the assembler/disassembler. These generic versions
should always be considered to clobber CC just to be safe.
llvm-svn: 349761
Simon Pilgrim [Thu, 20 Dec 2018 14:09:15 +0000 (14:09 +0000)]
Fix gcc7 -Wdangling-else warning. NFCI.
llvm-svn: 349760
Simon Pilgrim [Thu, 20 Dec 2018 13:50:12 +0000 (13:50 +0000)]
[InstCombine] Make x86 PADDS/PSUBS constant folding tests generic
As discussed on D55894, this replaces the existing PADDS/PSUBUS intrinsics with the the sadd/ssub.sat generic intrinsics and moves the tests out of the x86 subfolder.
PR40110 has been raised to fix the regression with constant folding vectors containing undef elements.
llvm-svn: 349759
Alexander Kornienko [Thu, 20 Dec 2018 13:50:04 +0000 (13:50 +0000)]
[clang-tidy] Use translationUnitDecl() instead of a custom matcher.
llvm-svn: 349758
Nico Weber [Thu, 20 Dec 2018 13:39:25 +0000 (13:39 +0000)]
[gn build] Add build files for clang/lib/{Analysis,Edit,Sema}
Differential Revision: https://reviews.llvm.org/D55913
llvm-svn: 349757
Nico Weber [Thu, 20 Dec 2018 13:38:36 +0000 (13:38 +0000)]
[gn build] Add build files for clang/lib/Lex and clang/lib/AST
Differential Revision: https://reviews.llvm.org/D55912
llvm-svn: 349756
Clement Courbet [Thu, 20 Dec 2018 13:30:40 +0000 (13:30 +0000)]
[Sema][NFC] Add test for static_assert diagnistics with constexpr template functions.
llvm-svn: 349755
Michal Gorny [Thu, 20 Dec 2018 13:27:37 +0000 (13:27 +0000)]
[Driver] Fix accidentally reversed condition in r349752
llvm-svn: 349754
Ulrich Weigand [Thu, 20 Dec 2018 13:10:47 +0000 (13:10 +0000)]
[SystemZ] Improve testing of vecintrin.h intrinsics
This adds assembly-level tests to verify that the high-level
intrinsics generate the instructions they're supposed to.
These tests would have caught the codegen bugs I just fixed.
llvm-svn: 349753
Michal Gorny [Thu, 20 Dec 2018 13:09:30 +0000 (13:09 +0000)]
Replace getOS() == llvm::Triple::*BSD with isOS*BSD() [NFCI]
Replace multiple comparisons of getOS() value with FreeBSD, NetBSD,
OpenBSD and DragonFly with matching isOS*BSD() methods. This should
improve the consistency of coding style without changing the behavior.
Direct getOS() comparisons were left whenever used in switch or switch-
like context.
Differential Revision: https://reviews.llvm.org/D55916
llvm-svn: 349752
Ulrich Weigand [Thu, 20 Dec 2018 13:09:09 +0000 (13:09 +0000)]
[SystemZ] Fix wrong codegen caused by typos in vecintrin.h
The following two bugs in SystemZ high-level vector intrinsics are
fixes by this patch:
- The float case of vec_insert_and_zero should generate a VLLEZF
pattern, but currently erroneously generates VLLEZLF.
- The float and double versions of vec_orc erroneously generate
and-with-complement instead of or-with-complement.
The patch also fixes a couple of typos in the associated test.
llvm-svn: 349751
Haojian Wu [Thu, 20 Dec 2018 13:05:46 +0000 (13:05 +0000)]
[clangd] Don't miss the expected type in merge.
Reviewers: ilya-biryukov
Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D55918
llvm-svn: 349750
Ulrich Weigand [Thu, 20 Dec 2018 13:05:03 +0000 (13:05 +0000)]
[SystemZ] Make better use of VLLEZ
This patch fixes two deficiencies in current code that recognizes
the VLLEZ idiom:
- For the floating-point versions, we have ISel patterns that match
on a bitconvert as the top node. In more complex cases, that
bitconvert may already have been merged into something else.
Fix the patterns to match the inner nodes instead.
- For the 64-bit integer versions, depending on the surrounding code,
we may get either a DAG tree based on JOIN_DWORDS or one based on
INSERT_VECTOR_ELT. Use a PatFrags to simply match both variants.
llvm-svn: 349749
Ulrich Weigand [Thu, 20 Dec 2018 13:01:20 +0000 (13:01 +0000)]
[SystemZ] Make better use of VGEF/VGEG
Current code in SystemZDAGToDAGISel::tryGather refuses to perform
any transformation if the Load SDNode has more than one use. This
(erronously) counts uses of the chain result, which prevents the
optimization in many cases unnecessarily. Fixed by this patch.
llvm-svn: 349748