Commit Graph

245709 Commits

Author SHA1 Message Date
Alex Lorenz 600ee1726b Add documentation for the transparent_union attribute
Differential Revision: https://reviews.llvm.org/D25995

llvm-svn: 285292
2016-10-27 13:51:30 +00:00
Alexander Kornienko 179e803abd Fix warnings from python difflib.
llvm-svn: 285291
2016-10-27 13:46:49 +00:00
Rafael Espindola a8631e3887 Use fewer allocators.
Instead of having 3 section allocators per file, have 3 for all files.

This is a substantial performance improvement for some cases. Linking
chromium without gc speeds up by 1.065x.

This requires using _exit in fatal since we have to avoid destructing
an InputSection if fatal is called from the constructor.

Thanks to Rui for the suggestion.

llvm-svn: 285290
2016-10-27 13:32:32 +00:00
Alex Lorenz ba5032c9cf [Sema] -Wunused-variable warning for array variables should behave
similarly to scalar variables.

This commit makes the -Wunused-variable warning behaviour more consistent:
Now clang won't warn for array variables where it doesn't warn for scalar
variables.

rdar://24158862

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

llvm-svn: 285289
2016-10-27 13:30:51 +00:00
George Rimar b49a3d3390 Revert r285285 "[Object/ELF] - Fixed behavior when SectionHeaderTable->sh_size is too large."
It broke BB.

llvm-svn: 285288
2016-10-27 12:18:50 +00:00
Erik Verbruggen 5bd830a5c5 Add const versions of Expr::getInits() and Expr::inits()
llvm-svn: 285287
2016-10-27 12:12:08 +00:00
Alexey Bataev 46c0278e7d [SLP] Fix for PR30626: Compiler crash inside SLP Vectorizer.
After successfull horizontal reduction vectorization attempt for PHI node
vectorizer tries to update root binary op by combining vectorized tree
and the ReductionPHI node. But during vectorization this ReductionPHI
can be vectorized itself and replaced by the `undef` value, while the
instruction itself is marked for deletion. This 'marked for deletion'
PHI node then can be used in new binary operation, causing "Use still
stuck around after Def is destroyed" crash upon PHI node deletion.

Also the test is fixed to make it perform actual testing.

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

llvm-svn: 285286
2016-10-27 12:02:28 +00:00
George Rimar 447d1a1986 [Object/ELF] - Fixed behavior when SectionHeaderTable->sh_size is too large.
Elf.h already has code checking that section table does not go past end of file.
Problem is that this check may not work on values greater than UINT64_MAX / Header->e_shentsize
because of calculation overflow.

Parch fixes the issue.

Differential revision: https://reviews.llvm.org/D25432

llvm-svn: 285285
2016-10-27 11:50:04 +00:00
George Rimar 7aa1626898 [Object/ELF] - Do not allow overflow when checking section size/offset.
Overflow was the reason of incorrect passing the check,
patch fixes the case.

Differentail revision: https://reviews.llvm.org/D25514

llvm-svn: 285284
2016-10-27 11:44:56 +00:00
Andrey Churbanov df0d75edf6 Fixed a memory leak related to task dependencies.
Differential Revision: http://reviews.llvm.org/D25504

Patch by Alex Duran.

llvm-svn: 285283
2016-10-27 11:43:07 +00:00
George Rimar 3fb09b3a9e [Object/ELF] - Do not crash if string table sh_size is equal to zero.
Revealed using "id_000038,sig_11,src_000015,op_havoc,rep_16" from PR30540,
when sh_size was 0, crash happened.

Differential revision: https://reviews.llvm.org/D25091

llvm-svn: 285282
2016-10-27 11:41:57 +00:00
Simon Pilgrim d2611d50aa Fix MSVC warning about missing 'this' from lambda default capture mode
llvm-svn: 285281
2016-10-27 10:51:29 +00:00
Sam Parker 09947a3155 [ARM] Add newline char to test.
Missed a newline in the previous commit.

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

llvm-svn: 285280
2016-10-27 10:43:02 +00:00
Peter Smith 17cd3752b8 [ELF] Synthetic symbol definitions for ARM static linking
When static linking in ARM (like Mips) __tls_get_addr is defined by
the library so we should not define it as a synthetic.
    
We also need to add __exidx_start and __exidx_end for the .ARM.exidx
section as the static libc library startup code is expecting them to
be defined by the default linker script for static linking on ARM.

Differential revision: https://reviews.llvm.org/D25978

llvm-svn: 285279
2016-10-27 10:28:53 +00:00
Sam Parker e7d9505c08 [ARM] Predicate UMAAL selection on hasDSP.
UMAAL is a DSP instruction and it is not available on thumbv7m
(Cortex-M3) and thumbv6m (Cortex-M0+1) targets. Also fix wrong
CHECK prefix in longMAC.ll test.

Patch by Vadzim Dambrouski.

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

llvm-svn: 285278
2016-10-27 09:47:10 +00:00
Vassil Vassilev 188ad3ac02 Empty the CtorLists/DtorLists once emitted.
This is essential when clang is running in incremental processing mode because
we don't want to reemit the 'tors over and over again.

Patch by Axel Naumann!

Reviewed by Richard Smith and me. (https://reviews.llvm.org/D25605)

llvm-svn: 285277
2016-10-27 09:12:20 +00:00
Benjamin Kramer 9d61e14771 [Xray] Don't generate output for xray tests
Patch by Sam McCall!

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

llvm-svn: 285276
2016-10-27 08:49:18 +00:00
Erik Verbruggen 52b26713be Mark invalid RecordDecls as completed.
Sema::ActOnTag creates TagDecls for records. However, if those record
declarations are invalid, and the parser is in C++ mode, it would
silently drop the TagDecl (and leave it as "beingDefined"). The problem
is that other code (e.g. the ASTWriter) will serialize all types, and
expects them to be complete. So, leaving them open would result in
failing asserts.

Fixes PR20320

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

llvm-svn: 285275
2016-10-27 08:37:14 +00:00
Dylan McKay dd680cc753 [AVR] Generate all of the TableGen files we need
This enables generation of all of the TableGen files that are used
downstream.

llvm-svn: 285274
2016-10-27 08:20:47 +00:00
Nicolai Haehnle 7b0e25b7ad AMDGPU: Fix SILoadStoreOptimizer when writes cannot be merged due register dependencies
Summary:
When finding a match for a merge and collecting the instructions that must
be moved, keep in mind that the instruction we merge might actually use one
of the defs that are being moved.

Fixes piglit spec/arb_enhanced_layouts/execution/component-layout/vs-tcs-load-output[-indirect].

The fact that the ds_read in the test case is not eliminated suggests that
there might be another problem related to alias analysis, but that's a
separate problem: this pass should still work correctly even when earlier
optimization passes missed something or were disabled.

Reviewers: tstellarAMD, arsenm

Subscribers: kzhuravl, wdng, yaxunl, llvm-commits, tony-tye

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

llvm-svn: 285273
2016-10-27 08:15:07 +00:00
Dylan McKay 00009d4824 [AVR] Compile the disassembler
This also updates references of 'TheAVRTarget' to the new
'getTheAVRTarget()' method.

llvm-svn: 285272
2016-10-27 08:09:15 +00:00
Eric Fiselier 709d1b30ab [coroutines] Build fallthrough and set_exception statements.
Summary:
This patch adds semantic checking and building of the fall-through `co_return;` statement as well as the `p.set_exception(std::current_exception())` call for handling uncaught exceptions.

The fall-through statement is built and checked according to:
> [dcl.fct.def.coroutine]/4
> The unqualified-ids return_void and return_value are looked up in the scope of class P. If
> both are found, the program is ill-formed. If the unqualified-id return_void is found, flowing
> off the end of a coroutine is equivalent to a co_return with no operand. Otherwise, flowing off
> the end of a coroutine results in undefined behavior.

Similarly the `set_exception` call is only built when that unqualified-id is found in the scope of class P.

Additionally this patch adds fall-through warnings for non-void returning coroutines. Since it's surprising undefined behavior I thought it would be important to add the warning right away. 


Reviewers: majnemer, GorNishanov, rsmith

Subscribers: mehdi_amini, cfe-commits

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

llvm-svn: 285271
2016-10-27 07:30:31 +00:00
Dylan McKay ec47065795 [AVR] Add AVRISelDAGToDAG.cpp
Summary: This pulls the AVR instruction selector in-tree.

Reviewers: arsenm, kparzysz

Subscribers: llvm-commits, wdng, beanz, japaric, mgorny

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

llvm-svn: 285270
2016-10-27 07:03:47 +00:00
Dylan McKay 6eaa4e4bcc [AVR] Add the machine code emitter
Reviewers: arsenm, kparzysz

Subscribers: wdng, beanz, japaric, llvm-commits, mgorny

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

llvm-svn: 285269
2016-10-27 06:56:46 +00:00
Nemanja Ivanovic 09dd423a7d [PPC] add vector byte reverse functions to altivec.h
This patch corresponds to review https://reviews.llvm.org/D25915.
Committing on behalf of Sean Fertile.

llvm-svn: 285268
2016-10-27 06:23:57 +00:00
Nemanja Ivanovic 32b5fed639 [PowerPC] - No SExt/ZExt needed for count trailing zeros
This patch corresponds to review:
https://reviews.llvm.org/D25896

It just eliminates the redundant ZExt after a count trailing zeros instruction.

llvm-svn: 285267
2016-10-27 05:17:58 +00:00
Dean Michael Berris f469cb9045 [XRay] Check in Clang whether XRay supports the target when -fxray-instrument is passed
Summary:
Added the code which explicitly emits an error in Clang in case
`-fxray-instrument` is passed, but XRay is not supported for the
selected target.

Reviewers: rsmith, aaron.ballman, rnk, dberris

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

llvm-svn: 285266
2016-10-27 04:56:14 +00:00
Richard Smith f8520559ce Atomics library: provide operations for __int128 when it is available.
llvm-svn: 285265
2016-10-27 01:46:24 +00:00
Samuel Antao 10e905c2e9 Remove check for -o option in offloading actions builder.
This check is also present when jobs are built, so the offloading builder check is not needed anymore.

llvm-svn: 285264
2016-10-27 01:08:58 +00:00
Samuel Antao 5b1a89a33b Fix bug when compiling CUDA code with -emit-llvm and -o.
In this case the device code is not injected into an host action and therefore the 
user should get an error as -o can't be used when generating two outputs.

llvm-svn: 285263
2016-10-27 00:53:34 +00:00
Kostya Serebryany 94c427c23e [libFuzzer] speculatively trying to fix the Mac build; second attempt
llvm-svn: 285262
2016-10-27 00:36:38 +00:00
NAKAMURA Takumi 3f286ad1fe xray-extract.cc: Quick fix for mingw, to avoid errc::protocol_error.
errc::protocol_error is winsock-oriented and mingw doesn't include it. (MS does, though)

llvm-svn: 285261
2016-10-27 00:34:24 +00:00
Kostya Serebryany 3d945f6247 [libFuzzer] revert 285259 -- hit commit too soon
llvm-svn: 285260
2016-10-27 00:24:34 +00:00
Kostya Serebryany 15cd6b4b10 [libFuzzer] speculatively trying to fix the Mac build
llvm-svn: 285259
2016-10-27 00:22:39 +00:00
John McCall b92ab1afd5 Refactor call emission to package the function pointer together with
abstract information about the callee.  NFC.

The goal here is to make it easier to recognize indirect calls and
trigger additional logic in certain cases.  That logic will come in
a later patch; in the meantime, I felt that this was a significant
improvement to the code.

llvm-svn: 285258
2016-10-26 23:46:34 +00:00
Davide Italiano 48ef6ca0c3 [IR] Retire unused getGEPReturnType overload. NFCI.
llvm-svn: 285257
2016-10-26 23:46:16 +00:00
Tim Shen 7527752353 [APFloat] Fix APFloat::getExactInverse when the input is nullptr. This is a regression introduced by r285105.
Reviewers: kbarton, echristo, iteratee, eugenis

Subscribers: llvm-commits, mehdi_amini

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

llvm-svn: 285256
2016-10-26 23:31:41 +00:00
Anna Zaks be7ae6684f [sanitizers] Set Darwin specific linker and compiler flags for all tests
Looks like we are missing these flags only in tsan and sanitizer-common.

This results in linker warnings in some settings as it can cause the Unit
tests to be built with a different SDK version than that was used to build
the runtime. For example, we are not setting the minimal deployment target
on the tests but are setting the minimal deployment target for the sanitizer
library, which leads to the following warning on some bots: ld: warning:
object file (sanitizer_posix_test.cc.i386.o) was built for newer OSX version
(10.12) than being linked (10.11).

Differential Revision: https://reviews.llvm.org/D25860  https://reviews.llvm.org/D25352

llvm-svn: 285255
2016-10-26 23:23:38 +00:00
Mehdi Amini 5ee58d3860 Unconditionally pass `-lto_library` to the linker on Darwin
We're only doing it with -flto currently, however it never "hurt"
to pass it, and users that are linking without -flto can get in
trouble if one of the dependency (a static library for instance)
contains bitcode.

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

llvm-svn: 285254
2016-10-26 23:23:08 +00:00
Anna Zaks 5b2b39065c [analyzer] Report CFNumberGetValue API misuse
This patch contains 2 improvements to the CFNumber checker:
 - Checking of CFNumberGetValue misuse.
 - Treating all CFNumber API misuse errors as non-fatal. (Previously we treated errors that could cause uninitialized memory as syncs and the truncation errors as non-fatal.)

This implements a subset of functionality from https://reviews.llvm.org/D17954.

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

llvm-svn: 285253
2016-10-26 22:51:47 +00:00
Justin Bogner 31d8b7d21d llvm-objdump: Make some error messages more consistent
Most of the version of report_error were quoting the filename and
printing a colon between the file name and the error message, but this
one wasn't doing either of those. Fix the output to be more
consistent.

llvm-svn: 285252
2016-10-26 22:37:52 +00:00
Justin Lebar ebeeab87a1 [CUDA] Move device placement new definitions into a wrapper header.
Previously, these were always included -- after this change, you have to
 #include <new>, which is consistent with how things ought to work.

llvm-svn: 285251
2016-10-26 22:13:26 +00:00
Justin Lebar 6f5ec7ee88 [CUDA] Switch cuda_wrappers/complex to use a proper include guard instead of #pragma once.
This is consistent with the rest of our internal headers.

llvm-svn: 285250
2016-10-26 22:13:20 +00:00
Vedant Kumar f4df0edf3e [utils] Add a '--unified-report' option to the code coverage prep script
In --unified-report mode, a single coverage report is prepared for all
specified binaries and written to *report_dir*. This mode is compatible
with all existing script options, including the --restrict mode which is
used to limit coverage reporting to certain files or directories.

This should not break any existing users of the script.

llvm-svn: 285249
2016-10-26 22:07:39 +00:00
Vedant Kumar 7466987cb7 [utils] Use print_function in the code coverage prep script, NFC.
llvm-svn: 285248
2016-10-26 22:07:37 +00:00
Vedant Kumar 273b6dc3e2 [utils] Add an '--only-merge' option to the code coverage prep script
In --only-merge mode, the script terminates after the profile merging
step.  This makes the script less stateful: it's more natural to split
the merge out into a separate step instead of relying on the first
invocation of the script to do it.

This should not break any existing users of the script.

llvm-svn: 285247
2016-10-26 22:07:35 +00:00
Evandro Menezes ca8370396a [AArch64] Create feature set for Samsung Exynos-M2
Since Exynos-M2 improved the FP square root unit a bit over the one in
Exynos-M1, it does not benefit from using the Newton series for such
operations.

llvm-svn: 285246
2016-10-26 22:06:20 +00:00
Jonathan Peyton 3c4050d698 Fixing typos in __kmp_release_deps trace outputs
Patch by Victor Campos

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

llvm-svn: 285244
2016-10-26 21:46:43 +00:00
Jonathan Peyton 762bc46224 Use getpagesize() instead of PAGE_SIZE macro when KMP_OS_LINUX is true
Patch by Victor Campos

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

llvm-svn: 285243
2016-10-26 21:42:48 +00:00
Victor Leschuk a37660c669 DebugInfo: fix incorrect alignment type (NFC)
Change type of some missed DebugInfo-related alignment variables,
that are still uint64_t, to uint32_t.

Original change introduced in r284482.

llvm-svn: 285242
2016-10-26 21:32:29 +00:00