Commit Graph

306302 Commits

Author SHA1 Message Date
Eric Fiselier aae39bf928 Fix test case breakages caused by lexically_relative change
llvm-svn: 349888
2018-12-21 04:38:22 +00:00
Eric Fiselier 8c0c8e154b Don't forward declare _FilesystemClock in C++03
llvm-svn: 349887
2018-12-21 04:30:04 +00:00
Eric Fiselier 8b1ad5cf8d Fix copy paste error in file_clock tests
llvm-svn: 349886
2018-12-21 04:27:45 +00:00
Eric Fiselier ba62831f7c Implement LWG 3096: path::lexically_relative is confused by trailing slashes
path("/dir/").lexically_relative("/dir"); now returns "." instead of ""

llvm-svn: 349885
2018-12-21 04:25:40 +00:00
Eric Fiselier 49b183a9ec Implement LWG 3065: Make path operators friends.
This prevents things like:

using namespace std::filesystem;
auto x = L"a/b" == std::string("a/b");

llvm-svn: 349884
2018-12-21 04:09:01 +00:00
Eric Fiselier 866885e12a Implement LWG 3145: file_clock breaks ABI for C++17 implementations.
This patch adds std::chrono::file_clock, but without breaking the
existing ABI for std::filesystem.

llvm-svn: 349883
2018-12-21 03:54:57 +00:00
Matt Arsenault 3eae3c4590 AMDGPU/GlobalISel: RegBankSelect for amdgcn.wqm.vote
llvm-svn: 349882
2018-12-21 03:20:54 +00:00
Eric Fiselier 1425485773 Implement LWG 2936: Path comparison is defined in terms of the generic format
This patch implements path::compare according to the current spec. The
only observable change is the ordering of "/foo" and "foo", which orders
the two paths based on having or not having a root directory (instead
of lexically comparing "/" to "foo").

llvm-svn: 349881
2018-12-21 03:16:30 +00:00
Matt Arsenault f4c21c575a AMDGPU/GlobalISel: RegBankSelect for some fp ops
llvm-svn: 349880
2018-12-21 03:14:45 +00:00
Matt Arsenault d16b772278 GlobalISel: Correct example PartialMapping table
When I try to use this, it seems like the second half needs
to start where the previous part left off.

llvm-svn: 349879
2018-12-21 03:03:12 +00:00
Matt Arsenault bee2ad7185 AMDGPU/GlobalISel: Redo legality for build_vector
It seems better to avoid using the callback if possible since
there are coverage assertions which are disabled if this is used.

Also fix missing tests. Only test the legal cases since it seems
legalization for build_vector is quite lacking.

llvm-svn: 349878
2018-12-21 03:03:11 +00:00
Eric Fiselier 5763cbb426 Mark two filesystem LWG issues as complete - nothing to do
llvm-svn: 349877
2018-12-21 02:17:00 +00:00
George Karpenkov aecb371a0a [analyzer] Perform escaping in RetainCountChecker on type mismatch even for inlined functions
The fix done in D55465 did not previously apply when the function was inlined.

rdar://46889541

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

llvm-svn: 349876
2018-12-21 02:16:36 +00:00
George Karpenkov f508532627 [analyzer] Fix a bug in RetainCountDiagnostics while printing a note on mismatched summary in inlined functions
Previously, we were not printing a note at all if at least one of the parameters was not annotated.

rdar://46888422

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

llvm-svn: 349875
2018-12-21 02:16:23 +00:00
Jim Ingham 79d8105fc8 "help finish" tells you it is an alias. "help fin" doesn't.
They both run the same command, and people get used to typing the shortest
string they can, so we should support alias info on shortened strings as well.

<rdar://problem/46859207>

llvm-svn: 349874
2018-12-21 01:45:28 +00:00
Reid Kleckner b894ecf903 [memcpyopt] Add debug logs when forwarding memcpy src to dst
llvm-svn: 349873
2018-12-21 01:41:20 +00:00
Reid Kleckner 0a6096bab2 [mingw] Don't mangle thiscall like fastcall etc
GCC does not mangle it when it is not explicit in the source.  The
mangler as currently written cannot differentiate between explicit and
implicit calling conventions, so we can't match GCC. Explicit thiscall
conventions are rare, so mangle as if the convention was implicit to be
as ABI compatible as possible.

Also fixes some tests using %itanium_abi_triple in some configurations
as a side effect.

Fixes PR40107.

llvm-svn: 349872
2018-12-21 01:40:29 +00:00
Eli Friedman 3af2f53456 [LoopUnroll] Don't verify domtree by default with +Asserts.
This verification is linear in the size of the function, so it can cause
a quadratic compile-time explosion in a function with many loops to
unroll.

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

llvm-svn: 349871
2018-12-21 01:28:49 +00:00
Craig Topper 7b78137403 [X86] Autogenerate complete checks. NFC
llvm-svn: 349870
2018-12-21 01:27:33 +00:00
Jonas Devlieghere 34fb64d661 Fix stack-buffer-overflow in lldb_private::Host::FindProcesses (2/2)
This fixes the second call at line 640 that I missed in r349858.

llvm-svn: 349869
2018-12-21 01:22:58 +00:00
Craig Topper 54f1a7be13 [X86] Refactor hasNoCarryFlagUses and hasNoSignFlagUses in X86ISelDAGToDAG.cpp to tranlate opcode to condition code using the helpers in X86InstrInfo.cpp.
This shortens the switches in X86ISelDAGToDAG.cpp to only need to check condition code instead of a list of opcodes.

This also fixes a bug where the memory forms of SETcc were missing from hasNoCarryFlagUses.

llvm-svn: 349868
2018-12-21 01:14:25 +00:00
Craig Topper e0cff10289 [X86] Add memory forms of some SETCC instructions to hasNoCarryFlagUses.
Found while working on another patch

llvm-svn: 349867
2018-12-21 01:14:23 +00:00
Artem Dergachev 0ec95c8651 [driver] [analyzer] Fix --analyze -Xanalyzer after r349863.
If an -analyzer-config is passed through -Xanalyzer, it is not found while
looking for -Xclang.

Additionally, don't emit -analyzer-config-compatibility-mode for *every*
-analyzer-config flag we encounter; one is enough.

https://reviews.llvm.org/D55823

rdar://problem/46504165

llvm-svn: 349866
2018-12-21 01:11:21 +00:00
Adrian Prantl 5255094b3e Add an assertion to aid in tracking down a bug
llvm-svn: 349865
2018-12-21 01:09:15 +00:00
Adrian Prantl 938d52538a Remove ineffective (misspelled) sanitizer option
llvm-svn: 349864
2018-12-21 01:09:14 +00:00
George Karpenkov 6d45b1f3b0 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
2018-12-21 00:26:19 +00:00
Artem Dergachev 212bbfad25 [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
2018-12-21 00:18:58 +00:00
Adrian Prantl 33c46ca675 Fix typo
llvm-svn: 349861
2018-12-20 23:50:32 +00:00
Rui Ueyama 23b28703f9 Remove dead code.
This code is no-op because of r349849.

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

llvm-svn: 349859
2018-12-20 23:47:39 +00:00
Jonas Devlieghere 6679bc15ca 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
2018-12-20 23:45:26 +00:00
Eli Friedman b1bbd5dca3 [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
2018-12-20 23:39:54 +00:00
Kuba Mracek 4c7f5d5c5a [lldb] Add a "display-recognized-arguments" target setting to show recognized arguments by default
Differential Revision: https://reviews.llvm.org/D55954

llvm-svn: 349856
2018-12-20 23:38:19 +00:00
Zachary Turner 3790029d97 [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
2018-12-20 23:32:37 +00:00
Volodymyr Sapsai 1de5876f42 [CodeGen] Fix a test from r349848 by replacing `objc_` with `llvm.objc.`
llvm-svn: 349853
2018-12-20 23:26:29 +00:00
Vitaly Buka cdecca0324 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
2018-12-20 23:25:26 +00:00
Adrian Prantl 74f6bcfb49 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
2018-12-20 23:16:47 +00:00
Rui Ueyama fb81437638 Simplify. NFC.
llvm-svn: 349850
2018-12-20 22:54:41 +00:00
Fangrui Song 51fe635f81 [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
2018-12-20 22:46:01 +00:00
Volodymyr Sapsai 232d22f380 [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
2018-12-20 22:43:26 +00:00
Chen Zheng ddfaf07526 [InstCombine] [NFC] testcases for canonicalize MUL with NEG operand
llvm-svn: 349847
2018-12-20 22:37:05 +00:00
Tom Stellard 6f1bae26ba Fix Windows build failures caused by r349839
llvm-svn: 349846
2018-12-20 22:36:02 +00:00
Erik Pilkington 0876cae0d7 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
2018-12-20 22:32:04 +00:00
Vitaly Buka 5bcd4e8876 [asan] Disable test on powerpc64be
llvm-svn: 349844
2018-12-20 22:29:54 +00:00
Artem Dergachev 46debda1c7 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
2018-12-20 22:29:49 +00:00
Alex Lorenz f50d1aca99 [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
2018-12-20 22:11:11 +00:00
Tom Stellard 8c020758a0 cmake: Remove uses of add_llvm_loadable_module macro
This was removed from llvm in r349839.

llvm-svn: 349840
2018-12-20 22:04:36 +00:00
Tom Stellard 2f44fbe936 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
2018-12-20 22:04:08 +00:00
Nico Weber b1f500f294 [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
2018-12-20 21:57:12 +00:00
Artem Dergachev c93968a5e8 [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
2018-12-20 21:56:49 +00:00
Nico Weber 200ed0147b [gn build] Add build file for clang/lib/CodeGen and llvm/lib/ProfileData/Coverage
Differential Revision: https://reviews.llvm.org/D55931

llvm-svn: 349834
2018-12-20 21:56:16 +00:00