Commit Graph

263568 Commits

Author SHA1 Message Date
Rafael Espindola 05c4f67cf3 Move name lookup to script parsing time.
We were looking up sections by name during expression evaluation. By
keeping track of forward declarations we can do the lookup during
script parsing.

Doing the lookup earlier will be more efficient when assignAddresses
is run twice and removes two uses of OutputSections.

llvm-svn: 304381
2017-06-01 01:16:50 +00:00
Gor Nishanov 050e79e958 CGCleanup: (NFC) add another test for r304335 - Don't try to spill static allocas
Summary:
Coroutine related test that used to trigger broken IR prior to r304335.

```
%x = alloca i32, align 4
store i32* %x, i32** %tmp.exprcleanup, align 4 ; <===== HERE
%ref.tmp3 = alloca %struct.A, align 1
%agg.tmp5 = alloca %"struct.std::experimental::coroutines_v1::coroutine_handle.0", align 4
%tmp.exprcleanup = alloca i32*, align 4
%allocapt = bitcast i32 undef to i32
store i32 %0, i32* %.addr, align 4
```

Fixed with r304335

Subscribers: cfe-commits

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

llvm-svn: 304380
2017-06-01 01:15:25 +00:00
Jim Ingham ab194a26da Forgot to mention rewriting CommandObject::DoExecute
using the SB API's not the lldb_private API's.

llvm-svn: 304379
2017-06-01 01:05:30 +00:00
Tim Shen 6b41141863 [ThinLTO] Migrate ThinLTOBitcodeWriter to the new PM.
Summary: Also see D33429 for other ThinLTO + New PM related changes.

Reviewers: davide, chandlerc, tejohnson

Subscribers: mehdi_amini, Prazek, cfe-commits, inglorion, llvm-commits, eraman

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

llvm-svn: 304378
2017-06-01 01:02:12 +00:00
Eric Fiselier 9bcd8e500e Upgrade Clang version used by appveyor
llvm-svn: 304377
2017-06-01 01:00:59 +00:00
Richard Smith f03e9084c1 PR33232: implement support for MSVC's __is_trivially_destructible trait.
Unlike the GCC-compatible __has_trivial_destructor trait, this one computes the
right answer rather than performing the quirky set of checks described in GCC's
documentation (https://gcc.gnu.org/onlinedocs/gcc/Type-Traits.html).

MSVC also has a __has_trivial_destructor trait which is the same as its (and
now Clang's) __is_trivially_destructible trait; we might want to consider
changing the behavior of __has_trivial_destructor if we're targeting an MSVC
platform, but I'm not doing so for now.

While implementing this I found that we were incorrectly rejecting
__is_destructible queries on arrays of unknown bound of incomplete types; that
too is fixed, and I've added similar tests for other traits for good measure.

llvm-svn: 304376
2017-06-01 00:28:16 +00:00
Xinliang David Li 32c5e809be [PartialInlining] Reduce outlining overhead by removing unneeded live-out(s)
Differential Revision: http://reviews.llvm.org/D33694

llvm-svn: 304375
2017-06-01 00:12:41 +00:00
Martell Malone 062f8f00ae [libcxxabi] Rework CMakeLists.txt into modules
Refactor cmake to remove dependence on LLVM's cmake modules.
This improves handling of cmake checks when cross compiling and brings
libcxxabi in line with libcxx and other project modules.

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

llvm-svn: 304374
2017-06-01 00:09:20 +00:00
Eric Fiselier 84ee7ff741 [coroutines] Fix checking for prvalue-ness of `await_suspend` return type
Summary:
@rsmith Does this correctly address the issues mentioned in https://reviews.llvm.org/D33625#inline-292971 ?



Reviewers: rsmith, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits, rsmith

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

llvm-svn: 304373
2017-05-31 23:41:11 +00:00
Eric Fiselier baa9198585 Define -DNOMINMAX when running the tests on Windows
llvm-svn: 304372
2017-05-31 23:27:25 +00:00
Dehao Chen 6b737ddce7 Add LiveRangeShrink pass to shrink live range within BB.
Summary: LiveRangeShrink pass moves instruction right after the definition with the same BB if the instruction and its operands all have more than one use. This pass is inexpensive and guarantees optimal live-range within BB.

Reviewers: davidxl, wmi, hfinkel, MatzeB, andreadb

Reviewed By: MatzeB, andreadb

Subscribers: hiraditya, jyknight, sanjoy, skatkov, gberry, jholewinski, qcolombet, javed.absar, krytarowski, atrick, spatel, RKSimon, andreadb, MatzeB, mehdi_amini, mgorny, efriedma, davide, dberlin, llvm-commits

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

llvm-svn: 304371
2017-05-31 23:25:25 +00:00
Eli Friedman 157dc73479 [docs] Update name of vectorization interleave flag.
llvm-svn: 304370
2017-05-31 23:02:55 +00:00
Rafael Espindola 47c9f84d50 Simplify. NFC.
The sections are ordered, so we can just use the first one when
looking for the lowest address.

llvm-svn: 304369
2017-05-31 22:49:50 +00:00
Rafael Espindola cccd2c604e Merge two nested ifs. NFC.
llvm-svn: 304368
2017-05-31 22:46:19 +00:00
Reid Kleckner fc7ba565ed [EH] Recognize __(gxx|gcc)_personality_seh0 as the GNU EH personalities
These are no-ops when there are no invokes. We don't need to emit LSDAs
for them.

Fixes PR33220.

llvm-svn: 304367
2017-05-31 22:35:52 +00:00
Matthias Braun 605f779516 ImplicitNullChecks: Clear kill/dead flags when moving instructions around
The values are marked as livein in the successor blocks so marking them
as killed or dead was wrong.

llvm-svn: 304366
2017-05-31 22:23:08 +00:00
Reid Kleckner 57ac61e005 Check hasPersonalityFn before calling getPersonalityFn
llvm-svn: 304365
2017-05-31 22:21:20 +00:00
Eric Fiselier 1c3b0afbbe Fix silly mistakes in recent changes made to coroutine test
llvm-svn: 304364
2017-05-31 22:20:42 +00:00
Reid Kleckner c2f1bbfe4f [EH] Fix the LSDA that we emit for unknown EH personalities
We should have a single call site entry with no landing pad. This
indicates that no EH action should be taken and the unwinder should
unwind to the next frame.

We currently don't recognize __gxx_personality_seh0 as a known
personality, so we forcibly emit a table, and that table was wrong. This
was filed as PR33220. Now we emit a correct table for that personality.
The next step is to recognize that we can completely skip the table for
this personality.

llvm-svn: 304363
2017-05-31 22:18:49 +00:00
Steven Wu 97e2cf87e1 [MachOObject] Fix bind opcode parser error on valid opcode sequence
BIND_OPCODE_SET_DYLIB_SPECIAL_IMM(0) is a valid way to setp library
ordinal. MachOObject should set LibraryOrdinalSet even when IMM is zero.

llvm-svn: 304362
2017-05-31 22:17:43 +00:00
Galina Kistanova 244621faad Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
llvm-svn: 304361
2017-05-31 22:16:24 +00:00
Eric Fiselier 1ec026252b Fix Libc++ build with MinGW64
Summary: This patch corrects the build errors I encountered when building on MinGW64.

Reviewers: mati865, rnk, compnerd, smeenai, bcraig

Reviewed By: mati865, smeenai

Subscribers: martell, chapuni, cfe-commits

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

llvm-svn: 304360
2017-05-31 22:14:05 +00:00
Eric Fiselier 27db230ab0 Remove requirement for libunwind sources. Patch by Shiz.
As per r241993, libunwind_ext.h is not used anymore, and thus only the public libunwind includes are needed.
This eases distro packaging efforts and removes an unneeded requirement for out-of-tree building.

Reviewed as D33178

llvm-svn: 304359
2017-05-31 22:11:42 +00:00
Galina Kistanova 8514dd540d Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
llvm-svn: 304358
2017-05-31 22:09:46 +00:00
Eric Fiselier a016efb1dc [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on Windows
Summary:
This patch improves how libc++ handles min/max macros within the headers. Previously libc++ would undef them and emit a warning.
This patch changes libc++ to use `#pragma push_macro`  to save the macro before undefining it, and `#pragma pop_macro` to restore the macros and the end of the header.

Reviewers: mclow.lists, bcraig, compnerd, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits, krytarowski

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

llvm-svn: 304357
2017-05-31 22:07:49 +00:00
Galina Kistanova 0b69e363f6 Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
llvm-svn: 304356
2017-05-31 22:02:05 +00:00
Galina Kistanova c752c4bf56 Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
llvm-svn: 304355
2017-05-31 21:50:45 +00:00
Tobias Grosser 6b6ac90098 [BlockGenerator] Translate buildContainsCondition to idiomatic isl C++
llvm-svn: 304354
2017-05-31 21:49:51 +00:00
Vedant Kumar 877e3cefb8 Avoid a UB pointer overflow in the ArrayRef unit test
The intent of the test is to check that array lengths greater than
UINT_MAX work properly. Change the test to stress that scenario, without
triggering pointer overflow UB.

Caught by a WIP pointer overflow checker in clang.

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

llvm-svn: 304353
2017-05-31 21:47:52 +00:00
Eric Fiselier f9645c3a92 Guard against more macros in tchar.h
llvm-svn: 304352
2017-05-31 21:39:54 +00:00
Eric Fiselier 4f429cecd9 Transform the libc++ coroutine shell tests into normal .pass.cpp tests.
The shell test versions didn't get all of the flags normal tests
do, specifically warning flags. This patch makes them .pass.cpp tests,
and uses a lit.local.cfg to add -fcoroutines-ts and to make them
UNSUPPORTED when that flag isn't available.

llvm-svn: 304351
2017-05-31 21:34:43 +00:00
Wei Mi 0bd3f41588 Revert rL304050. It may break sanitizer bootstrap. Revert it for now while investigating.
llvm-svn: 304350
2017-05-31 21:29:33 +00:00
Matthias Braun e2e65911a2 Try to fix buildbots
It seems not all of our bots have a std::vector::erase() taking a
const_iterator (even though that seems to be part of C++11) attempt to
workaround.

llvm-svn: 304349
2017-05-31 21:25:03 +00:00
Eric Fiselier 89918caaa7 Remove uses of _UI because Windows is evil and tchar.h #define's it
llvm-svn: 304348
2017-05-31 21:20:18 +00:00
Craig Topper bcd3c37f4a [TableGen] Adapt more places to getValueAsString now returning a StringRef instead of a std::string.
llvm-svn: 304347
2017-05-31 21:12:46 +00:00
Richard Smith 8b70610494 [modules] When compiling a preprocessed module map, look for headers relative
to the original module map.

Also use the path and name of the original module map when emitting that
information into the .pcm file. The upshot of this is that the produced .pcm
file will track information for headers in their original locations (where the
module was preprocessed), not relative to whatever directory the preprocessed
module map was in when it was built.

llvm-svn: 304346
2017-05-31 20:56:55 +00:00
Reid Kleckner 8ea89eaf7d [clang-cl] Expose -nostdinc and -nobuiltininc
These are already wired up to work in the MSVC toolchain header search
code. However, they were unreachable from clang-cl. A user attempted to
use them in https://bugs.llvm.org/show_bug.cgi?id=33205, so let's expose
them.

llvm-svn: 304345
2017-05-31 20:42:43 +00:00
Jonathan Peyton e3e2aaf68d Fix for KMP_AFFINITY=disabled and KMP_TOPOLOGY_METHOD=hwloc
With these settings, the create_hwloc_map() method was being called causing an
assert(). After some consideration, it was determined that disabling affinity
explicitly should just disable hwloc as well. i.e., KMP_AFFINITY overrides
KMP_TOPOLOGY_METHOD. This lets the user know that the Hwloc mechanism is being
ignored when KMP_AFFINITY=disabled.

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

llvm-svn: 304344
2017-05-31 20:35:22 +00:00
Jonathan Peyton 9f5df8b02e Address default pinning OpenMP process with multiple processor groups
This change checks if the initial affinity mask is equal to exactly one
Windows processor group's affinity mask. If it is, then the code does not
respect the initial affinity mask and uses the entire machine instead.
The reasoning behind this is that, by default, Windows assigns exactly one
processor group as the initial affinity mask even when there are multiple
Windows processor groups available. User's typically want to use the whole
machine, so we ignore this special case and use the entire machine.

If the initial affinity mask is a proper subset of one group, or spans multiple
groups, then the initial affinity mask is respected since we can assume that the
operating system did not assign this initial affinity mask. This change only
affects machines with multiple processor groups

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

llvm-svn: 304343
2017-05-31 20:33:56 +00:00
Matthias Braun ac4beccaca X86FloatingPoint: Fix livein lists
After transforming FP to ST registers:
- Do not add the ST register to the livein lists, they are reserved so
  we do not need to track their liveness.
- Remove the FP registers from the livein lists, they don't have defs or
  uses anymore and so are not live.
- (The setKillFlags() call is moved to an earlier place as it relies on
   the FP registers still being present in the livein list.)

llvm-svn: 304342
2017-05-31 20:30:22 +00:00
Matthias Braun 43692a2245 X86FloatingPoint: Add some static assert, cleanup; NFC
llvm-svn: 304341
2017-05-31 20:30:17 +00:00
Galina Kistanova c2b642d009 Added missing break; added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
llvm-svn: 304340
2017-05-31 20:25:13 +00:00
Rafael Espindola 969c6512c2 Move clearOutputSections earlier.
Another step into merging the linker script and non linker script code
paths.

llvm-svn: 304339
2017-05-31 20:22:27 +00:00
Rafael Espindola db5e56f7b2 Store a single Parent pointer for InputSectionBase.
Before InputSectionBase had an OutputSection pointer, but that was not
always valid. For example, if it was a merge section one actually had
to look at MergeSec->OutSec.

This was brittle and caused bugs like the one fixed by r304260.

We now have a single Parent pointer that points to an OutputSection
for InputSection, but to a SyntheticSection for merge sections and
.eh_frame. This makes it impossible to accidentally access an invalid
OutSec.

llvm-svn: 304338
2017-05-31 20:17:44 +00:00
Reid Kleckner 1d4cde6283 Fix cl-diagnostics.c test by hardcoding the version of MSVC to mimic
llvm-svn: 304337
2017-05-31 20:07:36 +00:00
Reid Kleckner 2918a2000b Add test case for r304316 which implemented clang-cl /diagnostics:*
llvm-svn: 304336
2017-05-31 20:02:27 +00:00
Reid Kleckner 0449316ea0 Don't try to spill static allocas when emitting expr cleanups with branches
Credit goes to Gor Nishanov for putting together the fix in
https://reviews.llvm.org/D33733!

This patch is essentially me patching it locally and writing some test
cases to convince myself that it was necessary for GNU statement
expressions with branches as well as coroutines. I'll ask Gor to land
his patch with just the coroutines test.

During LValue expression evaluation, references can be bound to
anything, really: call results, aggregate temporaries, local variables,
global variables, or indirect arguments. We really only want to spill
instructions that were emitted as part of expression evaluation, and
static allocas are not that.

llvm-svn: 304335
2017-05-31 19:59:41 +00:00
Rafael Espindola d54c566510 Simplify. NFC.
llvm-svn: 304334
2017-05-31 19:53:40 +00:00
Kostya Serebryany 2e98c045cb [libFuzzer] fix a test to match the new sanitizer run-time
llvm-svn: 304333
2017-05-31 19:47:11 +00:00
Galina Kistanova b2c0116e71 Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC.
llvm-svn: 304332
2017-05-31 19:41:33 +00:00