Petr Hosek [Tue, 30 May 2017 03:18:28 +0000 (03:18 +0000)]
[ELF] Use late evaluation for ALIGN in expression
While the following expression is handled fine:
PROVIDE_HIDDEN(newsym = oldsym + address);
The following expression triggers an error because the expression
is evaluated as absolute:
PROVIDE_HIDDEN(newsym = ALIGN(oldsym, CONSTANT(MAXPAGESIZE)) + address);
To avoid this error, we use late evaluation for ALIGN by making the
alignment an attribute of the expression itself.
Differential Revision: https://reviews.llvm.org/D33629
llvm-svn: 304185
Galina Kistanova [Tue, 30 May 2017 03:17:10 +0000 (03:17 +0000)]
Reverted r303602, as it will be fixed in gtest.
llvm-svn: 304184
Richard Smith [Tue, 30 May 2017 02:03:19 +0000 (02:03 +0000)]
[modules] When we #include a local submodule header that we've already built,
and it has an include guard, produce callbacks for a module import, not for a
skipped non-modular header.
Fixes -E output when preprocessing a module to list these cases as a module
import, rather than suppressing the #include and losing the import side effect.
llvm-svn: 304183
Rafael Espindola [Tue, 30 May 2017 01:36:48 +0000 (01:36 +0000)]
Replace a few more uses of OutputSections.
llvm-svn: 304182
Rafael Espindola [Tue, 30 May 2017 01:30:14 +0000 (01:30 +0000)]
Keep a list of all OutputSectionCommands.
Now that we are trying to use the linker script representation as the
canonycal one, there are a few loops looking for just OutputSectionCommands.
Create a vector with just the OutputSectionCommands once that is
stable to simplify the rest of the code.
llvm-svn: 304181
Eric Fiselier [Mon, 29 May 2017 23:17:28 +0000 (23:17 +0000)]
Add missing 'requires coroutines' to module map
llvm-svn: 304180
Joerg Sonnenberger [Mon, 29 May 2017 22:52:17 +0000 (22:52 +0000)]
Revert r303763, results in asserts i.e. while building Ruby.
llvm-svn: 304179
Craig Topper [Mon, 29 May 2017 21:49:37 +0000 (21:49 +0000)]
[TableGen] Use StringMap instead of DenseMap<StringRef> to unique CodeInit and StringInit objects. Override the allocator to keep using the BumpPtrAllocator. NFCI
StringMap is better suited to mapping strings than a DenseMap.
llvm-svn: 304178
Craig Topper [Mon, 29 May 2017 21:49:34 +0000 (21:49 +0000)]
[TableGen] Introduce DagInit::getArgs that returns an ArrayRef. Use it to fix 80 column violations in arg_begin/arg_end. Remove DagInit::args and use getArgs instead. NFC
llvm-svn: 304177
Gor Nishanov [Mon, 29 May 2017 21:15:31 +0000 (21:15 +0000)]
CGCoroutine.cpp: (NFC) clang-format misplaced brace
llvm-svn: 304176
Benjamin Kramer [Mon, 29 May 2017 20:56:27 +0000 (20:56 +0000)]
[ManagedStatic] Avoid putting function pointers in template args.
This is super awkward, but GCC doesn't let us have template visible when
an argument is an inline function and -fvisibility-inlines-hidden is
used.
llvm-svn: 304175
Davide Italiano [Mon, 29 May 2017 20:13:22 +0000 (20:13 +0000)]
[GlobalIsel] Fix a warning with GCC 7 -Wpedantic. NFCI.
llvm-svn: 304174
Eric Fiselier [Mon, 29 May 2017 19:46:16 +0000 (19:46 +0000)]
Fix <experimental/coroutine> in C++03
llvm-svn: 304173
Eric Fiselier [Mon, 29 May 2017 19:24:25 +0000 (19:24 +0000)]
[coroutines] Make coroutine_handle<T>::from_address ill-formed for everything but void*.
from_address requires that the provided pointer refer to the suspended coroutine,
which doesn't have a type, or at least not one knowable by the user. Therefore
every use of `from_address` with a typed pointer is almost certainly a bug.
This behavior is a part of the TS specification, but hopefully it will be
in the future.
llvm-svn: 304172
Zvi Rackover [Mon, 29 May 2017 19:00:57 +0000 (19:00 +0000)]
[X86] Add tests for (ix bitcast (vxi1 and ...)). NFC.
To be improved by D33311.
llvm-svn: 304171
Artem Dergachev [Mon, 29 May 2017 18:54:02 +0000 (18:54 +0000)]
[analyzer] Fix immutable map factory lifetime for partial taint.
This should fix the leaks found by asan buildbot in r304162.
Also don't store a reference to the factory with every map value,
which is the only difference between ImmutableMap and ImmutableMapRef.
llvm-svn: 304170
Zvi Rackover [Mon, 29 May 2017 18:27:00 +0000 (18:27 +0000)]
[X86] Replace undef value in flaky test
D33311 exposes the flakiness in this test. Replacing the undef placed by
bugpoint, makes it more interesting and robust.
llvm-svn: 304168
Benjamin Kramer [Mon, 29 May 2017 18:11:11 +0000 (18:11 +0000)]
Unbreak long test after r304127.
llvm-svn: 304167
Benjamin Kramer [Mon, 29 May 2017 18:00:33 +0000 (18:00 +0000)]
[ManagedStatic] Make object_creator/object_deleter visible again.
They're now exposed as template args, which creates complications when
ManagedStatics are used across .so boundaries.
llvm-svn: 304166
Benjamin Kramer [Mon, 29 May 2017 17:25:37 +0000 (17:25 +0000)]
Don't destroy ManagedStatics in a unit test.
Turns out this is very hostile towards other unit tests running in the
same process, it unregisters all flags.
llvm-svn: 304165
Benjamin Kramer [Mon, 29 May 2017 16:32:52 +0000 (16:32 +0000)]
[wasm] Fix test after r304117.
llvm-svn: 304164
Benjamin Kramer [Mon, 29 May 2017 16:25:20 +0000 (16:25 +0000)]
[X86] Don't fold away the memory operand of an xchg.
xchg with a mem operand has different locking semantics. If we unfold it
into a xchg r,r we will loose the implicit lock. Likewise we never want
to fold a register xchg into a memory one as it would be a lot slower.
This triggers during LLVM selfhost.
llvm-svn: 304163
Artem Dergachev [Mon, 29 May 2017 15:42:56 +0000 (15:42 +0000)]
[analyzer] Support partially tainted records.
The analyzer's taint analysis can now reason about structures or arrays
originating from taint sources in which only certain sections are tainted.
In particular, it also benefits modeling functions like read(), which may
read tainted data into a section of a structure, but RegionStore is incapable of
expressing the fact that the rest of the structure remains intact, even if we
try to model read() directly.
Patch by Vlad Tsyrklevich!
Differential revision: https://reviews.llvm.org/D28445
llvm-svn: 304162
Ayal Zaks [Mon, 29 May 2017 15:36:23 +0000 (15:36 +0000)]
[Docs] Add VectorizationPlan to docs/Proposals.
Following the request made in https://reviews.llvm.org/D32871, the
general documentation of the Vectorization Plan is hereby placed
under docs/Proposals.
llvm-svn: 304161
Artem Dergachev [Mon, 29 May 2017 15:03:20 +0000 (15:03 +0000)]
[analyzer] Initial commit for the upcoming refactoring of the IteratorChecker.
The new checker currently contains the very core infrastructure for tracking
the state of iterator-type objects in the analyzer: relating iterators to
their containers, tracking symbolic begin and end iterator values for
containers, and solving simple equality-type constraints over iterators.
A single specific check over this infrastructure is capable of finding usage of
out-of-range iterators in some simple cases.
Patch by Ádám Balogh!
Differential revision: https://reviews.llvm.org/D32592
llvm-svn: 304160
Artem Dergachev [Mon, 29 May 2017 14:51:39 +0000 (14:51 +0000)]
[analyzer] PthreadLockChecker: model failed pthread_mutex_destroy() calls.
pthread_mutex_destroy() may fail, returning a non-zero error number, and
keeping the mutex untouched. The mutex can be used on the execution branch
that follows such failure, so the analyzer shouldn't warn on using
a mutex that was previously destroyed, when in fact the destroy call has failed.
Patch by Malhar Thakkar!
Differential revision: https://reviews.llvm.org/D32449
llvm-svn: 304159
Benjamin Kramer [Mon, 29 May 2017 14:40:07 +0000 (14:40 +0000)]
Replace forward decl with include to unbreak the build.
llvm-svn: 304158
Benjamin Kramer [Mon, 29 May 2017 14:28:04 +0000 (14:28 +0000)]
Try to work around MSVC being buggy. Attempt #1.
error C2971: 'llvm::ManagedStatic': template parameter 'Creator': 'CreateDefaultTimerGroup': a variable with non-static storage duration cannot be used as a non-type argument
llvm-svn: 304157
Benjamin Kramer [Mon, 29 May 2017 14:05:29 +0000 (14:05 +0000)]
[Timer] Move DefaultTimerGroup into a ManagedStatic.
This used to be just leaked. r295370 made it use magic statics. This adds
a global destructor, which is something we'd like to avoid. It also creates
a weird situation where the mutex used by TimerGroup is re-created during
global shutdown and leaked.
Using a ManagedStatic here is also subtle as it relies on the mutex
inside of ManagedStatic to be recursive. I've added a test for that
in a previous change.
llvm-svn: 304156
Benjamin Kramer [Mon, 29 May 2017 14:05:26 +0000 (14:05 +0000)]
[ManagedStatic] Add a way to pass custom creators/deleters.
Also add a test case verifying that nested ManagedStatics work correctly.
llvm-svn: 304155
Alexander Kornienko [Mon, 29 May 2017 13:59:27 +0000 (13:59 +0000)]
[clang-tidy] Use getLocalOrGlobal for the StrictMode option
llvm-svn: 304154
Sanjay Patel [Mon, 29 May 2017 13:24:58 +0000 (13:24 +0000)]
[DAGCombiner] fix load narrowing transform to exclude loads with extension
The extending load possibility was missed in:
https://reviews.llvm.org/rL304072
We might want to handle this cases as a follow-up, but bailing out for now
to avoid miscompiling.
llvm-svn: 304153
Jonas Paulsson [Mon, 29 May 2017 13:22:23 +0000 (13:22 +0000)]
[SystemZ] Improve buildVector() in SystemZISelLowering.cpp.
Use VLREP when inserting one or more loads into a vector. This is more
efficient than to first load and then use a VLVGP.
Review: Ulrich Weigand
llvm-svn: 304152
Michael Kruse [Mon, 29 May 2017 12:27:38 +0000 (12:27 +0000)]
[ScopInfo] Do not add terminator & synthesizable instructions to the output instructions.
Such instructions are generates on-demand by the CodeGenerator and thus
do not need representation in a statement.
Differential Revision: https://reviews.llvm.org/D33642
llvm-svn: 304151
Mattias Eriksson [Mon, 29 May 2017 11:46:44 +0000 (11:46 +0000)]
Test commit: fix typos
Just fixing a few typos in comments to test commit access.
llvm-svn: 304149
Siddharth Bhat [Mon, 29 May 2017 11:34:29 +0000 (11:34 +0000)]
Revert "[NFC] Fix formatting & typecast issue. Build succeeds."
Should not have 'fixed' the formatting issue, I did not have the most
recent version of `clang-format`.
This reverts commit
761b1268359e14e59142f253d77864a29d55c56c.
llvm-svn: 304148
Abhishek Aggarwal [Mon, 29 May 2017 11:13:30 +0000 (11:13 +0000)]
Replaced StructuredData::Type with eStructuredDataType
...missing from r304138 "Added new API to SBStructuredData class"
llvm-svn: 304147
Siddharth Bhat [Mon, 29 May 2017 11:00:31 +0000 (11:00 +0000)]
[NFC] Fix formatting & typecast issue. Build succeeds.
- Fix formatting in `RegisterPasses.cpp`.
- `assert` tried to compare `isl::boolean` against `long`. Explicitly
construct `bool` from `isl::boolean`. This allows the implicit cast of
`bool` to `long.
llvm-svn: 304146
Nikolai Bozhenov [Mon, 29 May 2017 09:48:30 +0000 (09:48 +0000)]
[Nios2] Target registration
Reviewers: craig.topper, hfinkel, joerg, lattner, zvi
Reviewed By: craig.topper
Subscribers: oren_ben_simhon, igorb, belickim, tvvikram, mgorny, llvm-commits, pavel.v.chupin, DavidKreitzer
Differential Revision: https://reviews.llvm.org/D32669
Patch by AndreiGrischenko <andrei.l.grischenko@intel.com>
llvm-svn: 304144
Diana Picus [Mon, 29 May 2017 09:09:54 +0000 (09:09 +0000)]
[ARM] GlobalISel: Extract helper. NFCI.
Create a helper to deal with the common code for merging incoming values
together after they've been split during call lowering. There's likely
more stuff that can be commoned up here, but we'll leave that for later.
llvm-svn: 304143
Stephan Bergmann [Mon, 29 May 2017 08:51:58 +0000 (08:51 +0000)]
More StructuredData::Type::eTypeDictionary -> lldb::eStructuredDataTypeDictionary
...missing from previous r304138 "Added new API to SBStructuredData class"
llvm-svn: 304142
Martin Probst [Mon, 29 May 2017 08:41:11 +0000 (08:41 +0000)]
clang-format: [JS] do not clean up duplicated commas.
Summary:
In JavaScript, duplicated commas have semantic meaning.
x = [a,,b];
The statement above creates an array with three entries, the middle being undefined. Because clang-format should not change semantics, disable this cleanup in JS.
Reviewers: djasper
Subscribers: klimek
Differential Revision: https://reviews.llvm.org/D33641
llvm-svn: 304141
George Rimar [Mon, 29 May 2017 08:37:50 +0000 (08:37 +0000)]
[ELF] - Do not allow -r to eat comdats.
This is PR33052, "Bug 33052 - -r eats comdats ".
To fix it I stop removing group section from out when -r is given
and fixing SHT_GROUP content when writing it just like we do some
other fixup, e.g. for Rel[a]. (it needs fix for section indices that
are in group).
Differential revision: https://reviews.llvm.org/D33485
llvm-svn: 304140
Hiroshi Inoue [Mon, 29 May 2017 08:37:42 +0000 (08:37 +0000)]
[trivial] fix a typo in comment, NFC
llvm-svn: 304139
Abhishek Aggarwal [Mon, 29 May 2017 08:25:46 +0000 (08:25 +0000)]
Added new API to SBStructuredData class
Summary:
- Added API to access data types
-- integer, double, array, string, boolean and dictionary data types
-- Earlier user had to parse through the string output to get these
values
- Added Test cases for API testing
- Added new StructuredDataType enum in public include file
-- Replaced locally-defined enum in StructuredData.h with this new
one
-- Modified other internal files using this locally-defined enum
Signed-off-by: Abhishek Aggarwal <abhishek.a.aggarwal@intel.com>
Reviewers: clayborg, lldb-commits
Reviewed By: clayborg
Subscribers: labath
Differential Revision: https://reviews.llvm.org/D33434
llvm-svn: 304138
Diana Picus [Mon, 29 May 2017 08:19:19 +0000 (08:19 +0000)]
[ARM] GlobalISel: Support array returns
These are a bit rare in practice, but they don't require anything
special compared to array parameters, so support them as well.
llvm-svn: 304137
Tobias Grosser [Mon, 29 May 2017 08:06:29 +0000 (08:06 +0000)]
Adapt to recent clang-format changes
llvm-svn: 304136
Martin Probst [Mon, 29 May 2017 07:50:52 +0000 (07:50 +0000)]
clang-format: [JS] fix indenting bound functions.
Summary:
The previous fix to force build style wrapping if the previous token is a closing parenthesis broke a peculiar pattern where users parenthesize the function declaration in a bind call:
fn((function() { ... }).bind(this));
This restores the previous behaviour by reverting that change, but narrowing the special case for unindenting closing parentheses to those followed by semicolons and opening braces, i.e. immediate calls and function declarations.
Reviewers: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D33640
llvm-svn: 304135
Egor Churaev [Mon, 29 May 2017 07:44:22 +0000 (07:44 +0000)]
[OpenCL] Test on half immediate support.
Reviewers: Anastasia
Reviewed By: Anastasia
Subscribers: yaxunl, cfe-commits, bader
Differential Revision: https://reviews.llvm.org/D33592
llvm-svn: 304134
Hiroshi Inoue [Mon, 29 May 2017 07:12:39 +0000 (07:12 +0000)]
[PPC] Fix assertion failure during binary encoding with -mcpu=pwr9
Summary
clang -c -mcpu=pwr9 test/CodeGen/PowerPC/build-vector-tests.ll causes an assertion failure during the binary encoding.
The failure occurs when a D-form load instruction takes two register operands instead of a register + an immediate.
This patch fixes the problem and also adds an assertion to catch this failure earlier before the binary encoding (i.e. during lit test).
The fix is from Nemanja Ivanovic @nemanjai.
Differential Revision: https://reviews.llvm.org/D33482
llvm-svn: 304133
Diana Picus [Mon, 29 May 2017 07:01:52 +0000 (07:01 +0000)]
[ARM] GlobalISel: Support array parameters/arguments
Clang coerces structs into arrays, so it's a good idea to support them.
Most of the support boils down to getting the splitToValueTypes helper
to actually split types. We then use G_INSERT/G_EXTRACT to deal with the
parts.
llvm-svn: 304132
Eric Fiselier [Mon, 29 May 2017 06:42:01 +0000 (06:42 +0000)]
Fix coroutine test failures caused by API misusages.
More tests to come. I think that from_address overload should be deleted
or ill-formed, except for the 'void*' one; The user cannot possibly
have a typed pointer to the coroutine state.
llvm-svn: 304131
Mehdi Amini [Mon, 29 May 2017 06:32:34 +0000 (06:32 +0000)]
DebugInfo: Include .dwo file name when hashing multiple CUs in a single file
This is really a workaround for ThinLTO in particular - since it can
import partial CUs that may end up looking very similar/the same as
the same partial import in another ThinLTO compile.
An alternative fix would be to change the DICompileUnit metadata to
include a "primary file" or the like - and when importing for ThinLTO
set the primary file to the name of the DICompileUnit that is being
imported into. This involves changing the schema and would reduce the
excessive uniqueness in the hash that this change creates - allowing
diagnosing of more duplicate CUs than will be caught with this change.
But duplicate CUs can still be caught in non-ThinLTO builds & are mostly
a nuisance rather than a particularly deliberate/effective tool for
finding broken code. (arguably the hash could always include the dwo
file and nothing in fission would break, I think..)
Reapply of r304119 after adding a triple to the test and moving it
to the X86 directory.
llvm-svn: 304130
Mehdi Amini [Mon, 29 May 2017 06:25:30 +0000 (06:25 +0000)]
DebugInfo: Omit an empty CU when a subprogram was moved into its use
When the only use of a CU is for a subprogram that's only emitted into
the using CU (to avoid cross-CU references in DWO files), avoid creating
that CU at all.
Reapply of r304111 after adding a triple to the test and moving it
to the X86 directory.
llvm-svn: 304129
Tobias Grosser [Mon, 29 May 2017 06:12:18 +0000 (06:12 +0000)]
Revert "[IfConversion] Keep the CFG updated incrementally in IfConvertTriangle"
The reverted change introdued assertions ala:
"MachineBasicBlock::succ_iterator
llvm::MachineBasicBlock::removeSuccessor(succ_iterator, bool): Assertion
`I != Successors.end() && "Not a current successor!"'
Mikael, the original committer, wrote me that he is working on a fix, but that
it likely will take some time to get this resolved. As this bug is one of the
last two issues that keep the AOSP buildbot from turning green, I revert the
original commit r302876.
I am looking forward to see this recommitted after the assertion has been
resolved.
llvm-svn: 304128
Mehdi Amini [Mon, 29 May 2017 05:38:20 +0000 (05:38 +0000)]
IRGen: Add optnone attribute on function during O0
Amongst other, this will help LTO to correctly handle/honor files
compiled with O0, helping debugging failures.
It also seems in line with how we handle other options, like how
-fnoinline adds the appropriate attribute as well.
Differential Revision: https://reviews.llvm.org/D28404
llvm-svn: 304127
Mehdi Amini [Mon, 29 May 2017 05:17:57 +0000 (05:17 +0000)]
Revert "DebugInfo: Omit an empty CU when a subprogram was moved into its use"
This reverts commit r304111.
GreenDragon is broken.
llvm-svn: 304126
Mehdi Amini [Mon, 29 May 2017 05:17:54 +0000 (05:17 +0000)]
Revert "DebugInfo: Include .dwo file name when hashing multiple CUs in a single file"
This reverts commit r304119 and r304118. GreenDragon is broken.
llvm-svn: 304125
Eric Fiselier [Mon, 29 May 2017 05:00:24 +0000 (05:00 +0000)]
Fix multiple bugs in coroutine tests.
llvm-svn: 304124
Zachary Turner [Mon, 29 May 2017 02:20:12 +0000 (02:20 +0000)]
Don't capture a temporary std::string in a StringRef.
This fixes the breakages in llvm-tblgen.
llvm-svn: 304123
Zachary Turner [Mon, 29 May 2017 02:19:37 +0000 (02:19 +0000)]
Resubmit "[X86] Adding new LLVM TableGen backend that generates the X86 backend memory folding tables."
This was reverted due to buildbot breakages and I was not familiar
with this code to investigate it. But while trying to get a
useful backtrace for the author, it turns out the fix was very
obvious. Resubmitting this patch as is, and will submit the
fix in a followup so that the fix is not hidden in the larger
CL.
llvm-svn: 304122
Zachary Turner [Mon, 29 May 2017 01:48:53 +0000 (01:48 +0000)]
Revert "[X86] Adding new LLVM TableGen backend that generates the X86 backend memory folding tables."
This reverts commit
28cb1003507f287726f43c771024a1dc102c45fe as well
as all subsequent followups. llvm-tblgen currently segfaults with
this change, and it seems it has been broken on the bots all
day with no fixes in preparation. See, for example:
http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/
llvm-svn: 304121
Galina Kistanova [Mon, 29 May 2017 01:34:26 +0000 (01:34 +0000)]
Disabled implicit-fallthrough warnings for ConvertUTF.cpp.
ConvertUTF.cpp has a little dependency on LLVM, and since the code extensively uses fall-through switches,
I prefer disabling the warning for the whole file, rather than adding attributes for each case.
llvm-svn: 304120
David Blaikie [Mon, 29 May 2017 00:48:45 +0000 (00:48 +0000)]
DebugInfo: Include .dwo file name when hashing multiple CUs in a single file
This is really a workaround for ThinLTO in particular - since it can
import partial CUs that may end up looking very similar/the same as
the same partial import in another ThinLTO compile.
An alternative fix would be to change the DICompileUnit metadata to
include a "primary file" or the like - and when importing for ThinLTO
set the primary file to the name of the DICompileUnit that is being
imported into. This involves changing the schema and would reduce the
excessive uniqueness in the hash that this change creates - allowing
diagnosing of more duplicate CUs than will be caught with this change.
But duplicate CUs can still be caught in non-ThinLTO builds & are mostly
a nuisance rather than a particularly deliberate/effective tool for
finding broken code. (arguably the hash could always include the dwo
file and nothing in fission would break, I think..)
llvm-svn: 304119
David Blaikie [Mon, 29 May 2017 00:24:01 +0000 (00:24 +0000)]
Attempt to fix buildbots...
llvm-svn: 304118
Saleem Abdulrasool [Mon, 29 May 2017 00:14:57 +0000 (00:14 +0000)]
Support: adjust the default obj format for wasm
WebAssemly uses a custom object file format. For the wasm targets,
default to the `Wasm` object file format.
llvm-svn: 304117
Dylan McKay [Mon, 29 May 2017 00:10:14 +0000 (00:10 +0000)]
[AVR] Remove SREG from CPI's Uses; authored by Florian Zeitz
Summary: CPI does not read the status register, but only writes it.
Reviewers: dylanmckay
Reviewed By: dylanmckay
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D33223
llvm-svn: 304116
Craig Topper [Sun, 28 May 2017 23:47:17 +0000 (23:47 +0000)]
[TableGen][X86] Fix formatting I accidentally messed up in r304099. NFC
llvm-svn: 304115
Erik Pilkington [Sun, 28 May 2017 23:24:52 +0000 (23:24 +0000)]
[ItaniumDemangle] Fix a exponential string copying bug
This is a port of libcxxabi's r304113.
llvm-svn: 304114
Erik Pilkington [Sun, 28 May 2017 23:15:50 +0000 (23:15 +0000)]
[demangler] Fix a exponential string copying bug
The problem was that if base_name() was called from a context without
an actual base name, it could gulp up the entire string, which can
result in recursive duplications. The fix is to be more strict as to
what qualifies as a base name.
Differential revision: https://reviews.llvm.org/D33637
llvm-svn: 304113
NAKAMURA Takumi [Sun, 28 May 2017 22:54:25 +0000 (22:54 +0000)]
Prune trailing whitespace. (To regenerate makefiles)
llvm-svn: 304112
David Blaikie [Sun, 28 May 2017 22:51:37 +0000 (22:51 +0000)]
DebugInfo: Omit an empty CU when a subprogram was moved into its use
When the only use of a CU is for a subprogram that's only emitted into
the using CU (to avoid cross-CU references in DWO files), avoid creating
that CU at all.
llvm-svn: 304111
Martell Malone [Sun, 28 May 2017 22:46:50 +0000 (22:46 +0000)]
[libcxxabi] Disable DLL annotations on static
rL288692 renames
_LIBCXXABI_DISABLE_DLL_IMPORT_EXPORT to
_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS
llvm-svn: 304110
Geoff Berry [Sun, 28 May 2017 22:20:44 +0000 (22:20 +0000)]
[AArch64][Falkor] Combine sched details files into one. NFC.
llvm-svn: 304109
Geoff Berry [Sun, 28 May 2017 21:48:31 +0000 (21:48 +0000)]
[AArch64][Falkor] Fix some sched details.
- Remove all uses of base sched model entries and set them all to
Unsupported so all the opcodes are described in
AArch64SchedFalkorDetails.td.
- Remove entries for unsupported half-float opcodes.
- Remove entries for unsupported LSE extension opcodes.
- Add entry for MOVbaseTLS (and set Sched in base td file entry to
WriteSys) and a few other pseudo ops.
- Fix a few FP load/store with reg offset entries to use the LSLfast
predicates.
- Add Q size BIF/BIT/BSL entries.
- Fix swapped Q/D sized CLS/CLZ/CNT/RBIT entires.
- Fix pre/post increment address register latency (this operand is
always dest 0).
- Fix swapped FCVTHD/FCVTHS/FCVTDH/FCVTDS entries.
- Fix XYZ resource over usage on LD[1-4] opcodes.
llvm-svn: 304108
Eric Fiselier [Sun, 28 May 2017 21:07:22 +0000 (21:07 +0000)]
[coroutines] Support "coroutines" feature in module map requires clause
Summary: In order for libc++ to add `<experimental/coroutine>` to its module map, there has to be a feature that can be used to detect if coroutines support is enabled in Clang.
Reviewers: rsmith
Reviewed By: rsmith
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D33538
llvm-svn: 304107
Eric Fiselier [Sun, 28 May 2017 20:56:16 +0000 (20:56 +0000)]
Correct XFAIL's in coroutine tests to only list ubsan
llvm-svn: 304106
Eric Fiselier [Sun, 28 May 2017 20:49:13 +0000 (20:49 +0000)]
Fix use of uninitialized memory
llvm-svn: 304105
Eric Fiselier [Sun, 28 May 2017 20:49:11 +0000 (20:49 +0000)]
XFAIL tests which trigger coroutine debug info crash in Clang
llvm-svn: 304104
Eric Fiselier [Sun, 28 May 2017 20:30:18 +0000 (20:30 +0000)]
Add hack to allow test to run w/o C++17 copy elision
llvm-svn: 304103
Eric Fiselier [Sun, 28 May 2017 20:25:41 +0000 (20:25 +0000)]
Remove XFAIL's for recently fixed bug
llvm-svn: 304102
Eric Fiselier [Sun, 28 May 2017 19:38:21 +0000 (19:38 +0000)]
[coroutines] Add end-to-end tests within libc++
This patch adds end-to-end/breathing tests for coroutines
into libc++. The tests aren't specifically to test libc++ requirements
but instead are intented to ensure coroutines are working fine in general.
Although libc++ isn't exactly the most correct place for these tests
to live, there is one major advantage. The libc++ test suite is also
used by MSVC and by adding the tests here it ensures they will be
run against all currently available coroutine implementations.
llvm-svn: 304101
Craig Topper [Sun, 28 May 2017 18:24:43 +0000 (18:24 +0000)]
[TableGen][X86] Use CHAR_BIT with sizeof instead of hardcoded 8. NFC
llvm-svn: 304100
Craig Topper [Sun, 28 May 2017 18:24:41 +0000 (18:24 +0000)]
[TableGen][X86] Mark a couple global tables as const. NFC
llvm-svn: 304099
Craig Topper [Sun, 28 May 2017 18:24:39 +0000 (18:24 +0000)]
[TableGen][X86] Improve formatting of the fold table output by indenting the body of the table and adding blank lines between tables. NFC
llvm-svn: 304098
Craig Topper [Sun, 28 May 2017 18:24:37 +0000 (18:24 +0000)]
[TableGen][X86] Add an llvm_unreachable to a switch so we get an error if we need expansion in the future.
llvm-svn: 304097
Craig Topper [Sun, 28 May 2017 18:24:35 +0000 (18:24 +0000)]
[TableGen][X86] Remove unnecessary std::string creations. NFC
llvm-svn: 304096
Craig Topper [Sun, 28 May 2017 18:24:32 +0000 (18:24 +0000)]
[TableGen][X86] Replace a global std::vector with a regular array. llvm::find works on arrays, just need to use std::end to check the result.
llvm-svn: 304095
Eric Fiselier [Sun, 28 May 2017 18:21:12 +0000 (18:21 +0000)]
[coroutines] Diagnose invalid result types for `await_resume` and `await_suspend` and add missing conversions.
Summary:
The expression `await_ready` is required to be contextually convertible to bool and `await_suspend` must be a prvalue of either `void` or `bool`.
This patch adds diagnostics for when those requirements are violated.
It also correctly performs the contextual conversion to bool on the result of `await_ready`
Reviewers: GorNishanov, rsmith
Reviewed By: GorNishanov
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D33625
llvm-svn: 304094
Craig Topper [Sun, 28 May 2017 17:48:41 +0000 (17:48 +0000)]
[TableGen][X86] getValueAsString returns a std::string not a StringRef. Capture it that way to avoid a StringRef to a temporary.
llvm-svn: 304093
Gor Nishanov [Sun, 28 May 2017 17:35:23 +0000 (17:35 +0000)]
[coroutines] www/cxx_status.html: add non-breaking hyphen
Reviewers: GorNishanov
Reviewed By: GorNishanov
Subscribers: EricWF, rsmith, cfe-commits
Differential Revision: https://reviews.llvm.org/D33632
llvm-svn: 304092
Gor Nishanov [Sun, 28 May 2017 16:25:31 +0000 (16:25 +0000)]
[coroutines] www/cxx_status.html: add non-breaking hyphen
Reviewers: GorNishanov
Reviewed By: GorNishanov
Subscribers: EricWF, rsmith, cfe-commits
Differential Revision: https://reviews.llvm.org/D33632
llvm-svn: 304091
Sanjay Patel [Sun, 28 May 2017 13:57:59 +0000 (13:57 +0000)]
[x86] auto-generate better checks; NFC
llvm-svn: 304090
Benjamin Kramer [Sun, 28 May 2017 13:23:02 +0000 (13:23 +0000)]
[InstrProf] Use more ArrayRef/StringRef.
No functional change intended.
llvm-svn: 304089
Ayman Musa [Sun, 28 May 2017 12:55:36 +0000 (12:55 +0000)]
[X86] Adding new LLVM TableGen backend that generates the X86 backend memory folding tables.
X86 backend holds huge tables in order to map between the register and memory forms of each instruction.
This TableGen Backend automatically generated all these tables with the appropriate flags for each entry.
Differential Revision: https://reviews.llvm.org/D32684
llvm-svn: 304088
Ayman Musa [Sun, 28 May 2017 12:39:37 +0000 (12:39 +0000)]
[X86] Adding FoldGenRegForm helper field (for memory folding tables tableGen backend) to X86Inst class and set its value for the relevant instructions.
Some register-register instructions can be encoded in 2 different ways, this happens when 2 register operands can be folded (separately).
For example if we look at the MOV8rr and MOV8rr_REV, both instructions perform exactly the same operation, but are encoded differently. Here is the relevant information about these instructions from Intel's 64-ia-32-architectures-software-developer-manual:
Opcode Instruction Op/En 64-Bit Mode Compat/Leg Mode Description
8A /r MOV r8,r/m8 RM Valid Valid Move r/m8 to r8.
88 /r MOV r/m8,r8 MR Valid Valid Move r8 to r/m8.
Here we can see that in order to enable the folding of the output and input registers, we had to define 2 "encodings", and as a result we got 2 move 8-bit register-register instructions.
In the X86 backend, we define both of these instructions, usually one has a regular name (MOV8rr) while the other has "_REV" suffix (MOV8rr_REV), must be marked with isCodeGenOnly flag and is not emitted from CodeGen.
Automatically generating the memory folding tables relies on matching encodings of instructions, but in these cases where we want to map both memory forms of the mov 8-bit (MOV8rm & MOV8mr) to MOV8rr (not to MOV8rr_REV) we have to somehow point from the MOV8rr_REV to the "regular" appropriate instruction which in this case is MOV8rr.
This field enable this "pointing" mechanism - which is used in the TableGen backend for generating memory folding tables.
Differential Revision: https://reviews.llvm.org/D32683
llvm-svn: 304087
Oren Ben Simhon [Sun, 28 May 2017 11:26:11 +0000 (11:26 +0000)]
[X86] Fixing VPOPCNTDQ feature set lookup.
llvm-svn: 304086
Ismail Donmez [Sun, 28 May 2017 06:15:42 +0000 (06:15 +0000)]
baremetal.cpp: Fix tests where lib suffix is 64
llvm-svn: 304085
Galina Kistanova [Sun, 28 May 2017 05:50:22 +0000 (05:50 +0000)]
Reverted r304083 as it seems there is a desire to address this in the googletest.
llvm-svn: 304084
Galina Kistanova [Sun, 28 May 2017 03:50:52 +0000 (03:50 +0000)]
Added braces to address gcc warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]. NFC.
llvm-svn: 304083