Commit Graph

246581 Commits

Author SHA1 Message Date
Stephen Hines 171244fb7a clang-format: Use git-ls-tree to get file mode in diff mode
Summary:
If a file has been renamed/deleted from the filesystem and --diff mode
with two commits is active, attempting to get the file's mode will fail.
This change uses git-ls-tree instead to get the correct permissions for
the given revision.

Patch by Luis Hector Chavez!

Reviewers: djasper, lodato

Subscribers: srhines, cfe-commits

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

llvm-svn: 286212
2016-11-08 05:50:14 +00:00
Dmitry Vyukov 62f99cc486 tsan: more precise handling of atomic stores
Atomic stores terminate release sequences on the atomic variable,
and must use ReleaseStore primitive instead of Release.
This was broken in r192355 during a refactoring.
Restore correct behavior and add a test.

llvm-svn: 286211
2016-11-08 05:34:50 +00:00
Justin Bogner 5ca4d5f5fe cmake: Don't try to install exports if there aren't any
When using LLVM_DISTRIBUTION_COMPONENTS, it's possible for clang's
export list to be empty. If this happens the install(EXPORTS) command
will fail, but since there isn't anything to install anyway we really
just want to skip it.

llvm-svn: 286210
2016-11-08 05:02:33 +00:00
Justin Bogner 80bee97477 cmake: Don't try to install exports if there aren't any
When using LLVM_DISTRIBUTION_COMPONENTS, it's possible for LLVM's
export list to be empty. If this happens the install(EXPORTS) command
will fail, but since there isn't anything to install anyway we really
just want to skip it.

llvm-svn: 286209
2016-11-08 05:02:18 +00:00
Zachary Turner c5d7df9035 Convert some Expression parser functions to StringRef.
llvm-svn: 286208
2016-11-08 04:52:16 +00:00
Peter Collingbourne 77c89b6958 Bitcode: Decouple block info block state from reader.
As proposed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/106630.html

Move block info block state to a new class, BitstreamBlockInfo.
Clients may set the block info for a particular cursor with the
BitstreamCursor::setBlockInfo() method.

At this point BitstreamReader is not much more than a container for an
ArrayRef<uint8_t>, so remove it and replace all uses with direct uses
of memory buffers.

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

llvm-svn: 286207
2016-11-08 04:17:11 +00:00
Peter Collingbourne 939c7d916e Bitcode: Split out block info reading into a separate function.
We're about to make this more complicated.

llvm-svn: 286206
2016-11-08 04:16:57 +00:00
Tony Jiang c6ddd7221c [PowerPC] Implement remaining vector comparison builtins.
vector bool char vec_cmpeq (vector bool char, vector bool char);
vector bool int vec_cmpeq (vector bool int, vector bool int);
vector bool long long vec_cmpeq (vector bool long long, vector bool long lon
vector bool short vec_cmpeq (vector bool short, vector bool short);

llvm-svn: 286205
2016-11-08 04:15:45 +00:00
Zachary Turner 0ac5f9846b Rewrite OutputFormattedHelpText in terms of StringRef.
This makes the logic easier to follow and also propagates
StringRef up to the API boundary, which is necessary for
making higher up StringRef API changes.

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

llvm-svn: 286204
2016-11-08 04:12:42 +00:00
George Burgess IV 63b06e185c Add a missing break statement. NFC.
llvm-svn: 286203
2016-11-08 04:01:50 +00:00
Shoaib Meenai 76728d88ec [libc++] Remove unnecessary MSVCRT exclusions
Visual Studio 2013 and up have these functions, and we don't need to
support older versions.

There are some remaining _LIBCPP_MSVCRT exclusions which are present on
Visual Studio 2015 but not 2013. Those will be addressed in a follow-up.

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

llvm-svn: 286202
2016-11-08 03:31:42 +00:00
George Burgess IV b9bd6fad10 Make a const variable static. NFC.
llvm-svn: 286201
2016-11-08 03:30:49 +00:00
Davide Italiano ba8761bc7f [LTO] Don't leak BitcodeFiles. Found by the asan bot.
llvm-svn: 286194
2016-11-08 01:46:02 +00:00
Davide Italiano 089f0e7488 [ELF] Don't leak the ".data" section. Fixes an asan failure.
llvm-svn: 286193
2016-11-08 01:42:38 +00:00
Evgeniy Stepanov f95e706371 [asan] Add missing header in a test.
llvm-svn: 286191
2016-11-08 01:17:58 +00:00
Tim Northover 60f2349b50 GlobalISel: improve error diagnostics when IRTranslation fails.
llvm-svn: 286190
2016-11-08 01:12:17 +00:00
Richard Smith 5e05298549 Correctly ignore unnamed bit-fields when checking whether a union has fields.
llvm-svn: 286189
2016-11-08 01:07:26 +00:00
Evgeniy Stepanov 11d3b27959 [asan] Fix asan-rt bitness issues in asan_device_setup on Android.
asan_device_setup script is using LD_PRELOAD to inject the ASan
runtime library into the Zygote process. This breaks when the Zygote
or any of its descendants spawn a process with different bitness due
to the fact that the ASan-RT library name includes the target
architecture.

The fix is to preload the library through a symlink which has the
same name in lib and lib64.

llvm-svn: 286188
2016-11-08 00:59:58 +00:00
Evgeniy Stepanov 4fcbb24deb [asan] Fix one test on Android N.
A fake strtol interceptor should at least make forward progress.

llvm-svn: 286187
2016-11-08 00:59:54 +00:00
Haojian Wu 06e39a3aed [clang-tidy] Don't warn implicit variables in peformance-unnecessary-copy-initialization.
Summary:

This will prevent the check warning the variables which have been
implicitly added by compiler, like the following case (in for-range loop):

  the variable '__end' is copy-constructed from a const reference...

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 286186
2016-11-08 00:45:34 +00:00
Tim Northover 9ac0eba672 GlobalISel: support selecting G_SELECT on AArch64.
llvm-svn: 286185
2016-11-08 00:45:29 +00:00
Mandeep Singh Grang 96999de55d [CMake] Fix llvm_setup_rpath function
Summary:
Set _install_rpath to CMAKE_INSTALL_RPATH if it is defined, so that eventually
INSTALL_RPATH is set to CMAKE_INSTALL_RPATH.
The "if(NOT DEFINED CMAKE_INSTALL_RPATH)" was missing a corresponding else
clause.
This also cleans up the fix made in r285908.

Patch by Azharuddin Mohammed

Reviewers: john.brawn, sgundapa, beanz

Subscribers: chapuni, mgorny, llvm-commits

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

llvm-svn: 286184
2016-11-08 00:45:05 +00:00
Tim Northover 7d88da6a46 GlobalISel: constrain PHI registers on AArch64.
Self-referencing PHI nodes need their destination operands to be constrained
because nothing else is likely to do so. For now we just pick a register class
naively.

Patch mostly by Ahmed again.

llvm-svn: 286183
2016-11-08 00:34:06 +00:00
Justin Bogner 66b326bc55 cmake: Support exports correctly with LLVM_DISTRIBUTION_COMPONENTS
We need to apply the same export logic in clang as in llvm for
LLVM_DISTRIBUTION_COMPONENTS, or the clang exports will be invalid
when we use this config.

This makes using distribution components without setting
LLVM_TOOLCHAIN_ONLY=On work correctly.

llvm-svn: 286181
2016-11-07 23:46:05 +00:00
Eli Friedman 8649fc053b [LTO] Add error message on IO error in compileOptimizedToFile.
(No testcase because it's difficult to force an error here.)

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

llvm-svn: 286177
2016-11-07 23:43:07 +00:00
Enrico Granata 65d86e4fa5 Simplify the PrintableRepresentationSpecialCases code; we never used the ePrintableRepresentationSpecialCasesOnly value and with enum classes the names doesn't need to be that long
llvm-svn: 286176
2016-11-07 23:32:20 +00:00
Chad Rosier 583a307e17 [AArch64] Remove dead check prefixes after r286110. NFC.
llvm-svn: 286174
2016-11-07 23:13:59 +00:00
Chad Rosier d8447a7d30 [AArch64] Rename test to reflect changes after r286110. NFC.
llvm-svn: 286173
2016-11-07 23:13:55 +00:00
Adam Nemet 15e59ab75a [opt-viewer] Avoid division by zero
llvm-svn: 286172
2016-11-07 23:12:13 +00:00
Stanislav Mekhanoshin 92e01ee90b [AMDGPU] Allow hoisting of comparisons out of a loop and eliminate condition copies
Codegen prepare sinks comparisons close to a user is we have only one register
for conditions. For AMDGPU we have many SGPRs capable to hold vector conditions.
Changed BE to report we have many condition registers. That way IR LICM pass
would hoist an invariant comparison out of a loop and codegen prepare will not
sink it.

With that done a condition is calculated in one block and used in another.
Current behavior is to store workitem's condition in a VGPR using v_cndmask
and then restore it with yet another v_cmp instruction from that v_cndmask's
result. To mitigate the issue a forward propagation of a v_cmp 64 bit result
to an user is implemented. Additional side effect of this is that we may
consume less VGPRs in a cost of more SGPRs in case if holding of multiple
conditions is needed, and that is a clear win in most cases.

llvm-svn: 286171
2016-11-07 23:04:50 +00:00
Jim Ingham 0298082541 UserExpression::Evaluate only returns a non-empty ValueObjectSP
if it returns eExpressionCompleted.  Don't try to get the error
from the ValueObjectSP if that's not true.

I just have a report of this from the field, I don't know how
to make it fail yet.

<rdar://problem/29113004>

llvm-svn: 286170
2016-11-07 22:47:01 +00:00
Adam Nemet b103fc52d3 [OptDiag, opt-viewer] Save callee's location and display as link
With this we get a new field in the YAML record if the value being
streamed out has a debug location.  For examples, please see the changes
to the tests.

This is then used in opt-viewer to display a link for the callee
function in the inlining remarks.

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

llvm-svn: 286169
2016-11-07 22:41:13 +00:00
Sanjin Sijaric 6f020d91a1 [AArch64] Transfer memory operands when lowering vector load/store intrinsics
Summary:
Some vector loads and stores generated from AArch64 intrinsics alias each other
unnecessarily, preventing better scheduling.  We just need to transfer memory
operands during lowering.

Reviewers: mcrosier, t.p.northover, jmolloy

Subscribers: aemerson, rengolin, llvm-commits

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

llvm-svn: 286168
2016-11-07 22:39:02 +00:00
Lang Hames 19a2308afd [docs] Add a pointer to ExitOnError to the discussion of handleErrors in the
programmer's manual.

ExitOnError is often a better alternative to handleErrors for tool code. This
patch makes it easier to find the ExitOnError discussion when reading the
handleErrors section.

Thanks to Peter Collingbourne for the suggestion.

llvm-svn: 286167
2016-11-07 22:33:13 +00:00
Kuba Brecka c784b36fca [tsan] Change nullptr to NULL in realloc-zero.cc test. Some environments don't have nullptr.
llvm-svn: 286166
2016-11-07 22:26:13 +00:00
Sanjoy Das 4aeb080db3 [TRE] Remove dead code
Address review by Eli Friedman on rL286147.

llvm-svn: 286165
2016-11-07 22:17:37 +00:00
Mehdi Amini b4459b1cb2 Fix typo in CMakeLists.txt: provide the path to libcxx checkout and not the include subdir
llvm-svn: 286164
2016-11-07 22:16:27 +00:00
Mehdi Amini 51d0f40d0a [doc] Add documentation about how to use a monorepo
llvm-svn: 286163
2016-11-07 22:14:09 +00:00
Mehdi Amini 1eed06a379 Add experimental support for unofficial monorepo-like directory layout
Summary:
This allows to have clang and llvm and the other subprojects
side-by-side instead of nested. This can be used with the monorepo or
multiple repos.

It will help having a single set of sources checked out but allows to
have a build directory with llvm and another one with llvm+clang.
Basically it abstracts LLVM_EXTERNAL_xxxx_SOURCE_DIR making it more
convenient by adopting a convention.

Reviewers: bogner, beanz, jlebar

Subscribers: mgorny, llvm-commits

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

llvm-svn: 286162
2016-11-07 22:13:38 +00:00
Mehdi Amini c1f152d8d1 Fix libcxxabi CMake detection of libcxx path to handle LLVM_EXTERNAL_LIBCXX_SOURCE_DIR flag
Differential Revision: https://reviews.llvm.org/D26364

llvm-svn: 286161
2016-11-07 22:07:43 +00:00
Derek Schuff 0d41b7b3f3 [WebAssembly] Emit a BasePointer when we have overly-aligned stack objects
Because we shift the stack pointer by an unknown amount, we need an
additional pointer. In the case where we have variable-size objects
as well, we can't reuse the frame pointer, thus three pointers.

Patch by Jacob Gravelle

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

llvm-svn: 286160
2016-11-07 22:00:48 +00:00
Dehao Chen d74e1e161d Reset debug loc to OldInduction in InnerLoopVectorizer::createInductionVariable. (NFC)
This is to prevent SetInsertionPoint from setting debug loc to Latch->getTerminator().

llvm-svn: 286159
2016-11-07 21:59:40 +00:00
Davide Italiano e7fd0be1b4 [ELF] Use the SystemV hash in libObject instead of rolling our own.
llvm-svn: 286158
2016-11-07 21:56:56 +00:00
Davide Italiano dacb058fd6 [lib/Object] Rename elf_hash to hashSysV.
This is more clear, as we have also GNU hash these days..

llvm-svn: 286157
2016-11-07 21:56:04 +00:00
Haojian Wu a29ae6f2d7 [clang-tidy] Fix a regression issue introduced by r285239.
Summary:
r285239 changes the behavior of AST CXXDefaultArgExpr node.

Update `modernize-use-nullptr` to handle CXXDefaultArgExpr correctly.

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 286156
2016-11-07 21:46:24 +00:00
Felix Berger 4a3f94c442 [clang-tidy] Move incomplete type test into separate test file
Summary: Move in complete type test which does not compile into its own test file.

Reviewers: alexfh, sbenza, aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 286155
2016-11-07 21:45:58 +00:00
Argyrios Kyrtzidis 9d8ab72a69 [index] Handle properly C++14's template variables.
- Infer the right symbol kind.
- Provide a templated USR, similar to how we handle class templates.

rdar://28980398

llvm-svn: 286154
2016-11-07 21:20:15 +00:00
Argyrios Kyrtzidis 3e5b61f7da [index] Make sure to mark class template symbols as having 'generic' sub-kind.
llvm-svn: 286153
2016-11-07 21:20:08 +00:00
John McCall aaae302c5a Name some anonymous structs to avoid using a (very common) extension.
llvm-svn: 286152
2016-11-07 21:13:27 +00:00
Sean Callanan e8fee34c62 Updated ASTMerge/macro.m to use _Nullable.
llvm-svn: 286151
2016-11-07 21:10:31 +00:00