Commit Graph

246597 Commits

Author SHA1 Message Date
Kirill Bobyrev b0cf6a3840 [clang-tidy] Improve rename_check.py.
-Start using argparse instead of mimicking CLI parsing.
-PEPify the code.
-Decrease the number of imports by slightly cleaning up the script.

Reviewers: alexfh

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

llvm-svn: 286228
2016-11-08 11:43:50 +00:00
Amara Emerson 0b40201e13 Adds the loop end location to the loop metadata.
This additional information can be used to improve the locations when generating remarks for loops.

Patch by Florian Hahn.

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

llvm-svn: 286227
2016-11-08 11:18:59 +00:00
Eugene Leviant c5079dc3cc [ELF] Test case update (orphan.s)
llvm-svn: 286226
2016-11-08 11:11:23 +00:00
Eugene Leviant bae1c656bb [ELF] Heuristic for placing orphan section
Differential revision: https://reviews.llvm.org/D25325

llvm-svn: 286225
2016-11-08 10:44:48 +00:00
Vladimir Yakovlev 9e83e22ddf Test commit of vbyakovl.
llvm-svn: 286224
2016-11-08 10:32:10 +00:00
Sylvestre Ledru 3ce346d4ca Fix memory leaks (coverity issues 1365586 & 1365591)
Reviewers: hfinkel

Subscribers: george.burgess.iv, malcolm.parsons, boris.ulasevich, llvm-commits

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

llvm-svn: 286223
2016-11-08 10:00:45 +00:00
Alexander Kornienko 7783ea6a61 [clang-tidy] clang-analyzer-alpha* checks are not registered, so there's no need to disable them
llvm-svn: 286222
2016-11-08 08:28:19 +00:00
Mandeep Singh Grang 7c7ea7d0ae [clang-tools-extra] Format sources with clang-format. NFC.
Summary:
Ran clang-format on all .c/.cpp/.h files in clang-tools-extra.
Excluded the test, unittests, clang-reorder-fields, include-fixer, modularize and pptrace directories.

Reviewers: klimek, alexfh

Subscribers: nemanjai

Tags: #clang-tools-extra

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

llvm-svn: 286221
2016-11-08 07:50:19 +00:00
George Rimar d700c357d4 [ELF] - Fixed mistype. NFC.
llvm-svn: 286220
2016-11-08 07:46:52 +00:00
Alexander Kornienko 179e89f188 Use AnalyzerOptions::getRegisteredCheckers() instead of clang/StaticAnalyzer/Checkers/Checkers.inc
Summary: Depends on D26310.

Reviewers: zaks.anna, hokein

Subscribers: cfe-commits

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

llvm-svn: 286219
2016-11-08 07:43:42 +00:00
Alexander Kornienko 8df2a62ae6 Add a method to get the list of registered static analyzer checkers.
Summary:
This provides a better interface for clang-tidy and encapsulates the knowledge
about experimental checkers instead of leaving this to the clients.

Reviewers: zaks.anna

Subscribers: a.sidorin, NoQ, dcoughlin, cfe-commits

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

llvm-svn: 286218
2016-11-08 07:23:32 +00:00
Tobias Grosser a8ca3ed06a SCEVValidator: reduce indentation to increase readability [NFC]
llvm-svn: 286217
2016-11-08 07:17:48 +00:00
Craig Topper c6a0339fb0 [AVX-512] Add an avx512f without avx512vl command line to vec_fp_to_int.ll and regenerate. This will make a change in a future patch easier to see. NFC
llvm-svn: 286216
2016-11-08 06:58:53 +00:00
Vedant Kumar 5ea41f30fd [lldb] Don't build unit tests for unsupported targets
Differential Revision: https://reviews.llvm.org/D26338

llvm-svn: 286215
2016-11-08 06:49:59 +00:00
Peter Collingbourne e2dcf7c3a1 IR, Bitcode: Change bitcode reader to no longer own its memory buffer.
Unique ownership is just one possible ownership pattern for the memory buffer
underlying the bitcode reader. In practice, as this patch shows, ownership can
often reside at a higher level. With the upcoming change to allow multiple
modules in a single bitcode file, it will no longer be appropriate for
modules to generally have unique ownership of their memory buffer.

The C API exposes the ownership relation via the LLVMGetBitcodeModuleInContext
and LLVMGetBitcodeModuleInContext2 functions, so we still need some way for
the module to own the memory buffer. This patch does so by adding an owned
memory buffer field to Module, and using it in a few other places where it
is convenient.

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

llvm-svn: 286214
2016-11-08 06:03:43 +00:00
Alexander Kornienko 76e4315a0e [clang-tidy] Simplify matchers
llvm-svn: 286213
2016-11-08 05:58:07 +00:00
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