Commit Graph

283780 Commits

Author SHA1 Message Date
Rui Ueyama 26a84fc84f [WebAssembly] Fix variable name.
llvm-svn: 326301
2018-02-28 03:43:38 +00:00
Rui Ueyama 67769100ce [WebAssembly] Remove unnecessary namespace specifiers. NFC.
llvm-svn: 326300
2018-02-28 03:38:14 +00:00
Richard Smith 77a9c60aa6 Fix a couple of cases where we would fail to correctly parse deduced class template specialization types.
Specifically, we would not properly parse these types within template arguments
(for non-type template parameters), and in tentative parses. Fixing both of
these essentially requires that we parse deduced template specialization types
as types in all contexts, even in template argument lists -- in particular,
tentative parsing may look ahead and annotate a deduced template specialization
type before we figure out that we're actually supposed to treat the tokens as a
template-name. We deal with this by simply permitting deduced template
specialization types when parsing template arguments, and converting them to
template template arguments.

llvm-svn: 326299
2018-02-28 03:02:23 +00:00
Richard Smith c1a40220b4 Update cxx_status to mark "SVN" items as "Clang 6" instead.
llvm-svn: 326298
2018-02-28 03:02:07 +00:00
Rui Ueyama 0a9583ce79 [WebAssembly] Simplify initializeSymbols and merge it with ObjFile::parse. NFC.
This patch simplifies initializeSymbols. Since that function is called
at the tail context of ObjFile::parse, and the function is called only
once from that function, that's effectively just a continuation of
ObjFile::parse. So this patch merge it with ObjFile::parse.

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

llvm-svn: 326296
2018-02-28 02:57:37 +00:00
George Karpenkov 3f560daf37 [analyzer] [tests] Write to logfile instead of stdout while updating
reference results

llvm-svn: 326295
2018-02-28 01:55:23 +00:00
Sam Clegg 42cf40b4c5 [WebAssembly] Add test for `--undefined` flag. NFC.
Specifically the case where the undefined symbol is not found
during the link.

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

llvm-svn: 326294
2018-02-28 01:42:16 +00:00
Rui Ueyama 5420dd098b [WebAssembly] Simplify Symbol::getWasmType. NFC.
Differential Revision: https://reviews.llvm.org/D43717

llvm-svn: 326293
2018-02-28 01:10:50 +00:00
Eugene Zelenko 5bc81eb980 [StaticAnalyzer] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 326292
2018-02-28 01:10:04 +00:00
Rui Ueyama b911f12211 [WebAssembly] Inline translateVA as it's trivial.
The problem I want to address now is that chunks have too many data
members for "offsets", and their origins are not well defined.
For example, InputSegment has OutputSegmentOffset, but it's base class
also has OutputOffset. That's very confusing.

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

llvm-svn: 326291
2018-02-28 01:01:34 +00:00
Lang Hames 6588f14a6c [RuntimeDyld][MachO] Support ARM64_RELOC_BRANCH26 for BL instructions by
relaxing an assertion.

llvm-svn: 326290
2018-02-28 00:58:21 +00:00
Rui Ueyama 4764b5748a [WebAssembly] Remove ELF-ness.
These output section names are ELF-specific. We shouldn't have this rule
for WebAssembly.

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

llvm-svn: 326289
2018-02-28 00:57:28 +00:00
Justin Bogner 35a9d1b17f update_mir_test_checks: Use the regexes from UpdateTestChecks.common
Some of the update_*_test_checks regexes have been moved into a
library, so we might as well use them in update_mir_test_checks.
Also includes minor bugfixes to the regexes that are there so we
don't regress update_mir_test_checks

llvm-svn: 326288
2018-02-28 00:56:24 +00:00
Fangrui Song 2074eab509 [ELF] Rename test/ELF/note-loadaddr.c to .s NFC
llvm-svn: 326287
2018-02-28 00:53:51 +00:00
Rui Ueyama 4a1b2bbc88 [WebAssembly] Do not use inheritance to define SubSection.
SubSection inherited from SyntheticSection, and SyntheticSection inherits
from OutputSection, so SubSection was an OutputSection. But that's wrong
because SubSection is not actually a WebAssembly output section.
It shares some functionalities with OutputSection, but overall it's very
different.

This patch removes that inheritance.

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

llvm-svn: 326286
2018-02-28 00:52:42 +00:00
Rui Ueyama 4b56adce20 [WebAssembly] Refactor ObjFile::initializeSymbols.
The main purpose of this change is to make initializeSymbols shorter.

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

llvm-svn: 326285
2018-02-28 00:50:54 +00:00
Justin Bogner d3eccb54b1 update_mir_test_checks: Drop support for vreg block checks
Since vregs are printed in the instruction stream now, checking the
vreg block is always redundant. Remove the temporary feature that
allowed us to do that.

This reverts r316134

llvm-svn: 326284
2018-02-28 00:44:46 +00:00
Rui Ueyama 19eedbf013 [WebAssembly] Do not use Subsection as a local variable name.
That variable hides the class of the same name.

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

llvm-svn: 326283
2018-02-28 00:39:30 +00:00
Rui Ueyama c61b834f31 [WebAssembly] Do not use default arguments for SymbolTable.
Differential Revision: https://reviews.llvm.org/D43727

llvm-svn: 326282
2018-02-28 00:37:03 +00:00
Rui Ueyama caa8e2335f [WebAssembly] Do not remove existing output file.
FileOutputBuffer automatically removes an existing file, so we don't
need to do that. Actually doing that is discouraged because when the
linker fails to create an output for some reason after instantiating
FileOutputBufffer, FileOutputBuffer removes a temporary file and don't
touch an existing file. That's an desired behavior from the user's
point of view.

(Internally, FileOutputBuffer writes its contents to a temporary file
and then rename it over to an existing file on commit()).

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

llvm-svn: 326281
2018-02-28 00:33:59 +00:00
Rui Ueyama 319eb8b3c3 [WebAssembly] Remove redundant local variables.
Differential Revision: https://reviews.llvm.org/D43709

llvm-svn: 326280
2018-02-28 00:31:16 +00:00
Rui Ueyama 8bfa2a629d [WebAssembly] Simplify createLikingSection.
Summary: [WebAssembly] Simplify createLikingSection.

Reviewers: sbc100

Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits

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

llvm-svn: 326279
2018-02-28 00:28:07 +00:00
Konstantin Zhuravlyov 419889e266 AMDGPU: Move run and check lines around to match processor order in AMDGPU.h
llvm-svn: 326278
2018-02-28 00:27:00 +00:00
Rui Ueyama d1063bb9f9 [WebAssembly] Inline accessor functions that are called only once.
Looks like these accessor functions are a bit overly defensive, and
due to the amount of code, that part isn't easy to read. We have
code to log translation results in writeTo and writeRelocations, so
I don't think we need to log it again in these functions.
I think the new function is much easier to understand.

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

llvm-svn: 326277
2018-02-28 00:26:26 +00:00
Rui Ueyama 28f3b20db5 [WebAssembly] Remove trivial accessors.
{set,get}OutputSegment don't hide anything, so remove them.

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

llvm-svn: 326276
2018-02-28 00:20:29 +00:00
Rui Ueyama 7d696880fb [WebAssembly] Use more specific type and simplify code.
Instead of {Function,Global,Data}Symbol, use Defined{Function,Global,Data}
because undefined symbol should never reach this function.

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

llvm-svn: 326275
2018-02-28 00:18:34 +00:00
Rui Ueyama 4145d252c2 [WebAssembly] Remove LastDefinedKind for consistency with undefined kinds. NFC.
Differential Revision: https://reviews.llvm.org/D43711

llvm-svn: 326274
2018-02-28 00:16:11 +00:00
Rui Ueyama da69b711c9 [WebAssembly] Remove premature optimization.
I think calling reserve() for each object file is too many and isn't useful.
We can add reserve() later. By default, we shouldn't add reserve() to a lot
of places.

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

llvm-svn: 326273
2018-02-28 00:15:59 +00:00
Rafael Espindola bb333c26ed Inline trivial function. NFC.
llvm-svn: 326272
2018-02-28 00:14:18 +00:00
Rui Ueyama e3498ec562 [WebAssembly] Separate addUndefined into addUndefined{Function,Data,Global}.
Previously, one function adds all types of undefined symbols. That
doesn't fit to the wasm's undefined symbol semantics well because
different types of undefined symbols are very different in wasm.
As a result, separate control flows merge in this addUndefined function
and then separate again for each type. That wasn't easy to read.

This patch separates the function into three functions. Now it is pretty
clear what we are doing for each undefined symbol type.

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

llvm-svn: 326271
2018-02-28 00:09:22 +00:00
Rafael Espindola fa2fc906d2 Pass a GlobalDecl to setAliasAttributes. NFC.
This just makes a followup change easier to read.

llvm-svn: 326270
2018-02-28 00:06:01 +00:00
Rui Ueyama 37254065dd [WebAssembly] Use StringRef instead of `const char *`.
Differential Revision: https://reviews.llvm.org/D43721

llvm-svn: 326269
2018-02-28 00:01:31 +00:00
Sam Clegg 99eb42c0c5 [WebAssembly] Remove DataSize from linking metadata
This means we don't need to write the linking metadata section
at all for executable (non-relocatable) output.

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

llvm-svn: 326268
2018-02-27 23:58:03 +00:00
Sam Clegg 86b4a09a99 [WebAssembly] Remove DataSize from linking metadata section
Neither the linker nor the runtime need this information
anymore.  We were originally using this to model BSS size
but the plan is now to use the segment metadata to allow
for BSS segments.

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

llvm-svn: 326267
2018-02-27 23:57:37 +00:00
Aaron Ballman 48a533d005 Improve the way attribute argument printing happens for omitted optional arguments when pretty printing.
Patch by Joel Denny.

llvm-svn: 326266
2018-02-27 23:49:28 +00:00
Rafael Espindola 64393cfca0 Pass a GlobalDecl to setFunctionDefinitionAttributes. NFC.
This just makes a followup patch easier to read.

llvm-svn: 326265
2018-02-27 23:44:36 +00:00
Pavel Labath 9bdd03f7da Fix lldbinline tests for remote targets
r326140 exposed the fact that we are not actually running inline tests on
remote targets. The tests fail to launch the inferior in the first place
because they passed an invalid working directory to the launch function.

This should fix that.

llvm-svn: 326264
2018-02-27 22:45:49 +00:00
Krzysztof Parzyszek 2373f8fcf3 [Hexagon] Recognize more sign-extensions as inputs to 32x32-bit multiply
llvm-svn: 326263
2018-02-27 22:44:41 +00:00
Krzysztof Parzyszek 2d79017d85 [Pipeliner] Drop memrefs instead of creating ones with size UINT64_MAX
Absence of memory operands is treated as "aliasing everything", so
dropping them is sufficient.

Recommit r326256 with a fixed testcase.

llvm-svn: 326262
2018-02-27 22:40:52 +00:00
Pavel Labath 029fb69372 [lldb] Use vFlash commands when writing to target's flash memory regions
Summary:
When writing an object file over gdb-remote, use the vFlashErase, vFlashWrite, and vFlashDone commands if the write address is in a flash memory region.  A bare metal target may have this kind of setup.

- Update ObjectFileELF to set load addresses using physical addresses.  A typical case may be a data section with a physical address in ROM and a virtual address in RAM, which should be loaded to the ROM address.
- Add support for querying the target's qXfer:memory-map, which contains information about flash memory regions, leveraging MemoryRegionInfo data structures with minor modifications
- Update ProcessGDBRemote to use vFlash commands in DoWriteMemory when the target address is in a flash region

Original discussion at http://lists.llvm.org/pipermail/lldb-dev/2018-January/013093.html

Reviewers: clayborg, labath

Reviewed By: labath

Subscribers: arichardson, emaste, mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D42145
Patch by Owen Shaw <llvm@owenpshaw.net>

llvm-svn: 326261
2018-02-27 22:14:33 +00:00
Reid Kleckner 3acdc67734 [CodeView] Lower __restrict and other pointer qualifiers correctly
Qualifiers on a pointer or reference type may apply to either the
pointee or the pointer itself. Consider 'const char *' and 'char *
const'. In the first example, the pointee data may not be modified
without casts, and in the second example, the pointer may not be updated
to point to new data.

In the general case, qualifiers are applied to types with LF_MODIFIER
records, which support the usual const and volatile qualifiers as well
as the __unaligned extension qualifier.

However, LF_POINTER records, which are used for pointers, references,
and member pointers, have flags for qualifiers applying to the
*pointer*. In fact, this is the only way to represent the restrict
qualifier, which can only apply to pointers, and cannot qualify regular
data types.

This patch causes LLVM to correctly fold 'const' and 'volatile' pointer
qualifiers into the pointer record, as well as adding support for
'__restrict' qualifiers in the same place.

Based on a patch from Aaron Smith

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

llvm-svn: 326260
2018-02-27 22:08:15 +00:00
Krzysztof Parzyszek 10ab103a58 Revert "[Pipeliner] Drop memrefs instead of creating ones with size UINT64_MAX"
This reverts r326256. One testcase needs to be updated.

llvm-svn: 326259
2018-02-27 22:07:38 +00:00
Artem Dergachev f119bf99e5 [analyzer] UndefinedAssignmentChecker: Better warning message in implicit ctors.
When a class forgets to initialize a field in the constructor, and then gets
copied around, a warning is emitted that the value assigned to a specific field
is undefined.

When the copy/move constructor is implicit (not written out in the code) but not
trivial (is not a trivial memory copy, eg. because members have an explicit copy
constructor), the body of such constructor is auto-generated in the AST.
In this case the checker's warning message is squeezed at the top of
the class declaration, and it gets hard to guess which field is at fault.

Fix the warning message to include the name of the field.

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

llvm-svn: 326258
2018-02-27 22:05:55 +00:00
Alexander Richardson 8edd70b7c6 [ELF] Add llvm-readelf to the lit tool substitutions
Summary:
Some of the tests invoke llvm-readelf. This currently appears to work
probably because the LLVM binary directory is included in $PATH. However,
this is quite fragile so let's just make lit expand the full path.

Reviewers: ruiu, espindola

Reviewed By: ruiu

Subscribers: llvm-commits

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

llvm-svn: 326257
2018-02-27 22:01:02 +00:00
Krzysztof Parzyszek 82da5d7f55 [Pipeliner] Drop memrefs instead of creating ones with size UINT64_MAX
Absence of memory operands is treated as "aliasing everything", so
dropping them is sufficient.

llvm-svn: 326256
2018-02-27 22:00:32 +00:00
Shoaib Meenai 03303a3bb6 [AsmPrinter] Handle qualified unnamed types in CodeView printer
When attempting to compile the following Objective-C++ code with
CodeView debug info:

  void (^b)(void) = []() {};

The generated debug metadata contains a structure like the following:

  !43 = !DICompositeType(tag: DW_TAG_structure_type, name: "__block_literal_1", scope: !6, file: !6, line: 1, size: 168, elements: !44)
  !44 = !{!45, !46, !47, !48, !49, !52}
  ...
  !52 = !DIDerivedType(tag: DW_TAG_member, scope: !6, file: !6, line: 1, baseType: !53, size: 8, offset: 160, flags: DIFlagPublic)
  !53 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !54)
  !54 = !DICompositeType(tag: DW_TAG_class_type, file: !6, line: 1, flags: DIFlagFwdDecl)

Note that the member node (!52) is unnamed, but rather than pointing to
a DICompositeType directly, it points to a DIDerivedType with tag
DW_TAG_const_type, which then points to the DICompositeType. However,
the CodeView assembly printer currently assumes that the base type for
an unnamed member will always be a DICompositeType, and attempts to
perform that cast, which triggers an assertion failure, since in this
case the base type is actually a DIDerivedType, not a DICompositeType
(and we would have to get the base type of the DIDerivedType to reach
the DICompositeType). I think the debug metadata being generated by the
frontend is correct (or at least plausible), and the CodeView printer
needs to handle this case.

This patch teaches the CodeView printer to unwrap any qualifier types.
The qualifiers are just dropped for now. Ideally, they would be applied
to the added indirect members instead, but this occurs infrequently
enough that adding the logic to handle the qualifiers correctly isn't
worth it for now. A FIXME is added to note this.

Additionally, Reid pointed out that the underlying assumption that an
unnamed member must be a composite type is itself incorrect and may not
hold for all frontends. Therefore, after all qualifiers have been
stripped, check if the resulting type is in fact a DICompositeType and
just return if it isn't, rather than assuming the type and crashing if
that assumption is violated.

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

llvm-svn: 326255
2018-02-27 21:48:41 +00:00
Konstantin Zhuravlyov d6b3453bdb AMDGPU: Define FP_FAST_FMA{F} macros for amdgcn
- Expand GK_*s (i.e. GFX6 -> GFX600, GFX601, etc.)
  - This allows us to choose features correctly in some cases (for example, fast fmaf is available on gfx600, but not gfx601)
- Move HasFMAF, HasFP64, HasLDEXPF to GPUInfo tables
- Add HasFastFMA, HasFastFMAF to GPUInfo tables
- Add missing tests

llvm-svn: 326254
2018-02-27 21:48:05 +00:00
Reid Kleckner 22d838cd31 [codeview] Remove unused variable
llvm-svn: 326253
2018-02-27 21:46:40 +00:00
Konstantin Zhuravlyov 40b09e86b9 AMDGPU: Add fast fmaf feature to gfx702
Differential Revision: https://reviews.llvm.org/D43790

llvm-svn: 326252
2018-02-27 21:46:15 +00:00
Alexey Bataev 95c23e72da [OPENMP] Emit warning for non-trivial types in map clauses.
If the mapped type is non-trivial, the warning message is emitted for
better user experience.

llvm-svn: 326251
2018-02-27 21:31:11 +00:00