Commit Graph

231110 Commits

Author SHA1 Message Date
Sanjay Patel 86564cad06 [InstCombine] fix constant to be signed for signed comparisons
This bug was introduced in r269728 and is the likely cause of many stage 2 ubsan bot failures.
I'll add a test in a follow-up commit assuming this fixes things properly.

llvm-svn: 269797
2016-05-17 18:38:55 +00:00
Miklos Vajna a7445f1b5e clang-rename: avoid StringRef members in USRLocFindingASTVisitor
Even if this is defined in the .cpp file and only used as part of the
function (so here it's safe), usually storing StringRefs in the class is
dangerous, so don't do so.

Reviewers: cfe-commits, klimek

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

llvm-svn: 269796
2016-05-17 18:17:16 +00:00
Rafael Espindola bf2b614b8a Delete unused defaults.
llvm-svn: 269795
2016-05-17 18:11:58 +00:00
Manman Ren e39c8143b3 NFC: simplify logic.
llvm-svn: 269794
2016-05-17 18:04:38 +00:00
Zachary Turner 8d4d151bb2 Allow custom formatting of session log file names.
Differential Revision: http://reviews.llvm.org/D20306

llvm-svn: 269793
2016-05-17 18:02:34 +00:00
Rafael Espindola 7a19307705 Don't repeat name in comment.
llvm-svn: 269792
2016-05-17 17:57:49 +00:00
Sanjoy Das fd67038c8b [Guards] Add branch metadata when lowering
Guards are expected to basically never fail.  Reflect this in the branch
probabilities in their lowered form.

llvm-svn: 269791
2016-05-17 17:51:19 +00:00
Sanjoy Das f5d40d5350 [SCEV] Be more aggressive in proving NUW
... for AddRec's in loops for which SCEV is unable to compute a max
tripcount.  This is the NUW variant of r269211 and fixes PR27691.

(Note: PR27691 is not a correct or stability bug, it was created to
track a pending task).

llvm-svn: 269790
2016-05-17 17:51:14 +00:00
Marshall Clow bc6a7df072 Implement LWG2576: istream_iterator and ostream_iterator should use std::addressof
llvm-svn: 269789
2016-05-17 17:44:40 +00:00
Saleem Abdulrasool 5e9944ee0a ELF: accept and ignore --no-undefined-version for compatibility
This is currently unsupported.  Accept and ignore the flag for invocation
compatibility.

llvm-svn: 269788
2016-05-17 17:34:50 +00:00
Reid Kleckner a6fd865393 Fix line numbers in calling convention test
llvm-svn: 269787
2016-05-17 17:33:31 +00:00
Vedant Kumar 5119923cdd [clang-tidy] Skip misc-macro-parentheses for namespaces (Fix PR27400)
If a use of a macro argument is preceded by the `namespace` keyword, do
not warn that the use should be wrapped in parentheses.

Patch by Mads Ravn!

llvm-svn: 269786
2016-05-17 17:26:02 +00:00
Chris Bieneman 1c0f0b242d Revert "[obj2yaml] [yaml2obj] Support for MachO load command structures"
This reverts commit r269782 because it broke bots with -fpermissive.

llvm-svn: 269785
2016-05-17 17:13:50 +00:00
Kevin Enderby ac9e15551d Change llvm-objdump, llvm-nm and llvm-size when reporting an object file error
when the object is in an archive to use something like libx.a(foo.o) as part of
the error message.

Also changed llvm-objdump and llvm-size to be like llvm-nm and ignore non-object
files in archives and not produce any error message.

To do this Archive::Child::getAsBinary() was changed from ErrorOr<...> to
Expected<...> then that was threaded up to its users.

Converting this interface to Expected<> from ErrorOr<> does involve
touching a number of places. To contain the changes for now the use of
errorToErrorCode() is still used in one place yet to be fully converted.

Again there some were bugs in the existing code that did not deal with the
old ErrorOr<> return values.  So now with Expected<> since they must be
checked and the error handled, I added a TODO and a comments for those.

llvm-svn: 269784
2016-05-17 17:10:12 +00:00
Eugene Zelenko 75259bb3cb Fix Clang-tidy modernize-use-bool-literals in generated Target code; other minor fixes; other minor fixes.
Make generated code more readable.

Fix some Include What You Use warnings.

Differential revision: http://reviews.llvm.org/D20317

llvm-svn: 269783
2016-05-17 17:04:23 +00:00
Chris Bieneman 3552c426e9 [obj2yaml] [yaml2obj] Support for MachO load command structures
This adds support for all the MachO *_command structures. The load_command payloads still are not represented, but that will come next.

llvm-svn: 269782
2016-05-17 17:03:28 +00:00
Reid Kleckner a73dcbcd13 Fix calling convention test
llvm-svn: 269781
2016-05-17 16:54:40 +00:00
Reid Kleckner dad242c615 Tentatively enable -Wcast-calling-convention by default
In Chrome, this would have found two true positives around CreateThread
if we hadn't already fixed them while rolling out ASan. We didn't get
any other hits in Chrome. I'm curious to hear if this warning finds
anything in other projects.

llvm-svn: 269780
2016-05-17 16:50:45 +00:00
Haojian Wu 2a6d78b820 [find-all-symbols] Add IWYU private pragma support.
Reviewers: djasper, klimek

Subscribers: kimgr, cfe-commits, bkramer, ioeric

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

llvm-svn: 269779
2016-05-17 16:48:49 +00:00
Reid Kleckner fcc5550544 [codeview] Test serialization of all known type records
This just checks that we emit all type records once, and then after
merging the type stream with no other type streams, we still emit every
kind of type record.

We could test the dumper output more closely, but that would make the
test very brittle. Currently we're just getting coverage.

llvm-svn: 269778
2016-05-17 16:20:35 +00:00
Teresa Johnson ad66eaec2c [ThinLTO] Force disable test on Windows via REQUIRES shell
The "XFAIL: win32" was not enough to get the test to XFAIL on the bot:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/5478

For now, use "REQUIRES: shell" to suppress test on Windows while we
investigate.

llvm-svn: 269777
2016-05-17 16:06:16 +00:00
Rafael Espindola 712f957cae Simplify handling of hidden stub.
Since r207518 they are printed exactly like non-hidden stubs on x86 and
since r207517 on ARM.

This means we can use a single set for all stubs in those platforms.

llvm-svn: 269776
2016-05-17 16:01:32 +00:00
Teresa Johnson 1e7d4ab9a3 [ThinLTO] XFAIL path manipulation test on Windows
This test is creating and checking paths using '/'. XFAIL it on Windows
to unbreak bot:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/5478

llvm-svn: 269775
2016-05-17 15:26:13 +00:00
Jonathan Peyton 0e8f053023 [OpenMP Testing] Have lit.py be a valid lit executable
Users can use either llvm-lit (generated during llvm build) or lit.py which
exists in llvm/utils/lit.

llvm-svn: 269774
2016-05-17 15:12:11 +00:00
Marshall Clow 6c3fa193bf Add some checking so that the TEST_HAS_XXX macros match up with the _LIBCPP_NO_HAS_XXX macros. No functional change
llvm-svn: 269773
2016-05-17 14:58:09 +00:00
Marshall Clow 4328c2bac8 Implement P0030R1: Introduce a 3-Argument Overload to std::hypot
llvm-svn: 269772
2016-05-17 14:52:19 +00:00
Teresa Johnson bbd10b4579 [ThinLTO] Option to control path of distributed backend files
Summary:
Add support to control where files for a distributed backend (the
individual index files and optional imports files) are created.

This is invoked with a new thinlto-prefix-replace option in the gold
plugin and llvm-lto. If specified, expects a string of the form
"oldprefix:newprefix", and instead of generating these files in the
same directory path as the corresponding bitcode file, will use a path
formed by replacing the bitcode file's path prefix matching oldprefix
with newprefix.

Also add a new replace_path_prefix helper to Path.h in libSupport.

Depends on D19636.

Reviewers: joker.eph

Subscribers: llvm-commits, joker.eph

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

llvm-svn: 269771
2016-05-17 14:45:30 +00:00
Simon Pilgrim 2ea513847c [CostModel][X86] Tidied up checks
llvm-svn: 269770
2016-05-17 14:43:41 +00:00
Cameron Desrochers 6fffec3c96 [PCH] Fixed bug with preamble invalidation when overridden files change
When remapped files were changed, they would not always cause the preamble's PCH to be invalidated, because the remapped path didn't necessarily match the include path (e.g. slash direction -- this happens a lot on Windows). I fixed this by moving to a llvm::sys::fs::UniqueID-based map instead of comparing paths stringwise.

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

llvm-svn: 269769
2016-05-17 14:34:53 +00:00
Davide Italiano a0e0feea1d [PM/LCSSA] Fix dependency list. Some passes are preserved, not required.
llvm-svn: 269768
2016-05-17 14:32:12 +00:00
Davide Italiano b75b16e2ff [LCSSA] Use any_of() to simplify the code. NFCI.
llvm-svn: 269767
2016-05-17 14:24:41 +00:00
Rafael Espindola 9210be5431 Add a test showing how hidden stubs are handled on ppc.
llvm-svn: 269766
2016-05-17 14:24:33 +00:00
Filipe Cabecinhas 09fbfcafc3 Revert "[X86] Add immediate range checks for many of the builtins."
This reverts commit r269619.

llvm-svn: 269765
2016-05-17 14:07:43 +00:00
Igor Laevsky 953f2d2a54 [RewriteStatepointsForGC] Remove obsolete assertion
This is assertion is no longer necessary since we never record
constants in the live set anyway. (They are never recorded in 
the initial live set, and constant bases are removed near line 2119)

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

llvm-svn: 269764
2016-05-17 13:54:10 +00:00
Tobias Grosser 97afc45b08 docs: Fix code-block to avoid sphinx error
llvm-svn: 269763
2016-05-17 13:41:00 +00:00
Haojian Wu 39170d70c0 [find-all-symbols] Ignore anonymous enum declarations.
llvm-svn: 269762
2016-05-17 13:38:18 +00:00
Renato Golin 57bfb69aa4 [ARM] ARM mov InstAlias for MOVW lacks HasV6T2
The movw instruction is only available in ARM state for V6T2 and above.
The MOVi16 instruction has requirement HasV6T2 but the InstAlias
for mov rd, imm where the operand is imm0_65535_expr:$imm does not.

This means that movw can incorrectly be used in ARMv4 and ARMv5 by
writing mov rd, 0x1234. The simple fix is to the requirement HasV6T2
to the InstAlias. Tests added to not-armv4.s.

Patch by Peter Smith.

llvm-svn: 269761
2016-05-17 13:05:28 +00:00
David L Kreitzer e7c583e06f Fix for PR27750. Correctly handle the case where the fallthrough block and
target block are the same in getFallThroughMBB.

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

llvm-svn: 269760
2016-05-17 12:47:46 +00:00
Tamas Berghammer 75f8f6e111 xfail TestTopLevelExprs for Android API 21-22 (llvm.org/pr27787)
llvm-svn: 269759
2016-05-17 12:42:25 +00:00
Benjamin Kramer af34e06c69 [include-fixer] Make the "extend to the right" hack support typos without nested names in the front.
This handles cases where the initial namespace is unknown.

llvm-svn: 269758
2016-05-17 12:35:18 +00:00
Benjamin Kramer ca9a0fe2b9 [InstCombine] Don't crash when trying to take an element of a ConstantExpr.
Fixes PR27786.

llvm-svn: 269757
2016-05-17 12:08:55 +00:00
Derek Schuff 6c1d74a094 [WebAssembly] Remove our copy of PrologEpilogInserter
It's no longer needed after r269750

llvm-svn: 269756
2016-05-17 11:18:35 +00:00
Zoran Jovanovic 84e4d59e47 [mips][microMIPS] Implement BEQZC and BNEZC instructions
Differential Revision: http://reviews.llvm.org/D15417

llvm-svn: 269755
2016-05-17 11:10:15 +00:00
Petar Jovanovic 009494fe09 [Mips] Set mips32 as default CPU for MIPS32 Android
Change default CPU for MIPS32 Android. Now it is mips32 (rev1).

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

llvm-svn: 269754
2016-05-17 10:46:10 +00:00
Simon Dardis 8d8f2f8b8d [mips] Compact branch policy control for MIPSR6
This patch adds the commandline option -mips-compact-branches={never,optimal,always),
which controls how LLVM generates compact branches for MIPS targets. By
default, the compact branch policy is 'optimal' where LLVM will (hopefully)
pick the optimal branch for any situation. The 'never' policy will disable
the generation of compact branches and 'always' will generate compact branches
wherever possible.

Reviewers: dsanders

Differential Review: http://reviews.llvm.org/D20167

llvm-svn: 269753
2016-05-17 10:21:43 +00:00
Zlatko Buljan e9abe8816c [mips][microMIPS][DSP] Implement BALIGN, BITREV, BPOSGE32, CMP*, CMPGDU*, CMPGU* and CMPU* instructions
Differential Revision: http://reviews.llvm.org/D16182

llvm-svn: 269752
2016-05-17 09:32:58 +00:00
Alexey Bataev 7ace49dff1 [OPENMP] Pass scalar firstprivate vars by value.
For better performance and to unify code with offloading part we pass
scalar firstprivate values by value, instead of by reference. It will
remove some extra copying operations.

llvm-svn: 269751
2016-05-17 08:55:33 +00:00
Derek Schuff 1aaf87e91d Factor PrologEpilogInserter around spilling, frame finalization, and scavenging
PrologEpilogInserter has these 3 phases, which are related, but not
all of them are needed by all targets. This patch reorganizes PEI's
varous functions around those phases for more clear separation. It also
introduces a new TargetMachine hook, usesPhysRegsForPEI, which is true
for non-virtual targets. When it is true, all the phases operate as
before, and PEI requires the AllVRegsAllocated property on
MachineFunctions. Otherwise, CSR spilling and scavenging are skipped and
only prolog/epilog insertion/frame finalization is done.

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

llvm-svn: 269750
2016-05-17 08:49:59 +00:00
Maxim Ostapenko 02c21b3ef9 [asan] Don't raise false alarm to recv/recvfrom when MSG_TRUNC is present.
Fix https://llvm.org/bugs/show_bug.cgi?id=27673.

Currenty ASan checks the return value of real recv/recvfrom to see if the written bytes fit in the buffer. That works fine most of time.
However, there is an exception: (from the RECV(2) man page)

MSG_TRUNC (since Linux 2.2)
    ... return the real length of the packet or datagram, even when it was longer than the passed buffer. ...

Some programs combine MSG_TRUNC, MSG_PEEK and a single-byte buffer to peek the incoming data size without reading (much of) them. In this case,
the return value is usually longer than what's been written and ASan raises a false alarm here. To avoid such false positive reports,
we can use min(res, len) in COMMON_INTERCEPTOR_WRITE_RANGE checks.

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

llvm-svn: 269749
2016-05-17 07:38:27 +00:00
Martin Probst cb6e042040 clang-format: [JS] simplify logic by parsing forward.
This also reduces complexity to O(n) from O(n^2) by avoiding backtracking
re-parses, and fixes length calculation.

llvm-svn: 269748
2016-05-17 06:29:33 +00:00