Commit Graph

213611 Commits

Author SHA1 Message Date
Richard Smith 3fa73f3602 [coroutines] Add feature-test macro for coroutines, defined to 1 to indicate
the implementation is incomplete.

llvm-svn: 250982
2015-10-22 04:27:47 +00:00
Jason Molenda 76a2d615ad Move the launch-as-root xpc service from lldb to xcode, to
make it easier to run hand-built lldb roots and retain those
entitlements.  This is currently only used by Xcode; command
line lldb doesn't expose the SBLaunchInfo::SetUserID()
launch option.

<rdar://problem/23154486> 

llvm-svn: 250981
2015-10-22 04:17:26 +00:00
Richard Smith eb7927ee8f [coroutines] Add lexer support for co_await, co_yield, and co_return keywords.
Add -fcoroutines flag (just for -cc1 for now) to enable the feature. Early
indications are that this will be part of -std=c++1z.

llvm-svn: 250980
2015-10-22 03:52:15 +00:00
Jason Molenda 9c077cf33d Change ModuleList::GetSharedModule so that it will reject "stub
libraries" altogether.  On Mac/iOS, these are libraries which have
a UUID and nlist records but no text or data.  If one of these
gets into the global module list, every time we try to search
for a given filename/arch/UUID, we'll get this stub library back.
We need to prevent them from getting added to the module list
altogether.

I thought about doing this down in ObjectFileMachO -- just rejecting
the file as a valid binary file altogether -- but Greg didn't want
to take that hard line approach at this point, he wanted to keep
the ability for lldb to read one of these if someone wanted to in
the future.

<rdar://problem/23035075> 

llvm-svn: 250979
2015-10-22 03:50:28 +00:00
Jason Molenda 75f96bcfc4 Add some verbose lldb host logging so lldb will show what SDK
directories it is searching for files.

llvm-svn: 250978
2015-10-22 03:44:51 +00:00
Craig Topper a2a8d9cb0a Fix a couple places where InsertText was being called with a pointer and size when it really expects a StringRef and a normally optional bool argument.
The pointer was being implicitly converted to a StringRef and the size was being passed into the bool. Since the bool has a default value normally, no one noticed that the wrong number of arguments was given.

llvm-svn: 250977
2015-10-22 03:13:10 +00:00
Craig Topper cf2126e2ca Pass an ArrayRef instead of pointer and size. NFC
llvm-svn: 250976
2015-10-22 03:13:07 +00:00
Sanjoy Das 6ed053051d [IR] Add a `makeNoWrapRegion` method to `ConstantRange`
Summary: This will be used in a future change to ScalarEvolution.

Reviewers: hfinkel, reames, nlewycky

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D13612

llvm-svn: 250975
2015-10-22 03:12:57 +00:00
Sanjoy Das 769e7e2f71 [OperandBundles] Teach AliasAnalysis about operand bundles
Summary:
If a `CallSite` has operand bundles, then do not peek into the called
function to get a more precise `ModRef` answer.

This is tested using `argmemonly`, `-basicaa` and `-gvn`; but the
functionality is not specific to any of these.

Depends on D13961

Reviewers: reames, chandlerc

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D13962

llvm-svn: 250974
2015-10-22 03:12:51 +00:00
Sanjoy Das 98a341bc0c [OperandBundles] Make function attributes conservatively correct
Summary:
This makes attribute accessors on `CallInst` and `InvokeInst` do the
(conservatively) right thing.  This essentially involves, in some
cases, *not* falling back querying the attributes on the called
`llvm::Function` when operand bundles are present.

Attributes locally present on the `CallInst` or `InvokeInst` will still
override operand bundle semantics.  The LangRef has been amended to
reflect this.  Note: this change does not do anything prevent
`-function-attrs` from inferring `CallSite` local attributes after
inspecting the called function -- that will be done as a separate
change.

I've used `-adce` and `-early-cse` to test these changes.  There is
nothing special about these passes (and they did not require any
changes) except that they seemed be the easiest way to write the tests.

This change does not add deal with `argmemonly`.  That's a later change
because alias analysis requires a related fix before `argmemonly` can be
tested.

Reviewers: reames, chandlerc

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D13961

llvm-svn: 250973
2015-10-22 03:12:22 +00:00
JF Bastien f2364bf129 WebAssembly: fix more syntax
br_if shouldn't start with a dot.
div and rem went from prefix u/s to suffix.

llvm-svn: 250972
2015-10-22 02:32:50 +00:00
Craig Topper 6a8c151ecb Change SortAndUniqueProtocols to operate directly on a SmallVector rather than taking a pointer and element count that it modifies. This paves the way to directly convert the small vector into an ArrayRef without needing to explicitly pass the modified size. No functional change intended.
While there also use a range-based for loop and use append instead of insert to copy elements into the empty SmallVector."

llvm-svn: 250971
2015-10-22 01:56:18 +00:00
Craig Topper d8040cfa9f Use front() instead of [0] to make code more consistent with the next line that uses back().
llvm-svn: 250970
2015-10-22 01:56:16 +00:00
Pete Cooper b70b956c80 Add missing load/store flags to thumb2 instructions.
These were the cause of a verifier error when building 7zip with
-verify-machineinstrs.  Running 'make check' with the verifier
triggered the same error on the test here so i've updated the test
to run the verifier on one of its runs instead of adding a new one.

While looking at this code, there was a stale comment that these
instructions were only used for disassembly.  This probably used to
be the case, but they are now used in the 'ARM load / store optimization pass' too.

This reapplies r242300 which was reverted in r242428 due to bot failures.

Ultimately those failures were spurious and completely unrelated to this commit.  I reverted this
at the time because it was thought to be at fault.

llvm-svn: 250969
2015-10-22 01:48:57 +00:00
David Majnemer 34cacb404b Attempt to fix formatting for operand bundles
llvm-svn: 250968
2015-10-22 01:46:38 +00:00
David Blaikie 196582e196 Update LangRef for changes to the alias textual IR format to support typeless pointer work
llvm-svn: 250967
2015-10-22 01:17:29 +00:00
Eugene Zelenko 05e0fc85b2 Fix Clang-tidy modernize-use-override warnings in some files in source/Plugins/LanguageRuntime; other minor fixes.
Differential Revision: http://reviews.llvm.org/D13966

llvm-svn: 250966
2015-10-22 00:45:41 +00:00
Todd Fiala 82ffb8e904 Fix libstdc++ data formatters on Ubuntu 15.10 x86_64
See http://reviews.llvm.org/D13964 for details.

llvm-svn: 250965
2015-10-22 00:23:38 +00:00
David Majnemer a8f17871e4 [WinEH] Remove extraneous call to emitEHRegistrationOffsetLabel
It's a relic from the earlier implementation, let's remove it.

llvm-svn: 250964
2015-10-21 23:20:39 +00:00
Ben Langmuir a50dbb2065 Fix use-after-free in ModuleManager
When removing out-of-date modules we might have left behind a VisitOrder
that contains pointers to freed ModuleFiles.  This was very rarely seen,
because it only happens when modules go out of date and the VisitOrder
happens to have the right size to not be recomputed.

Thanks ASan!

rdar://23181512

llvm-svn: 250963
2015-10-21 23:12:45 +00:00
Justin Bogner 626beefd1c [PM]: Fix a doc typo. NFC
llvm-svn: 250962
2015-10-21 22:51:59 +00:00
Matt Arsenault 391be09ef3 AMDGPU: Fix adding redundant m0 uses
BuildMI already adds these since they are defined correctly now.

llvm-svn: 250961
2015-10-21 22:37:51 +00:00
Matt Arsenault e8c0891e42 AMDGPU: Fix verifier error in SIFoldOperands
There may be other use operands that also need their kill flags cleared.

This happens in a few tests when SIFoldOperands is moved after
PeepholeOptimizer.

PeepholeOptimizer rewrites cases that look like:
%vreg0 = ...
%vreg1 = COPY %vreg0
use %vreg1<kill>
%vreg2 = COPY %vreg0
use %vreg2<kill>

to use the earlier source to
%vreg0 = ...
use %vreg0
use %vreg0

Currently SIFoldOperands sees the copied registers, so there is
only one use. So far I haven't managed to come up with a test
that currently has multiple uses of a foldable VGPR -> VGPR copy.

llvm-svn: 250960
2015-10-21 22:37:50 +00:00
Matt Arsenault b6fd98c7d9 AMDGPU: Split DiagnosticInfoUnsupported into its own file
llvm-svn: 250959
2015-10-21 22:37:46 +00:00
Johannes Doerfert 654c3284f4 [FIX] Do not hoist nested variant base pointers
This fixes bug 25249.

llvm-svn: 250958
2015-10-21 22:14:57 +00:00
Evgeniy Stepanov 86713d90c7 [msan] Build unit test shared library code with -fPIC.
llvm-svn: 250957
2015-10-21 22:13:36 +00:00
Davide Italiano b59ea9018e [JIT] Towards a working small memory model.
This commit introduces an option, --preallocate, so that we can get memory
upfront and use it in small memory model tests (in order to get
reliable results).

Differential Revision:	http://reviews.llvm.org/D13630

llvm-svn: 250956
2015-10-21 22:12:03 +00:00
John McCall 09ec1ecf03 Enable ARC on the fragile runtime.
This is almost entirely a matter of just flipping a switch.  99% of
the runtime support is available all the way back to when it was
implemented in the non-fragile runtime, i.e. in Lion.  However,
fragile runtimes do not recognize ARC-style ivar layout strings,
which means that accessing __strong or __weak ivars reflectively
(e.g. via object_setIvar) will end up accessing the ivar as if it
were __unsafe_unretained.  Therefore, when using reflective
technologies like KVC, be sure that your paths always refer to a
property.

rdar://23209307

llvm-svn: 250955
2015-10-21 22:06:03 +00:00
Reid Kleckner 7737bd9f9f [Driver] Alias -fvisibility=internal to -fvisibility=hidden
The ELF symbol visibilities are:
- internal: Not visibile across DSOs, cannot pass address across DSOs
- hidden: Not visibile across DSOs, can be called indirectly
- default: Usually visible across DSOs, possibly interposable
- protected: Visible across DSOs, not interposable

LLVM only supports the latter 3 visibilities. Internal visibility is in
theory useful, as it allows you to assume that the caller is maintaining
a PIC register for you in %ebx, or in some other pre-arranged location.
As far as LLVM is concerned, this isn't worth the trouble. Using hidden
visibility is always correct, so we can just do that.

Resolves PR9183.

llvm-svn: 250954
2015-10-21 22:01:02 +00:00
Oleksiy Vyalov 9dfde98d27 Fix lldb-server - write null terminating symbol along with port number.
llvm-svn: 250953
2015-10-21 21:58:22 +00:00
Greg Clayton 258c164bf7 Fix typo so that "./dotest.py --results-formatter=curses_results.Curses --results-file=/dev/stdout" works again.
llvm-svn: 250952
2015-10-21 21:55:16 +00:00
Matt Arsenault 6005fcbe12 AMDGPU: Simplify VOP3 operand legalization.
This was checking for a variety of situations that should
never happen. This saves a tiny bit of compile time.

We should not be selecting instructions with invalid operands in the
first place. Most of the time for registers copys are inserted
to the correct operand register class.

For VOP3, since all operand types are supported and literal
constants never are, we just need to verify the constant bus
requirements (all immediates should be legal inline ones).

The only possibly tricky case to maybe worry about is if when
legalizing operands in moveToVALU with s_add_i32 and similar
instructions. If the original s_add_i32 had a literal constant
and we need to replace it with v_add_i32_e64 we would have an
unsupported literal operand.  However, I don't think we should worry
about that because SIFoldOperands should handle folding literal
constant operands into the SALU instructions based on the uses.
At SIFoldOperands time, the legality and profitability of
operand types is a bit different.

llvm-svn: 250951
2015-10-21 21:51:02 +00:00
Michael Liao 446c714a76 [InstCombine] Revise the test case to match full sequene
llvm-svn: 250950
2015-10-21 21:50:58 +00:00
Evgeniy Stepanov 71554fe21b MemorySanitizer does not require PIE.
Since r249754 MemorySanitizer should work equally well for PIE and
non-PIE executables on Linux/x86_64.

Beware, with this change -fsanitize=memory no longer adds implicit
-fPIE -pie compiler/linker flags on Linux/x86_64.

This is a re-land of r250941, limited to Linux/x86_64 + a very minor
refactoring in SanitizerArgs.

llvm-svn: 250949
2015-10-21 21:28:49 +00:00
Matt Arsenault e223cebd10 AMDGPU: Fix not checking implicit operands in verifyInstruction
When verifying constant bus restrictions, this wasn't catching
uses in implicit operands.

llvm-svn: 250948
2015-10-21 21:15:01 +00:00
Rui Ueyama 9cfc8e08a8 ELF2: Remove FIXMEs.
These classes are partially written, so almost all features
are FIXMEs. We do not want to add new FIXMEs to the classes
when we add new features to other non-stub classes.

llvm-svn: 250947
2015-10-21 21:13:35 +00:00
Matt Arsenault 45cbfa5949 Use numeric_limits instead of LLONG_MAX
This is a build fix for configurations where LLONG_MAX is
not defined in system headers.

llvm-svn: 250946
2015-10-21 21:10:12 +00:00
Matt Arsenault 29f9663f97 LegalizeDAG: Implement promote for build_vector
This will be used in future commits for AMDGPU to promote
operations on i64 vectors into operations on 32-bit vector
components.

This will be used / tested in future AMDGPU commits.

llvm-svn: 250945
2015-10-21 21:10:10 +00:00
Evgeniy Stepanov 76f853397a Revert "MemorySanitizer does not require PIE."
It actually does require PIE on some targets.

llvm-svn: 250944
2015-10-21 20:47:00 +00:00
Vedant Kumar 029c35186e [Verifier] Minor comment update, NFC
llvm-svn: 250943
2015-10-21 20:33:31 +00:00
Keno Fischer ddad187ce7 [RuntimeDyld] Ignore ST_FILE symbols when constructing GlobalSymbolTable
Summary: ELF's STT_File symbols may overlap with regular globals in
other files, so we should ignore them here in order to avoid having
bogus entries in the symbol table that confuse us when resolving relocations.

Reviewers: lhames

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D13888

llvm-svn: 250942
2015-10-21 20:22:04 +00:00
Evgeniy Stepanov dccad5b9c3 MemorySanitizer does not require PIE.
Since r249754 MemorySanitizer should work equally well for PIE and
non-PIE executables.

Beware, with this change -fsanitize=memory no longer adds implicit
-fPIE -pie compiler/linker flags, unless the target defaults to PIE.

llvm-svn: 250941
2015-10-21 20:20:03 +00:00
Lang Hames ffd4dc2111 [Orc] Clean up a comment.
llvm-svn: 250940
2015-10-21 20:13:41 +00:00
Matthias Gehre 27da23464f [clang-tidy] add check cppcoreguidelines-pro-type-vararg
Summary:
This check flags all calls to c-style vararg functions and all use
of va_list, va_start and va_arg.

Passing to varargs assumes the correct type will be read. This is
fragile because it cannot generally be enforced to be safe in the
language and so relies on programmer discipline to get it right.

This rule is part of the "Type safety" profile of the C++ Core
Guidelines, see
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#-type8-avoid-reading-from-varargs-or-passing-vararg-arguments-prefer-variadic-template-parameters-instead

This commits also reverts
  "[clang-tidy] add cert's VariadicFunctionDefCheck as cppcoreguidelines-pro-type-vararg-def"
because that check makes the SFINAE use of vararg functions impossible.

Reviewers: alexfh, sbenza, bkramer, aaron.ballman

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D13787

llvm-svn: 250939
2015-10-21 20:09:02 +00:00
Joerg Sonnenberger 7212809abc Drop assert that a call with struct return goes to a function with sret
attribute. Clang incorrectly misses it on __muldc3 and friends and the
type system doesn't include it properly either.

llvm-svn: 250938
2015-10-21 20:05:01 +00:00
Eugene Zelenko 485ed3c64c Revert r250925 in source/Plugins/OperatingSystem/Go to fix MSVC builds failures.
llvm-svn: 250937
2015-10-21 20:03:58 +00:00
Reid Kleckner cfaeb42f9c [WinEH] Add test for llvm.va.start in catchpad
It already works, but we should have a test for it.

This used to be PR23094 in the old model.

llvm-svn: 250936
2015-10-21 19:54:40 +00:00
David Majnemer cfa34fe9b4 [Sema] Remove an unreachable llvm_unreachable
No functionality change is intended.

llvm-svn: 250935
2015-10-21 19:48:47 +00:00
Rui Ueyama 86696f38ea ELF2: Avoid bitwise-OR hack. NFC.
The previous code is too clever that that needs a bit more
brain power than this new code.

llvm-svn: 250934
2015-10-21 19:41:03 +00:00
Oleksiy Vyalov 9fe526c2e7 Add domain socket support to gdb-remote protocol and lldb-server.
http://reviews.llvm.org/D13881

llvm-svn: 250933
2015-10-21 19:34:26 +00:00