Adrian Kuegel [Fri, 6 Mar 2020 12:04:37 +0000 (13:04 +0100)]
Extract common code to deal with multidimensional vectors.
Summary: Also replace dyn_cast_or_null with dyn_cast when possible.
Differential Revision: https://reviews.llvm.org/D75733
Sven van Haastregt [Fri, 6 Mar 2020 12:45:28 +0000 (12:45 +0000)]
[OpenCL] Align vload and vstore builtins
Various vload and vstore builtins were missing or misdefined in the
TableGen description. Align the OpenCL vload* and vstore* builtins of
the `-fdeclare-opencl-builtins` option to those of `opencl-c.h`.
Reviewed-by: Stuart Brady <stuart.brady@arm.com>
Sam McCall [Fri, 6 Mar 2020 12:34:14 +0000 (13:34 +0100)]
[clangd][VSCode] Force VSCode to use the ranking provided by clangd.
Summary:
Clangd's approach is to provide lots of completions, and let ranking sort them
out. This relies on various important signals (Quality.h), without which the
large completion lists are extremely spammy.
Even with a completion result exactly at the cursor, vscode looks backwards and
tries to match the presumed partial-identifier against filterText, and uses
the result to rank, with sortText only used as a tiebreak.
By prepending the partial-identifier to the filterText, we can force the match
to be perfect and so give sortText full control of the ranking.
Full sad story: https://github.com/microsoft/language-server-protocol/issues/898
It's possible to do this on the server side too of course, and switch it on
with an initialization option. But it's a little easier in the extension, it
will get the fix to users of old clangd versions, and other editors
Reviewers: hokein
Reviewed By: hokein
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75623
Daniil Suchkov [Thu, 5 Mar 2020 14:14:26 +0000 (21:14 +0700)]
[BFI] Use CallbackVH to notify BFI about deletion of basic blocks
With AssertingVHs instead of bare pointers in
BlockFrequencyInfoImpl::Nodes (but without CallbackVHs) ~1/36 of all
tests ran by make check fail. It means that there are users of BFI that
delete basic blocks while keeping BFI. Some of those transformations add
new basic blocks, so if a new basic block happens to be allocated at
address where an already deleted block was and we don't explicitly set
block frequency for that new block, BFI will report some non-default
frequency for the block even though frequency for the block was never
set. Inliner is an example of a transformation that adds and removes BBs
while querying and updating BFI.
With this patch, thanks to updates via CallbackVH, BFI won't keep stale
pointers in its Nodes map.
This is a resubmission of
408349a25d0f5a012003f84c95b49bcc7782fa70 with
fixed compiler warning and MSVC compilation error.
Reviewers: davidxl, yamauchi, asbirlea, fhahn, fedor.sergeev
Reviewed-By: asbirlea, davidxl
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75341
Simon Pilgrim [Fri, 6 Mar 2020 11:36:00 +0000 (11:36 +0000)]
[DAG] Combine fshl/fshr(load1,load0,c) if we have consecutive loads
As noted on D75114, if both arguments of a funnel shift are consecutive loads we are missing the opportunity to combine them into a single load.
Differential Revision: https://reviews.llvm.org/D75624
Georgii Rymar [Wed, 4 Mar 2020 13:55:15 +0000 (16:55 +0300)]
[lib/ObjectYAML] - Make `ELFYAML::Relocation::Offset` optional.
Currently `yaml2obj` require `Offset` field in a relocation description.
There are many cases when `Offset` is insignificant in a context of a test case.
Making `Offset` optional allows to simplify our test cases.
This is what this patch does.
Also, with this patch `obj2yaml` does not dump a zero offset of a relocation.
Differential revision: https://reviews.llvm.org/D75608
Georgii Rymar [Thu, 5 Mar 2020 13:00:16 +0000 (16:00 +0300)]
[yaml2obj][obj2yaml][Object][test] - Improve testing of relocation types.
The intention was to remove the `Object/X86/yaml-elf-x86-rel-broken.yaml test`,
This test is at the wrong place.
`yaml-elf-x86-rel-broken.yaml` was introduced in
rG892c6c86ea25dc97668ff1f1b7bf1108e85fa5ec to check that
yaml2obj can use an arbitrary `Hex32` value as a relocation type.
We have tests that check the similar functionality.
I've improved them and removed the `yaml-elf-x86-rel-broken.yaml`
Differential revision: https://reviews.llvm.org/D75679
Pavel Labath [Thu, 5 Mar 2020 12:48:56 +0000 (13:48 +0100)]
[lldb/Disassembler] Move address resolution into the ParseInstructions function
The static Disassembler can be thought of as shorthands for three
operations:
- fetch an appropriate disassembler instance (FindPluginForTarget)
- ask it to dissassemble some bytes (ParseInstructions)
- ask it to dump the disassembled instructions (PrintInstructions)
The only thing that's standing in the way of this interpretation is that
the Disassemble function also does some address resolution before
calling ParseInstructions. This patch moves this functionality into
ParseInstructions so that it is available to users who call
ParseInstructions directly.
Stephan Herhut [Fri, 6 Mar 2020 10:09:45 +0000 (11:09 +0100)]
Revert "PR45083: Mark statement expressions as being dependent if they contain"
This reverts commit
a95cc77be154433c37a3110ac9af394b7447fcba.
Causes an internal build failure. I followed up with the author by mail.
Pavel Labath [Fri, 6 Mar 2020 09:47:33 +0000 (10:47 +0100)]
[lldb/test] Use inline assembly for instruction counting tests
We have a test which checks that instruction-step really steps one
instruction, but the way it checks this makes it very susceptible to
codegen changes. This rewrites the test inferior to use inline assembly,
which guarantees a known sequence of instructions that the test can
check. This does mean we have to write separate assembly for each
architecture, but that is no better than having architecture-specific
assertions, which the test was already starting to accumulate.
Muhammad Omair Javaid [Fri, 6 Mar 2020 08:41:53 +0000 (13:41 +0500)]
LLDB AArch64 skip single_step_only_steps_one_instruction* tests
This patch makes sure that LLDB AArch64/Linux testsuite skips
single_step_only_steps_one_instruction* tests. There is no possible
gaurantee for this test to pass and there already exists a bug report
against this bug.
Balázs Kéri [Fri, 6 Mar 2020 08:10:37 +0000 (09:10 +0100)]
[Analyzer][StreamChecker] Adding PreCall and refactoring (NFC).
Summary:
Adding PreCall callback.
Argument validity checks are moved into the PreCall callback.
Code is restructured, functions renamed.
There are "pre" and "eval" functions for the file operations.
And additional state check (validate) functions.
Reviewers: Szelethus
Reviewed By: Szelethus
Subscribers: xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, gamesh411, Charusso, martong, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75612
Jay Foad [Thu, 27 Feb 2020 09:50:29 +0000 (09:50 +0000)]
[APFloat] Overload unary operator-
Summary:
We already have overloaded binary arithemetic operators so you can write
A+B etc. This patch lets you write -A instead of neg(A).
Subscribers: hiraditya, dexonsmith, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75236
Sam Parker [Thu, 5 Mar 2020 11:30:37 +0000 (11:30 +0000)]
[ARM][MVE] Enable VMOVN for tail predication
These instructions also don't exchange lanes, so make them legal.
Differential Revision: https://reviews.llvm.org/D75669
Dominik Montada [Mon, 2 Mar 2020 15:28:17 +0000 (16:28 +0100)]
[GlobalISel] add missing libcalls and 128-bit support for floating points
Add libcall support for G_FMINNUM, G_FMAXNUM, G_FSQRT, G_FRINT, G_FNEARBYINT.
Add 128-bit libcall support for all simple libcalls.
Reviewers: arsenm, Petar.Avramovic, dsanders, petarj, paquette
Subscribers: wdng, rovka, hiraditya, volkan, llvm-commits
Differential Revision: https://reviews.llvm.org/D75516
John McCall [Fri, 6 Mar 2020 07:49:06 +0000 (02:49 -0500)]
Rewrite the non-trivial structs section of the ARC spec.
As part of this, set down the general rules for non-trivial types
in C in their full and gory detail, and then separately describe how
they apply to the ARC qualified types.
I'm not totally satisfied with the drafting of the dynamic-objects UB
rules here, but I feel like I'm building on a lot of wreckage.
Pavel Labath [Thu, 5 Mar 2020 14:14:45 +0000 (15:14 +0100)]
[lldb] Delete UnwindMacOSXFrameBackchain
Summary:
It isn't used anywhere (except on imaginary triples like
sparc-apple-ios) and it also violates plugin separation.
This patch deletes it and declares UnwindLLDB to be _the_ lldb unwinder.
Reviewers: jasonmolenda, JDevlieghere, xiaobai
Subscribers: jyknight, mgorny, krytarowski, fedor.sergeev, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D75680
Jonas Devlieghere [Fri, 6 Mar 2020 05:44:33 +0000 (21:44 -0800)]
[clang-tools-extra/clang-tidy] Mark modernize-make-shared as offering fixes
The list incorrectly states that modernize-make-shared does not offer
fixes, which is incorrect. Just like modernize-make-unique it does.
Tom Stellard [Fri, 6 Mar 2020 03:57:24 +0000 (19:57 -0800)]
[clang][cmake] Include generated rst files in html built by docs-clang-html target
Summary:
This is an attempt to simply the process of building the clang
documentation, which should help avoid some of the recent issues we've
had generating the documentation for the website.
The html documentation for clang is generated by sphinx from the
reStructuredText (rst) files we have in the clang/docs directory.
There are also some rst files that need to be generated by TableGen,
before they can be passed to sphinx. Prior to this patch we were not
generating those rst files as part with the build system and they had to be
generated manually.
This patch enables the automatic generation of these rst files, but
since they are generated at build time the cannot be placed in the
clang/docs directory and must go into the cmake build directory.
Unfortunately sphinx does not currently support multiple source
directories[1], so in order to be able to generate the full
documentation, we need to work around this by copying the
rst files from the clang/docs into the build directory before
generating the html documentation.
[1] https://github.com/sphinx-doc/sphinx/issues/3132
Reviewers: rsmith, aaron.ballman, beanz, smeenai, phosek, compnerd, mgorny, delcypher
Reviewed By: mgorny, delcypher
Subscribers: delcypher, merge_guards_bot, mgorny, llvm-commits, cfe-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D72875
Jonas Devlieghere [Fri, 6 Mar 2020 05:28:19 +0000 (21:28 -0800)]
[lldb/DWARF] Fix 80 col formatting (NFC)
Forgot to run git clang-format before landing my previous commit
(
226d52b1faadbe4a770d5738ac9d2c5bbc110d3d).
Jonas Devlieghere [Fri, 6 Mar 2020 05:23:08 +0000 (21:23 -0800)]
[lldb/DWARF] Replace C style casts with static_cast<> (NFC)
Using static_cast instead of C style casts better conveys the code's
intent, is a tad more safe and stands out more.
Siva Chandra Reddy [Fri, 6 Mar 2020 04:46:13 +0000 (20:46 -0800)]
[libc]Revert "Add linux implementations of thrd_create and thrd_join functions."
This reverts commit
abc040e9533011a62a25c93b07b4fc31c8a641f7 as the bots
are failing because of this.
Yuanfang Chen [Fri, 6 Mar 2020 02:14:01 +0000 (18:14 -0800)]
Add some more vscode files
On top of existing TableGen file syntax highlighting, added
- IR syntax highlighting
- LIT test output patterMatcher
- etc.
Richard Smith [Thu, 5 Mar 2020 20:20:02 +0000 (12:20 -0800)]
PR45083: Mark statement expressions as being dependent if they contain
dependent constructs.
We previously assumed they were neither value- nor
instantiation-dependent under any circumstances, which would lead to
crashes and other misbehavior.
This doesn't match GCC's behavior (where statement expressions appear to
be treated as value-dependent if they appear in a dependent context),
but seems to be the best thing we can do in the short term: it turns out
to be remarkably difficult for us to correctly determine whether we are
in a dependent context (and it's not even possible in some cases, such
as in a generic lambda where we might not have seen the 'auto' yet).
Jim Lin [Fri, 6 Mar 2020 02:40:27 +0000 (10:40 +0800)]
[AVR][NFC] Remove trailing space
Fangrui Song [Sun, 16 Feb 2020 01:23:18 +0000 (17:23 -0800)]
ThinLTOBitcodeWriter: drop dso_local when a GlobalVariable is converted to a declaration
If we infer the dso_local flag for -fpic, dso_local should be dropped
when we convert a GlobalVariable a declaration. dso_local causes the
generation of direct access (e.g. R_X86_64_PC32). Such relocations referencing
STB_GLOBAL STV_DEFAULT objects are not allowed in a -shared link.
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D74749
Fangrui Song [Thu, 5 Mar 2020 22:18:38 +0000 (14:18 -0800)]
[llvm-objdump] -d: print `
00000000 <foo>:` instead of `
00000000 foo:`
The new behavior matches GNU objdump. A pair of angle brackets makes tests slightly easier.
`.foo:` is not unique and thus cannot be used in a `CHECK-LABEL:` directive.
Without `-LABEL`, the CHECK line can match the `Disassembly of section`
line and causes the next `CHECK-NEXT:` to fail.
```
Disassembly of section .foo:
0000000000001634 .foo:
```
Bdragon: <> has metalinguistic connotation. it just "feels right"
Reviewed By: rupprecht
Differential Revision: https://reviews.llvm.org/D75713
Shu Anzai [Fri, 6 Mar 2020 00:14:05 +0000 (16:14 -0800)]
[lldb/Core] Minor code cleanup in Editline.cpp (NFC)
Simplify the code a bit.
Differential revision: https://reviews.llvm.org/D75294
Nathan James [Fri, 6 Mar 2020 00:07:08 +0000 (00:07 +0000)]
Fix 45129: Incorrect generated configuration modernize-make-shared.IncludeStyle
Alex Brachet [Thu, 5 Mar 2020 23:36:11 +0000 (18:36 -0500)]
[libc] [UnitTest] Add Matchers
Summary: This patch adds gtest-like matchers and `EXPECT|ASSERT_THAT` macros. It also adds matchers `Succeeds` and `Fails` and has examples using these in test/src/signal/sigaddset_test.cpp.
Reviewers: sivachandra, gchatelet, PaulkaToast
Reviewed By: sivachandra, PaulkaToast
Subscribers: mgorny, MaskRay, tschuett, libc-commits
Differential Revision: https://reviews.llvm.org/D75487
Arthur Eubanks [Thu, 5 Mar 2020 23:07:07 +0000 (15:07 -0800)]
Add warnings for casting ptr -> smaller int for C++ in Microsoft mode
Adds warnings to groups recently added in https://reviews.llvm.org/D72231.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D75708
Nicolas Vasilache [Thu, 5 Mar 2020 22:27:52 +0000 (17:27 -0500)]
[mlir] Introduce an intrinsic for llvm.matrix.multiply
This revision adds the first intrinsic for llvm.matrix.multiply.
This uses the more general `LLVM_OneResultOp` for now since the goal is
to use the
specific Matrix builders that @fhahn has created recently.
When piped through:
```
opt -O3 -enable-matrix | llc -O3 -march=x86-64 -mcpu=skylake-avx512
```
this has been verified to generate ymm instructions.
Additional function attribute support will be needed to generate proper
zmm instructions but at least things run end to end.
Benchmarking will be provided separately with the experimental
metaprogramming
[ModelBuilder](https://github.com/google/iree/tree/master/experimental/ModelBuilder)
tool when ready.
Raphael Isemann [Thu, 5 Mar 2020 22:13:05 +0000 (14:13 -0800)]
[lldb] Fix more typos in log statements in ClangASTSource
The indexes need to start at 0 but in D74951 I removed the first parameter
and didn't decrement all the indexes. This patch at least makes sure that
LLDB logging no longer crashes (but it still deadlocks).
Siva Chandra Reddy [Wed, 4 Dec 2019 17:06:56 +0000 (09:06 -0800)]
[libc] Add linux implementations of thrd_create and thrd_join functions.
Reviewers: abrachet, phosek
Differential Revision: https://reviews.llvm.org/D75380
Cyndy Ishida [Thu, 5 Mar 2020 18:04:32 +0000 (10:04 -0800)]
[TextAPI] Teach TextAPI about arm64e
Reviewers: ributzka, cishida
Subscribers: kristof.beyls, dexonsmith, dcoughlin, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75688
Zhongduo Lin [Thu, 5 Mar 2020 21:24:47 +0000 (16:24 -0500)]
[IndVarSimplify] Extend previous special case for load use instruction to any narrow type loop variant to avoid extra trunc instruction
Summary:
The widenIVUse avoids generating trunc by evaluating the use as AddRec, this
will not work when:
1) SCEV traces back to an instruction inside the loop that SCEV can not
expand, eg. add %indvar, (load %addr)
2) SCEV finds a loop variant, eg. add %indvar, %loopvariant
While SCEV fails to avoid trunc, we can still try to use instruction
combining approach to prove trunc is not required. This can be further
extended with other instruction combining checks, but for now we handle the
following case (sub can be "add" and "mul", "nsw + sext" can be "nus + zext")
```
Src:
%c = sub nsw %b, %indvar
%d = sext %c to i64
Dst:
%indvar.ext1 = sext %indvar to i64
%m = sext %b to i64
%d = sub nsw i64 %m, %indvar.ext1
```
Therefore, as long as the result of add/sub/mul is extended to wide type with
right extension and overflow wrap combination, no
trunc is required regardless of how %b is generated. This pattern is common
when calculating address in 64 bit architecture.
Note that this patch reuse almost all the code from D49151 by @az:
https://reviews.llvm.org/D49151
It extends it by providing proof of why trunc is unnecessary in more general case,
it should also resolve some of the concerns from the following discussion with @reames.
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-
20180910/585945.html
Reviewers: sanjoy, efriedma, sebpop, reames, az, javed.absar, amehsan
Reviewed By: az, amehsan
Subscribers: hiraditya, llvm-commits, amehsan, reames, az
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73059
aartbik [Thu, 5 Mar 2020 19:17:58 +0000 (11:17 -0800)]
[mlir] [VectorOps] Merge VectorReduction/VectorReductionV2 into one Op
Summary:
Paying off some technical debt in VectorOps, where I introduced a special
op for a fused accumulator into reduction to avoid some issues around
printing and parsing an optional accumulator. This CL merges the two
into one op again and does things the right way (still would be nice
to have "assemblyFormat" for optional operands though....).
Reviewers: nicolasvasilache, andydavis1, ftynse, rriddle
Reviewed By: nicolasvasilache
Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75699
River Riddle [Thu, 5 Mar 2020 20:48:28 +0000 (12:48 -0800)]
[mlir] Remove successor operands from the Operation class
Summary:
This revision removes all of the functionality related to successor operands on the core Operation class. This greatly simplifies a lot of handling of operands, as well as successors. For example, DialectConversion no longer needs a special "matchAndRewrite" for branching terminator operations.(Note, the existing method was also broken for operations with variadic successors!!)
This also enables terminator operations to define their own relationships with successor arguments, instead of the hardcoded "pass-through" behavior that exists today.
Differential Revision: https://reviews.llvm.org/D75318
River Riddle [Thu, 5 Mar 2020 20:41:56 +0000 (12:41 -0800)]
[mlir] Automatically populate `operand_segment_sizes` in the auto-generated build methods.
This greatly simplifies the requirements for builders using this mechanism for managing variadic operands.
Differential Revision: https://reviews.llvm.org/D75317
River Riddle [Thu, 5 Mar 2020 20:41:25 +0000 (12:41 -0800)]
[mlir] Refactor a few users to no longer rely on the successor operand API of Operation.
The existing API for successor operands on operations is in the process of being removed. This revision simplifies a later one that completely removes the existing API.
Differential Revision: https://reviews.llvm.org/D75316
River Riddle [Thu, 5 Mar 2020 20:40:53 +0000 (12:40 -0800)]
[mlir][DeclarativeParser] Add support for formatting operations with AttrSizedOperandSegments.
This attribute details the segment sizes for operand groups within the operation. This revision add support for automatically populating this attribute in the declarative parser.
Differential Revision: https://reviews.llvm.org/D75315
River Riddle [Thu, 5 Mar 2020 20:40:23 +0000 (12:40 -0800)]
[mlir] Add a new BranchOpInterface to allow for opaquely interfacing with branching terminator operations.
This interface contains the necessary components to provide the same builtin behavior that terminators have. This will be used in future revisions to remove many of the hardcoded constraints placed on successors and successor operands. The interface initially contains three methods:
```c++
// Return a set of values corresponding to the operands for successor 'index', or None if the operands do not correspond to materialized values.
Optional<OperandRange> getSuccessorOperands(unsigned index);
// Return true if this terminator can have it's successor operands erased.
bool canEraseSuccessorOperand();
// Erase the operand of a successor. This is only valid to call if 'canEraseSuccessorOperand' returns true.
void eraseSuccessorOperand(unsigned succIdx, unsigned opIdx);
```
Differential Revision: https://reviews.llvm.org/D75314
River Riddle [Thu, 5 Mar 2020 20:39:46 +0000 (12:39 -0800)]
[mlir] Add traits for verifying the number of successors and providing relevant accessors.
This allows for simplifying OpDefGen, as well providing specializing accessors for the different successor counts. This mirrors the existing traits for operands and results.
Differential Revision: https://reviews.llvm.org/D75313
Nathan Ridge [Thu, 27 Feb 2020 20:33:38 +0000 (15:33 -0500)]
[clangd] Remove vsc-extension-quickstart.md from the vscode-clangd plugin
Summary:
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75292
Jon Chesterfield [Thu, 5 Mar 2020 20:25:30 +0000 (20:25 +0000)]
[libomptarget] Implement locks for amdgcn
Summary:
[libomptarget] Implement locks for amdgcn
The nvptx implementation deadlocks on amdgcn. atomic_cas with multiple
active lanes can deadlock - if one lane succeeds, all the others are locked
out. The set_lock implementation therefore runs on a single lane.
Also uses a sleep intrinsic instead of the system clock for a probably
minor performance improvement. The unset/test implementations may be revised
later, based on code size / performance or similar concerns.
This implements the lock at a per-wavefront scope. That's not strictly as
specified, since openmp describes locks in terms of threads. I think the
nvptx implementation provides true per-thread locking on volta and the same
per-warp locking on other architectures.
Reviewers: jdoerfert, ABataev, grokos
Reviewed By: jdoerfert
Subscribers: jvesely, mgorny, jfb, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D75546
Yitzhak Mandelbaum [Tue, 3 Mar 2020 20:04:08 +0000 (15:04 -0500)]
[AST Matchers] Restrict `optionally` matcher to a single argument.
Summary:
Currently, `optionally` can take multiple arguments, which commits it to a
particular strategy for those arguments (in this case, "for each"). We limit the
matcher to a single argument, which avoids any potential confusion and
simplifies the implementation. The user can retrieve multiple-argument
optionality, by explicitly using the desired operator (like `forEach`, `anyOf`,
`allOf`, etc.) with all children wrapped in `optionally`.
Reviewers: sbenza, aaron.ballman
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75556
Alexey Bataev [Thu, 5 Mar 2020 18:45:28 +0000 (13:45 -0500)]
[OPENMP50]Add codegen for update clause in depobj directive.
Added codegen for update clause in depobj. Reads the number of the
elements from the first element and updates flags for each element in
the loop.
```
omp_depend_t x;
kmp_depend_info *base = (kmp_depend_info *)x;
intptr_t num = x[-1].base_addr;
kmp_depend_info *end = x + num;
kmp_depend_info *el = base;
do {
el.flags = new_flag;
el = &el[1];
} while (el != end);
```
Alexey Bataev [Thu, 5 Mar 2020 18:55:40 +0000 (13:55 -0500)]
[OPENMP50]Skip the first element when storing the list of dependencies
in depobj object.
The first element in the list of the dependencies is used for internal
purposes to store the number of the elements in the provided list.
The first element now is skipped and depobj object poits exactly to the
list of dependencies.
Alex Brachet [Thu, 5 Mar 2020 19:21:18 +0000 (14:21 -0500)]
[libc] Create abort and _Exit
This revision creates abort and _Exit implementations
Differential Revision: https://reviews.llvm.org/D74949
Jessica Paquette [Thu, 5 Mar 2020 18:57:52 +0000 (10:57 -0800)]
[AArch64][GlobalISel] Avoid copies to target register bank for subregister copies
Previously for any copy from a register bigger than the destination:
Copied to a same-sized register in the destination register bank.
Subregister copy of that to the destination.
This fails for copies from 128-bit FPRs to GPRs because the GPR register bank
can't accomodate 128-bit values.
Instead of special-casing such copies to perform the truncation beforehand in
the source register bank, generalize this:
a) Perform a subregister copy straight from source register whenever possible.
This results in shorter MIR and fixes the above problem.
b) Perform a full copy to target bank and then do a subregister copy only if
source bank can't support target's size. E.g. GPR to 8-bit FPR copy.
Patch by Raul Tambre (tambre)!
Differential Revision: https://reviews.llvm.org/D75421
Fangrui Song [Tue, 3 Mar 2020 00:52:17 +0000 (16:52 -0800)]
[PowerPC] Delete PPCMachObjectWriter and powerpc{,64}-apple-darwin
Reviewed By: #powerpc, sfertile
Differential Revision: https://reviews.llvm.org/D75494
MaheshRavishankar [Thu, 5 Mar 2020 19:01:24 +0000 (11:01 -0800)]
[mlir][GPU] Expose the functionality to create a GPUFuncOp from a LaunchOp
The current setup of the GPU dialect is to model both the host and
device side codegen. For cases (like IREE) the host side modeling
might not directly fit its use case, but device-side codegen is still
valuable. First step in accessing just the device-side functionality
of the GPU dialect is to allow just creating a gpu.func operation from
a gpu.launch operation. In addition this change also "inlines"
operations into the gpu.func op at time of creation instead of this
being a later step.
Differential Revision: https://reviews.llvm.org/D75287
Fangrui Song [Fri, 21 Feb 2020 19:32:33 +0000 (11:32 -0800)]
[ARM] Rewrite ARMAttributeParser
* Delete boilerplate
* Change functions to return `Error`
* Test parsing errors
* Update callers of ARMAttributeParser::parse() to check the `Error` return value.
Since this patch touches nearly everything in the file, I apply
http://llvm.org/docs/Proposals/VariableNames.html and change variable
names to lower case.
Reviewed By: compnerd
Differential Revision: https://reviews.llvm.org/D75015
Aaron Puchert [Thu, 5 Mar 2020 18:24:28 +0000 (19:24 +0100)]
Comment parsing: Treat \ref as inline command
Summary:
It's basically Doxygen's version of a link and can happen anywhere
inside of a paragraph. Fixes a bogus warning about empty paragraphs when
a parameter description starts with a link.
Reviewers: gribozavr2
Reviewed By: gribozavr2
Differential Revision: https://reviews.llvm.org/D75632
Mitch Phillips [Thu, 5 Mar 2020 18:27:08 +0000 (10:27 -0800)]
[GWP-ASan] Fix thread ID.
Summary:
GWP-ASan currently reports <unknown> thread ID, as the crash handler
merge dropped the include. Oops.
Reviewers: morehouse
Reviewed By: morehouse
Subscribers: eugenis, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D75693
Fangrui Song [Thu, 5 Mar 2020 01:19:18 +0000 (17:19 -0800)]
[llvm-objdump] --syms: make flags closer to GNU objdump
This fixes several issues. The behavior changes are:
A SHN_COMMON symbol does not have the 'g' flag.
An undefined symbol does not have 'g' or 'l' flag.
A STB_GLOBAL SymbolRef::ST_Unknown symbol has the 'g' flag.
A STB_LOCAL SymbolRef::ST_Unknown symbol has the 'l' flag.
Reviewed By: rupprecht
Differential Revision: https://reviews.llvm.org/D75659
Adrian Prantl [Wed, 4 Mar 2020 16:34:20 +0000 (08:34 -0800)]
Revert "[CGBlocks] Improve line info in backtraces containing *_helper_block"
Block copy/destroy helpers are now linkonce_odr functions, meant to be uniqued, and thus attaching debug information from one translation unit (or even just from one instance of many inside one translation unit) would be misleading and wrong in the general case.
This effectively reverts commit
9c6b6826ce3720ca8bb9bd15f3abf71261e6b911.
<rdar://problem/
59137040>
Differential Revision: https://reviews.llvm.org/D75615
Hiroshi Yamauchi [Tue, 3 Mar 2020 17:53:07 +0000 (09:53 -0800)]
[PGO][PGSO] Use IsColdXNthPercentile for sample PGO.
Summary:
This performs better for sample PGO.
NFC as PGSOColdCodeOnlyForSamplePGO is still true.
Reviewers: davidxl
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75550
Jordan Rupprecht [Wed, 4 Mar 2020 22:20:48 +0000 (14:20 -0800)]
[llvm-readobj] Include section name of notes.
This changes the output of `llvm-readelf -n` from:
```
Displaying notes found at file offset 0x<...> with length 0x<...>:
```
to:
```
Displaying notes found in: .note.foo
```
And similarly, adds a `Name:` field to the `llvm-readobj -n` output for notes.
This change not only increases GNU compatibility, it also makes it much easier to read notes. Note that we still fall back to printing the file offset/length in cases where we don't have a section name, such as when printing notes in program headers or printing notes in a partially stripped file (GNU readelf does the same).
Fixes llvm.org/PR41339.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D75647
Philip Reames [Thu, 5 Mar 2020 17:43:20 +0000 (09:43 -0800)]
[X86/MC] Factor out common code [NFC]
Pablo Barrio [Thu, 5 Mar 2020 16:27:25 +0000 (16:27 +0000)]
Fix MemTagSanitizer docs to point at Armv8.5-A MTE
The Memory Tagging Extension was introduced in Armv8.5-A.
Benjamin Kramer [Thu, 5 Mar 2020 17:20:14 +0000 (18:20 +0100)]
Fix pessimizing move. NFC.
Rodrigo Dominguez [Thu, 27 Feb 2020 20:02:34 +0000 (15:02 -0500)]
AMDGPU: Add/Fix tests for image atomic intrinsic.
Summary:
Add tests for 64-bit image atomic swap and cmpswap.
Fix tests for 32-bit image atomic add.
Change-Id: Ibb7619749c1ad504b24aa1c5f3185417a3013f3c
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, jfb, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75295
David Stuttard [Thu, 5 Mar 2020 14:09:27 +0000 (14:09 +0000)]
AMDGPU: Fix SMRD test in trivially disjoint mem access code
Summary:
This seems like an obvious error - cut and paste issue?
The change does make a change to one of the lit tests - it stops s_buffer_load
re-ordering past an MUBUF instruction (which is not surprising).
Change-Id: I80be99de5b62af4f42e91af2591b76a52ac9efa6
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, tpr, t-tye, hiraditya, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75686
Jon Chesterfield [Thu, 5 Mar 2020 17:05:56 +0000 (17:05 +0000)]
[libomptarget][nfc] Move GetWarp/LaneId functions into per arch code
Summary:
[libomptarget][nfc] Move GetWarp/LaneId functions into per arch code
No code change for nvptx. Amdgcn currently has two implementations of GetLaneId,
this patch keeps the one a colleague considered to be superior for our ISA.
GetWarpId is currently the same function for amdgcn and nvptx, but I think it's
cleaner to keep it grouped with all the others than to keep it in support.cu.
Reviewers: jdoerfert, grokos, ABataev
Reviewed By: jdoerfert
Subscribers: jvesely, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D75587
Sterling Augustine [Wed, 4 Mar 2020 20:41:54 +0000 (12:41 -0800)]
Promote nameless lambda used by dl_iterate_phdr to named function.
Summary:
This cleans up control flow inside findUnwindSections, and will make
it easier to replace this code in a following patch. Also, expose the
data structure to allow use by a future replacment function.
Reviewers: mstorsjo, miyuki
Subscribers: krytarowski, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D75637
Chris Bowler [Thu, 5 Mar 2020 16:34:11 +0000 (11:34 -0500)]
[AIX] Extend int arguments to register width when passed in stack memory.
This is a follow up to the previous patch: [AIX] Implement caller
arguments passed in stack memory.
This corrects a defect in AIX 64-bit where an i32 is written to the
stack with stw (4 bytes) rather than the expected std (8 bytes.) Integer
arguments pass on the stack as images of their register representation.
I also took the opportunity to tidy up some of the calling convention
AIX tests I added in my last commit. This patch adds the missed assembly
expected output for the stack arg int case, which would have caught this
problem.
Differential Revision: https://reviews.llvm.org/D75126
Luís Marques [Thu, 5 Mar 2020 16:43:03 +0000 (16:43 +0000)]
[compiler-rt][builtins][RISCV] Port __clear_cache to RISC-V Linux
Implements `__clear_cache` for RISC-V Linux. We can't just use `fence.i` on
Linux, because the Linux thread might be scheduled on another hart, and the
`fence.i` instruction only flushes the icache of the current hart.
Chris Lattner [Thu, 5 Mar 2020 06:06:54 +0000 (22:06 -0800)]
Fix a warning about an unreachable default in a switch statement.
Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75663
Juneyoung Lee [Thu, 5 Mar 2020 15:56:07 +0000 (00:56 +0900)]
[ValueTracking] Let isGuaranteedNotToBeUndefOrPoison look into branch conditions of dominating blocks' terminators
Summary:
```
br i1 c, BB1, BB2:
BB1:
use1(c)
BB2:
use2(c)
```
In BB1 and BB2, c is never undef or poison because otherwise the branch would have triggered UB.
This is a resubmission of 952ad47 with crash fix of llvm/test/Transforms/LoopRotate/freeze-crash.ll.
Checked with Alive2
Reviewers: xbolva00, spatel, lebedev.ri, reames, jdoerfert, nlopes, sanjoy
Reviewed By: reames
Subscribers: jdoerfert, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75401
Sanjay Patel [Thu, 5 Mar 2020 13:06:05 +0000 (08:06 -0500)]
[VectorCombine] add tests for different extract indexes; NFC
Simon Pilgrim [Thu, 5 Mar 2020 15:28:43 +0000 (15:28 +0000)]
Replace getAs with castAs to fix null dereference static analyzer warning.
Use castAs as we know the cast should succeed and we're dereferencing in the mangleBareFunctionType call.
Florian Hahn [Thu, 5 Mar 2020 14:55:08 +0000 (14:55 +0000)]
[VPlan] Use consecutive numbers to print VPValues instead of addresses.
Currently when printing VPValues we use the object address, which makes
it hard to distinguish VPValues as they usually are large numbers with
varying distance between them.
This patch adds a simple slot tracker, similar to the ModuleSlotTracker
used for IR values. In order to dump a VPValue or anything containing a
VPValue, a slot tracker for the enclosing VPlan needs to be created. The
existing VPlanPrinter can take care of that for the existing code. We
assign consecutive numbers to each VPValue we encounter in a reverse
post order traversal of the VPlan.
Reviewers: rengolin, hsaito, fhahn, Ayal, dorit, gilr
Reviewed By: gilr
Differential Revision: https://reviews.llvm.org/D73078
Daniel Kiss [Thu, 5 Mar 2020 14:01:54 +0000 (15:01 +0100)]
[AArch64] Harmonize print format of hint instructions.
Summary:
Hint instructions printed as "hint\t#hintnum" except
in case of ARM v8.3a instruction only "hint #hintnum" is printed.
This patch changes all format to the fist one.
Reviewers: pbarrio, LukeCheeseman, vsk
Reviewed By: vsk
Subscribers: kristof.beyls, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75625
Simon Pilgrim [Thu, 5 Mar 2020 14:22:11 +0000 (14:22 +0000)]
Fix use-after-move warning. NFCI.
Simon Pilgrim [Thu, 5 Mar 2020 13:58:49 +0000 (13:58 +0000)]
Fix "Value stored to 'RegForm' is never read" static analyzer warnings. NFC.
Simon Pilgrim [Thu, 5 Mar 2020 12:42:50 +0000 (12:42 +0000)]
Fix static analyzer uninitialized variable warning. NFCI.
Pavel Labath [Thu, 5 Mar 2020 12:03:26 +0000 (13:03 +0100)]
[lldb] s/ExecutionContext/Target in Disassembler
Some functions in this file only use the "target" component of an
execution context. Adjust the argument lists to reflect that.
This avoids some defensive null checks and simplifies most of the
callers.
Krasimir Georgiev [Thu, 5 Mar 2020 13:40:16 +0000 (14:40 +0100)]
Revert "[BFI] Use CallbackVH to notify BFI about deletion of basic blocks"
This reverts commit
8975aa6ea8172963d6532caa8ed2a6f6e0074a02.
Causes a compilation warning:
llvm-project/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h:1037:43: warning: 'llvm::BlockFrequencyInfoImpl<llvm::BasicBlock>::BFICallbackVH' has virtual functions but non-virtual destructor [-Wnon-virtual-dtor]
class BlockFrequencyInfoImpl<BasicBlock>::BFICallbackVH : public CallbackVH {
^
1 warning generated.
Krasimir Georgiev [Thu, 5 Mar 2020 13:16:52 +0000 (14:16 +0100)]
[clang-format] do not insert spaces around inline asm symbolic names
Summary:
Fixes https://bugs.llvm.org/show_bug.cgi?id=45108.
The `[` in such cases was mis-annotated as an `TT_ArrayInitializerLSquare`.
Reviewers: hans
Reviewed By: hans
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75675
Benjamin Kramer [Thu, 5 Mar 2020 12:52:05 +0000 (13:52 +0100)]
Revert "Fix regression in bdad0a1: force rebuilding of StmtExpr nodes in", "PR45083: Mark statement expressions as being dependent if they appear in"
This reverts commit
f545ede91c9d9f271e7504282cab7bf509607ead.
This reverts commit
bdad0a1b79273733df9acc1be4e992fa5d70ec56.
This crashes clang. I'll follow up with reproduction instructions.
Igor Kudrin [Thu, 5 Mar 2020 12:30:25 +0000 (19:30 +0700)]
Fix typos in comment marks.
Sanjay Patel [Wed, 4 Mar 2020 22:23:55 +0000 (17:23 -0500)]
[VectorCombine] add x86 AVX run to test for better coverage; NFC
Alexey Lapshin [Wed, 4 Mar 2020 19:56:52 +0000 (22:56 +0300)]
[LLD][NFC] Remove getOffsetInFile() workaround.
Summary:
LLD has workaround for the times when SectionIndex was not passed properly:
LT->getFileLineInfoForAddress(
S->getOffsetInFile() + Offset, nullptr,
DILineInfoSpecifier::FileLineInfoKind::AbsoluteFilePath, Info));
S->getOffsetInFile() was added to differentiate offsets between
various sections. Now SectionIndex is properly specified.
Thus it is not necessary to use getOffsetInFile() workaround.
See https://reviews.llvm.org/D58194, https://reviews.llvm.org/D58357.
This patch removes getOffsetInFile() workaround.
Reviewers: ruiu, grimar, MaskRay, espindola
Reviewed By: grimar, MaskRay
Subscribers: emaste, arichardson, llvm-commits
Tags: #llvm, #lld
Differential Revision: https://reviews.llvm.org/D75636
Kiran Chandramohan [Wed, 4 Mar 2020 23:36:21 +0000 (23:36 +0000)]
[MLIR, OpenMP] Translation of OpenMP barrier construct to LLVM IR
Summary:
This patch adds support for translation of the OpenMP barrier construct to LLVM
IR. The OpenMP IRBuilder is used for this translation. In this patch the code
for translation is added to the existing LLVM dialect translation to LLVM IR.
The patch includes code changes and a testcase.
Reviewers: jdoerfert, nicolasvasilache, ftynse, rriddle, mehdi_amini
Reviewed By: ftynse, rriddle, mehdi_amini
Differential Revision: https://reviews.llvm.org/D72962
Daniil Suchkov [Thu, 5 Mar 2020 11:32:50 +0000 (18:32 +0700)]
[BFI] Use CallbackVH to notify BFI about deletion of basic blocks
With AssertingVHs instead of bare pointers in
BlockFrequencyInfoImpl::Nodes (but without CallbackVHs) ~1/36 of all
tests ran by make check fail. It means that there are users of BFI that
delete basic blocks while keeping BFI. Some of those transformations add
new basic blocks, so if a new basic block happens to be allocated at
address where an already deleted block was and we don't explicitly set
block frequency for that new block, BFI will report some non-default
frequency for the block even though frequency for the block was never
set. Inliner is an example of a transformation that adds and removes BBs
while querying and updating BFI.
With this patch, thanks to updates via CallbackVH, BFI won't keep stale
pointers in its Nodes map.
This is a resubmission of
408349a25d0f5a012003f84c95b49bcc7782fa70 with
fixed MSVC compilation errors.
Reviewers: davidxl, yamauchi, asbirlea, fhahn, fedor.sergeev
Reviewed-By: asbirlea, davidxl
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75341
Jon Chesterfield [Thu, 5 Mar 2020 11:50:30 +0000 (11:50 +0000)]
[libomptarget][nfc][amdgcn] Replace magic number with named intrinsic
Utkarsh Saxena [Wed, 4 Mar 2020 12:25:02 +0000 (13:25 +0100)]
[clangd] Add instrumentation mode in clangd for metrics collection.
Summary:
This patch adds an instrumentation mode for clangd (enabled by
corresponding option in cc_opts).
If this mode is enabled then user can specify callbacks to run on the
final code completion result.
Moreover the CodeCompletion::Score will contain the detailed Quality and
Relevance signals used to compute the score when this mode is enabled.
These are required because we do not any place in which the final
candidates (scored and sorted) are available along with the above
signals. The signals are temporary structures in `addCandidate`.
The callback is needed as it gives access to many data structures that
are internal to CodeCompleteFlow and are available once Sema has run. Eg:
ScopeDistnace and FileDistance.
If this mode is disabled (as in default) then Score would just contain 2
shared pointers (null). Thus cost(memory/time) increase for the default
mode would be fairly cheap and insignificant.
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75603
Tatyana Krasnukha [Thu, 5 Mar 2020 11:37:39 +0000 (14:37 +0300)]
[lldb][test] Temporarily X-fail TestPtrRefs.py and TestPtrRefsObjC.py
Bugzilla issue: llvm.org/pr45112
Daniil Suchkov [Thu, 5 Mar 2020 11:27:42 +0000 (18:27 +0700)]
Revert "[BFI] Use CallbackVH to notify BFI about deletion of basic blocks"
Reverting the patch because it causes compilation failure on MSVC.
This reverts commit
408349a25d0f5a012003f84c95b49bcc7782fa70.
Daniil Suchkov [Tue, 25 Feb 2020 09:21:01 +0000 (16:21 +0700)]
[BFI] Use CallbackVH to notify BFI about deletion of basic blocks
With AssertingVHs instead of bare pointers in
BlockFrequencyInfoImpl::Nodes (but without CallbackVHs) ~1/36 of all
tests ran by make check fail. It means that there are users of BFI that
delete basic blocks while keeping BFI. Some of those transformations add
new basic blocks, so if a new basic block happens to be allocated at
address where an already deleted block was and we don't explicitly set
block frequency for that new block, BFI will report some non-default
frequency for the block even though frequency for the block was never
set. Inliner is an example of a transformation that adds and removes BBs
while querying and updating BFI.
With this patch, thanks to updates via CallbackVH, BFI won't keep stale
pointers in its Nodes map.
Reviewers: davidxl, yamauchi, asbirlea, fhahn, fedor.sergeev
Reviewed-By: asbirlea, davidxl
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D75341
Pavel Labath [Thu, 5 Mar 2020 10:47:39 +0000 (11:47 +0100)]
[lldb] Make Disassembler::PrintInstructions a method
the previously static member function took a Disassembler* argument
anyway. This renames the argument to "this". The function also always
succeeds (returns true), so I change the return type to void.
Sam Parker [Thu, 5 Mar 2020 09:54:11 +0000 (09:54 +0000)]
[ARM][MVE] Enable *SHRN* for tail predication
These instructions don't swap lanes so make them valid.
Differential Revision: https://reviews.llvm.org/D75667
LLVM GN Syncbot [Thu, 5 Mar 2020 10:56:10 +0000 (10:56 +0000)]
[gn build] Port
cada5b881b6
Jeremy Morse [Thu, 5 Mar 2020 10:45:52 +0000 (10:45 +0000)]
Revert "clang: Treat ieee mode as the default for denormal-fp-math"
This reverts commit
c64ca93053af235bac0ca4dcdcd21c8882478310.
This patch tripped a few build bots:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/24703/
http://lab.llvm.org:8011/builders/clang-cmake-x86_64-avx2-linux/builds/13465/
http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/15994/
Reverting to clear the bots.
Igor Kudrin [Tue, 28 Jan 2020 07:11:54 +0000 (14:11 +0700)]
[DebugInfo] Do not truncate 64-bit values when dumping CIEs and FDEs.
This fixes printing long values that might reside in CIE and FDE,
including offsets, lengths, and addresses.
Differential Revision: https://reviews.llvm.org/D73887
Igor Kudrin [Mon, 3 Feb 2020 11:00:56 +0000 (18:00 +0700)]
[DebugInfo] Refine the condition to detect CIEs.
The condition was not accurate enough and could interpret some FDEs in
.eh_frame or 64-bit DWARF .debug_frame sections as CIEs. Even though
such FDEs are unlikely in a normal situation, the wrong interpretation
could hide an issue in a buggy generator.
Differential Revision: https://reviews.llvm.org/D73886
Mikael Holmen [Thu, 5 Mar 2020 08:29:55 +0000 (09:29 +0100)]
[AST] Replace assert with llvm_unreachable to silence compiler warning
New code added in
ec3060c72de6 looked like
+ case TemplateName::NameKind::OverloadedTemplate:
+ assert(false && "overloaded templates shouldn't survive to here.");
+ default:
If compiling without asserts we then got a warning about unannotated
fallthrough from the case into the default.
Change the assert into an llvm_unreachable to silence the warning.
Pavel Labath [Wed, 4 Mar 2020 13:17:50 +0000 (14:17 +0100)]
[lldb] Delete two overloads of Disassembler::Disassemble
by "inlining" them into their single caller (CommandObjectDisassemble).
The functions mainly consist of long argument lists and defensive
checks. These become unnecessary after inlining, so the end result is
less code. Additionally, this makes the implementation of
CommandObjectDisassemble more uniform (first figure out what you're
going to disassemble, then actually do it), which enables further
cleanups.
Georgii Rymar [Thu, 5 Mar 2020 09:41:42 +0000 (12:41 +0300)]
[Object/ELF] - Fix a position calculation expression in ELFFile<ELFT>::getEntry().
It fixes now what
1c991f907a43d7a56e82dd67a76514843841ed9a tried to fix.
(A test case failture on 32-bit Arch Linux)
On 32-bit hosts it still fails (because it truncates the `Pos` value to 32 bits).
It seems happens because of `sizeof` that returns `size_t`, which has a
different size on 32/64 bits hosts.
I've tested on a 32-bit host and verified that relocation-errors.test test and
other LLVM tools tests pass now.