2720 Commits

Author SHA1 Message Date
Jordan Rupprecht
d3d623b47b [DebugInfo] Fix /usr/lib/debug llvm-symbolizer lookup with relative paths
Summary:
rL189250 added a realpath call, and rL352916 because realpath breaks assumptions with some build systems. However, the /usr/lib/debug case has been clarified, falling back to /usr/lib/debug is currently broken if the obj passed in is a relative path. Adding a call to use absolute paths when falling back to /usr/lib/debug fixes that while still not making any realpath assumptions.

This also adds a --fallback-debug-path command line flag for testing (since we probably can't write to /usr/lib/debug from buildbot environments), but was also verified manually:

```
$ rm -f path/to/dwarfdump-test.elf-x86-64
$ strace llvm-symbolizer --obj=relative/path/to/dwarfdump-test.elf-x86-64.debuglink 0x40113f |& grep dwarfdump
```

Lookups went to relative/path/to/dwarfdump-test.elf-x86-64, relative/path/to/.debug/dwarfdump-test.elf-x86-64, and then finally /usr/lib/debug/absolute/path/to/dwarfdump-test.elf-x86-64.

Reviewers: dblaikie, samsonov

Reviewed By: dblaikie

Subscribers: krytarowski, aprantl, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353730 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-11 18:05:48 +00:00
Petar Jovanovic
4245638a61 [mips][micromips] Fix how values in .gcc_except_table are calculated
When a landing pad is calculated in a program that is compiled for micromips
with -fPIC flag, it will point to an even address.
Such an error will cause a segmentation fault, as the instructions in
micromips are aligned on odd addresses. This patch sets the last bit of the
offset where a landing pad is, to 1, which will effectively be an odd
address and point to the instruction exactly.

r344591 fixed this issue for -static compilation.

Patch by Aleksandar Beserminji.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353480 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-07 22:57:33 +00:00
James Henderson
d4180786f3 [DebugInfo][llvm-symbolizer]Add some tests for edge cases when symbolizing
This patch adds half a dozen new tests that test various edge cases in
the behaviour of the symbolizer and DWARF data parsing. All of them test
the current behaviour.

Reviewed by: JDevlieghere, aprantl

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353286 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-06 10:13:14 +00:00
Alexey Bataev
61d7d108c8 [DEBUG_INFO][NVPTX] Generate DW_AT_address_class to get the values in debugger.
Summary:
According to
https://docs.nvidia.com/cuda/archive/10.0/ptx-writers-guide-to-interoperability/index.html#cuda-specific-dwarf,
the compiler should emit the DW_AT_address_class attribute for all
variable and parameter. It means, that DW_AT_address_class attribute
should be used in the non-standard way to support compatibility with the
cuda-gdb debugger.
Clang is able to generate the information about the variable address
class. This information is emitted as the expression sequence
`DW_OP_constu <DWARF Address Space> DW_OP_swap DW_OP_xderef`. The patch
tries to find all such expressions and transform them into
`DW_AT_address_class <DWARF Address Space>` if target is NVPTX and the debugger is gdb.
If the expression is not found, then default values are used. For the
local variables <DWARF Address Space> is set to ADDR_local_space(6), for
the globals <DWARF Address Space> is set to ADDR_global_space(5). The
values are taken from the table in the same section 5.2. CUDA-Specific
DWARF Definitions.

Reviewers: echristo, probinson

Subscribers: jholewinski, aprantl, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353203 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-05 19:33:47 +00:00
Wolfgang Pieb
2260299d7e [DEBUGINFO] Reposting r352642: Handle restore instructions in LiveDebugValues
The LiveDebugValues pass recognizes spills but not restores, which can
cause large gaps in location information for some variables, depending
on control flow. This patch make LiveDebugValues recognize restores and
generate appropriate DBG_VALUE instructions.

This patch was posted previously with r352642 and reverted in r352666 due
to buildbot errors. A missing return statement was the cause for the 
failures.

Reviewers: aprantl, NicolaPrica

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353089 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-04 20:42:45 +00:00
Jordan Rupprecht
bae032027b [DebugInfo] Fix mkdir use in test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352918 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-01 21:14:21 +00:00
Jordan Rupprecht
4bca96d66c [DebugInfo] Don't use realpath when looking up debug binary locations.
Summary:
Using realpath makes assumptions about build systems that do not always hold true. The debug binary referred to from the .gnu_debuglink should exist in the same directory (or in a .debug directory, etc.), but the files may only exist as symlinks to a differently named files elsewhere, and using realpath causes that lookup to fail.

This was added in r189250, and this is basically a revert + regression test case.

Reviewers: dblaikie, samsonov, jhenderson

Reviewed By: dblaikie

Subscribers: llvm-commits, hiraditya

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352916 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-01 21:04:16 +00:00
Wolfgang Pieb
a4f757e1c5 [DWARF v5] Fix DWARF emitter and consumer to produce/expect a uleb for a location description's length.
Reviewer: davide, JDevliegere

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352889 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-01 17:11:58 +00:00
James Henderson
e8ba93465f [llvm-symbolizer][test] Rename and tweak tests using llvm-symbolizer
Prior to this change, there are a few tests called llvm-symbolizer* in
the DebugInfo test area. These really were testing either the DebugInfo
or Symbolizer library, rather than the llvm-symbolizer tool itself, so
this patch renames them to be clearer that they aren't explicitly tests
for llvm-symbolizer (such tests belong in test/tools/llvm-symbolizer).

This patch also reinstates the copying of a DWO file, removed previously
in r352752. The test needs this so that it could possibly fail.

Finally, some of the tests have been simplified slightly by removing
unnecessary switches and/or unused check-prefixes.

Reviewed by: dblaikie

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352847 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-01 10:24:55 +00:00
James Henderson
9ad14952df [llvm-symbolizer][test] Extract tests from llvm-symbolizer.test and simplify (#3)
This is the fourth (and final for now) of a series of patches
simplifying llvm-symbolizer tests. See r352752, r352753 and 352754 for
the previous ones. This patch splits out several more distinct test
cases from llvm-symbolizer.test into separate tests, and simplifies them
in various ways including:

1) Building a test case for spaces in path from source, rather than
   using a pre-canned binary. This allows deleting of said binary and the
   source it was built from.
2) Switching to specifying addresses and objects directly on the
   command-line rather than via stdin.

This also adds an explict test for the ability to specify a file and
address as a line in stdin, since the majority of the tests have been
migrated away from this approach, leaving this largely untested.

Reviewed by: dblaikie

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352756 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-31 14:22:50 +00:00
James Henderson
13be7644cc [llvm-symbolizer][test] Extract tests from llvm-symbolizer.test and simplify (#2)
This is the third of a series of patches simplifying llvm-symbolizer
tests. See r352752 and r352753 for the previous two. This patch splits
out a number of distinct test cases from llvm-symbolizer.test into
separate tests, and simplifies them in various ways including:

1) using --obj/positional arguments for the input file and addresses
   instead of stdin,
2) using runtime-generated inputs rather than a pre-canned binary, and
3) testing more specifically (i.e. checking only what is interesting to
   the behaviour changed in the original commit for that test case).

This patch also removes the test case for using --obj. The
tools/llvm-symbolizer/basic.s test already tests this case. Finally,
this patch adds a simple test case to the demangle switch test case to
show that demangling happens by default.

See https://bugs.llvm.org/show_bug.cgi?id=40070#c1 for the motivation.

Reviewed by: dblaikie

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352754 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-31 14:17:33 +00:00
James Henderson
ae8741935e [llvm-symbolizer][test] Extract tests from llvm-symbolizer.test and simplify (#1)
This is the second of a series of patches simplifying llvm-symbolizer
tests. See r352752 for the first. This one splits out 5 distinct test
cases from llvm-symbolizer.test into separate tests, and simplifies them
slightly by using --obj/positional arguments for the input file and
addresses instead of stdin.

See https://bugs.llvm.org/show_bug.cgi?id=40070#c1 for the motivation.

Reviewed by: dblaikie

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352753 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-31 14:11:17 +00:00
James Henderson
f71abe7fa1 [llvm-symbolizer][test] Simplify test input reading
This change migrates most llvm-symbolizer tests away from reading input
via stdin and instead using --obj + positional arguments for the file
and addresses respectively, which makes the tests easier to read.

One exception is the test test/tools/llvm-symbolizer/pdb/pdb.test, which
was doing some manipulation on the input addresses. This patch
simplifies this somewhat, but it still reads from stdin.

More changes to follow to simplify/break-up other tests.

Reviewed by: dblaikie

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352752 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-31 14:04:47 +00:00
Wolfgang Pieb
03d9f9c87e Reverting r352642 - Handle restore instructions in LiveDebugValues - as it's causing
assertions on some buildbots.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352666 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-30 20:37:14 +00:00
Wolfgang Pieb
e53778de21 The test comitted with r348896 needed -march=x86=64 on the llc command line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352651 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-30 19:15:43 +00:00
Wolfgang Pieb
bc99383d67 [DEBUGINFO] Handle restore instructions in LiveDebugValues
The LiveDebugValues pass recognizes spills but not restores, which can 
cause large gaps in location information for some variables, depending
on control flow. This patch make LiveDebugValues recognize restores and
generate appropriate DBG_VALUE instructions. 

Reviewers: aprantl, NicolaPrica

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352642 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-30 18:34:07 +00:00
Jeremy Morse
934c07f251 Remove 'XFAIL: powerpc64' from a debuginfo test
This test started XPASSing with r352467, and the change in behaviour
performed by that patch does appear to fix the cause of the original XFAIL
(missing FrameIndex DBG_VALUE), which I've replicated locally with
-mtriple=powerpc64--.

I'll write this up in PR21881 which documents the XFAIL, and seek
confirmation I haven't overlooked something here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352471 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-29 10:23:43 +00:00
Jeremy Morse
af14e77aab [DebugInfo][DAG] Process FrameIndex dbg.values unconditionally
A FrameIndex should be valid throughout a block regardless of what instructions
get selected in that block -- therefore we shouldn't harness dbg.values that
refer to FrameIndexes to an SDNode. There are numerous codegen reasons why
an SDNode never appears or doesn't become a location that a DBG_VALUE can
refer to. None of them actually affect the variable location.

Therefore, before any other tests to encode dbg_values in a SelectionDAG,
identify FrameIndex operands and encode them unattached to any SDNode.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352467 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-29 09:40:05 +00:00
Jeremy Morse
4f20053b1c Fix an incorrectly configured test.
This should have had a target triple in it, my mistake.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352460 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-29 08:41:44 +00:00
Jeremy Morse
13d322459a [DebugInfo][DAG] Avoid re-ordering of DBG_VALUEs
This patch improves the placement of DBG_VALUEs when by SelectionDAG, which
as documented in PR40427 can go very wrong. At the core of this is
ProcessSourceNode, which assumes the last instruction in a BB is the start
of the last processed IR instruction, which isn't always true.

Instead, use a helper function to call InstrEmitter::EmitNode, that records
before-and-after iterators and determines the first of any new instruction
created during emission. This is passed to ProcessSourceNode, which can
then make more elightened decisions about ordering for DBG_VALUE placement.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352350 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-28 12:08:31 +00:00
Guozhi Wei
aeff6e76be [MBP] Don't move bottom block before header if it can't reduce taken branches
If bottom of block BB has only one successor OldTop, in most cases it is profitable to move it before OldTop, except the following case:

-->OldTop<-
|    .    |
|    .    |
|    .    |
---Pred   |
     |    |
    BB-----

Move BB before OldTop can't reduce the number of taken branches, this patch detects this case and prevent the moving.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352236 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-25 19:45:13 +00:00
Simon Atanasyan
cc563b6c99 Reapply: [mips] Handle MipsMCExpr sub-expression for the MEK_DTPREL tag
This reapplies commit r351987 with a failed test fix. Now the test
accepts both DW_OP_GNU_push_tls_address and DW_OP_form_tls_address
opcode.

Original commit message:
```
  This is a fix for a regression introduced by the rL348194 commit. In
  that change new type (MEK_DTPREL) of MipsMCExpr expression was added,
  but in some places of the code this type of expression considered as
  unexpected.

  This change fixes the bug. The MEK_DTPREL type of expression is used for
  marking TLS DIEExpr only and contains a regular sub-expression. Where we
  need to handle the expression, we retrieve the sub-expression and
  handle it in a common way.
```

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352034 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-24 09:13:14 +00:00
David Blaikie
76453833c9 DebugInfo: Use assembly label arithmetic for address pool size for easier reading/editing
Recommits 350048, 350050 That broke buildbots because of some typos in
the test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352019 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-24 03:27:57 +00:00
David Blaikie
94bf3149a2 llvm-symbolizer: Extract individual test cases now that it's easier to use directly (without a piped input file)
Pulling out the split-dwarf tests by way of example of how I think
llvm-symbolizer should be tested going forward. Open to
debate/discussion, though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352004 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-24 01:19:17 +00:00
Amara Emerson
3b0dcea5b3 Revert "[mips] Handle MipsMCExpr sub-expression for the MEK_DTPREL tag"
This reverts commit r351987 as it broke some bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351998 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-24 00:24:59 +00:00
Simon Atanasyan
0046ceba44 [mips] Handle MipsMCExpr sub-expression for the MEK_DTPREL tag
This is a fix for a regression introduced by the rL348194 commit. In
that change new type (MEK_DTPREL) of MipsMCExpr expression was added,
but in some places of the code this type of expression considered as
unexpected.

This change fixes the bug. The MEK_DTPREL type of expression is used for
marking TLS DIEExpr only and contains a regular sub-expression. Where we
need to handle the expression, we retrieve the sub-expression and
handle it in a common way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351987 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-23 22:02:53 +00:00
Alexey Bataev
48aefa8877 [DEBUGINFO, NVPTX] Enable support for the debug info on NVPTX target.
Enable full support for the debug info.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351974 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-23 18:59:54 +00:00
Alexey Bataev
7877655b57 Revert "[DEBUGINFO, NVPTX] Enable support for the debug info on NVPTX target."
This reverts commit r351972. Some pieces of the patch was not applied
correctly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351973 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-23 18:48:36 +00:00
Alexey Bataev
9481b3e014 [DEBUGINFO, NVPTX] Enable support for the debug info on NVPTX target.
Enable full support for the debug info. Recommit to fix the emission of
the not required closing brace.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351972 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-23 18:28:59 +00:00
James Henderson
0c8614fd4d [llvm-symbolizer] Improve compatibility of --functions with GNU addr2line
This fixes https://bugs.llvm.org/show_bug.cgi?id=40072.

GNU addr2line's --functions switch is off by default, has a short alias
of -f, and does not take an argument. This patch changes llvm-symbolizer
to allow the second and third point (changing the default behaviour may
have negative impacts on users). If the option is missing a value, it
now treats it as "linkage".

This change does cause one previously valid command-line to behave
differently. Before --functions <value> was accepted, but now only
--functions=<value> is allowed (as well as --functions). The old
behaviour will result in the value being treated as a positional
argument.

The previous testing for --functions=short has been pulled out into a
new test that also tests the other accepted values and option formats.

Reviewed by: ruiu

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351968 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-23 17:27:48 +00:00
Haojian Wu
ef7a8ec9b9 Revert "[DEBUGINFO, NVPTX] Enable support for the debug info on NVPTX target."
This reverts commit r351846.

This patch may generate illegal assembly code, see

```
$ ./bin/clang -cc1 -triple nvptx64-nvidia-cuda -aux-triple x86_64-grtev4-linux-gnu -S -disable-free -disable-llvm-verifier -discard-value-names -main-file-name new.cc -mrelocation-model pic -pic-level 2 -mthread-model posix -fmerge-all-constants -mdisable-fp-elim -relaxed-aliasing -no-integrated-as -mpie-copy-relocations -munwind-tables -fcuda-is-device -target-feature +ptx60 -target-cpu sm_35 -dwarf-column-info -debug-info-kind=line-directives-only -dwarf-version=2 -debugger-tuning=gdb -o empty.s -x cuda empty.cc
$  cat empty.s
//
// Generated by LLVM NVPTX Back-End
//

.version 6.0
.target sm_35
.address_size 64

	}
```

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351966 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-23 16:39:57 +00:00
Josh Stone
699f5cd333 [CodeView] Allow empty types in member functions
Summary:
`CodeViewDebug::lowerTypeMemberFunction` used to default to a `Void`
return type if the function's type array was empty. After D54667, it
started blindly indexing the 0th item for the return type, which fails
in `getOperand` for empty arrays if assertions are enabled.

This patch restores the `Void` return type for empty type arrays, and
adds a test generated by Rust in line-only debuginfo mode.

Reviewers: zturner, rnk

Reviewed By: rnk

Subscribers: hiraditya, JDevlieghere, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351910 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-23 00:53:22 +00:00
Alexey Bataev
d77902a49a [DEBUGINFO, NVPTX] Enable support for the debug info on NVPTX target.
Summary: Enable full support for the debug info.

Reviewers: echristo

Subscribers: jholewinski, aprantl, JDevlieghere, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351846 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-22 17:43:37 +00:00
Alexey Bataev
d3046a2618 [DEBUG_INFO, NVPTX] Fix relocation info.
Summary: Initial function labels must follow the debug location for the correct relocation info generation.

Reviewers: tra, jlebar, echristo

Subscribers: jholewinski, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351843 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-22 17:24:16 +00:00
Dmitry Venikov
e2ef489ac2 [llvm-symbolizer] Add -no-demangle as alias for -demangle=false
Summary: Provides -no-demangle as alias for -demangle=false. Motivation: https://bugs.llvm.org/show_bug.cgi?id=40075

Reviewers: jhenderson, ruiu

Reviewed By: jhenderson

Subscribers: erik.pilkington, rupprecht, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351735 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-21 10:00:57 +00:00
Jonas Devlieghere
f2cd8683e1 [Test] Fix debug-loc-0.mir with EXPENSIVE_CHECKS
The `llc` invocation was missing `-start-before=machine-cp`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351464 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-17 18:35:14 +00:00
Jonas Devlieghere
c657e7f5f2 [AsmPrinter] Collapse .loc 0 0 directives
Currently we do not always collapse subsequent .loc 0 0 directives. The
reason is that we were checking for a PrevInstLoc which is not set when
we emit a line-0 record. We should only check the LastAsmLine, which
seems to be created exactly for this purpose.

  // When we emit a line-0 record, we don't update PrevInstLoc; so look at
  // the last line number actually emitted, to see if it was line 0.
  unsigned LastAsmLine =
    Asm->OutStreamer->getContext().getCurrentDwarfLoc().getLine();

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351395 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-16 23:26:29 +00:00
Jeremy Morse
5af7a5a89b [DebugInfo] Allow creation of DBG_VALUEs in blocks where the operand is not used
dbg.value intrinsics can appear in blocks where their operand is not used,
meaning the operand never receives an SDNode, and thus no DBG_VALUE will
be created. Get around this by looking to see whether the operand has already
been allocated a virtual register. This allows dbg.values of Phi node and
Values that are used across basic blocks to successfully be translated into
DBG_VALUEs.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351358 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-16 17:25:27 +00:00
Dmitry Venikov
2eebdab8bd [llvm-symbolizer] Add -C as a short alias to -demangle
Summary: Provides -C as alias to -demangle. Motivation: https://bugs.llvm.org/show_bug.cgi?id=40069.

Reviewers: jhenderson, ruiu, rnk, fjricci

Reviewed By: jhenderson, ruiu

Subscribers: rupprecht, erik.pilkington, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351300 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-16 07:05:58 +00:00
Mandeep Singh Grang
bbf3052e90 [EH] Rename llvm.x86.seh.recoverfp intrinsic to llvm.eh.recoverfp
Summary:
Make recoverfp intrinsic target-independent so that it can be implemented for AArch64, etc.
Refer D53541 for the context. Clang counterpart D56748.

Reviewers: rnk, efriedma

Reviewed By: rnk, efriedma

Subscribers: javed.absar, kristof.beyls, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351281 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-16 00:37:13 +00:00
Yury Delendik
bb3d0e960a [WebAssembly] Fix updating/moving DBG_VALUEs in RegStackify
Summary:
As described in PR40209, there can be issues in DBG_VALUEs handling when multiple defs present in a BB. This patch
adds logic for detection of related to def DBG_VALUEs and localizes register update and movement to found DBG_VALUEs.

Reviewers: aheejin

Subscribers: mgorny, dschuff, sbc100, jgravelle-google, sunfish, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351216 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-15 18:14:12 +00:00
James Y Knight
46d00b498a Remove irrelevant references to legacy git repositories from
compiler identification lines in test-cases.

(Doing so only because it's then easier to search for references which
are actually important and need fixing.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351200 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-15 16:18:52 +00:00
Francis Visoiu Mistrih
08223c34d4 Replace "no-frame-pointer-*" function attributes with "frame-pointer"
Part of the effort to refactoring frame pointer code generation. We used
to use two function attributes "no-frame-pointer-elim" and
"no-frame-pointer-elim-non-leaf" to represent three kinds of frame
pointer usage: (all) frames use frame pointer, (non-leaf) frames use
frame pointer, (none) frame use frame pointer. This CL makes the idea
explicit by using only one enum function attribute "frame-pointer"

Option "-frame-pointer=" replaces "-disable-fp-elim" for tools such as
llc.

"no-frame-pointer-elim" and "no-frame-pointer-elim-non-leaf" are still
supported for easy migration to "frame-pointer".

tests are mostly updated with

// replace command line args ‘-disable-fp-elim=false’ with ‘-frame-pointer=none’
grep -iIrnl '\-disable-fp-elim=false' * | xargs sed -i '' -e "s/-disable-fp-elim=false/-frame-pointer=none/g"

// replace command line args ‘-disable-fp-elim’ with ‘-frame-pointer=all’
grep -iIrnl '\-disable-fp-elim' * | xargs sed -i '' -e "s/-disable-fp-elim/-frame-pointer=all/g"

Patch by Yuanfang Chen (tabloid.adroit)!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351049 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-14 10:55:55 +00:00
Alexey Bataev
ddd93146ae [DEBUGINFO][NVPTX]Make tests more strict, NFC.
NVPTX format requires that no labels/label arithmetics is used in the
debug info sections. To avoid possible problems with the adding/modifying the debug info functionality, made these tests more strict.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350731 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-09 15:41:44 +00:00
David Stenberg
e81d719f14 [DebugInfo] Omit location list entries with empty ranges
Summary:
This fixes PR39710. In that case we emitted a location list looking like
this:

.Ldebug_loc0:
        .quad   .Lfunc_begin0-.Lfunc_begin0
        .quad   .Lfunc_begin0-.Lfunc_begin0
        .short  1                       # Loc expr size
        .byte   85                      # DW_OP_reg5
        .quad   .Lfunc_begin0-.Lfunc_begin0
        .quad   .Lfunc_end0-.Lfunc_begin0
        .short  1                       # Loc expr size
        .byte   85                      # super-register DW_OP_reg5
        .quad   0
        .quad   0

As seen, the first entry's beginning and ending addresses evalute to 0,
which meant that the entry inadvertently became an "end of list" entry,
resulting in the location list ending sooner than expected.

To fix this, omit all entries with empty ranges. Location list entries
with empty ranges do not have any effect, as specified by DWARF, so we
might as well drop them:

"A location list entry (but not a base address selection or end of list
 entry) whose beginning and ending addresses are equal has no effect
 because the size of the range covered by such an entry is zero."

Reviewers: davide, aprantl, dblaikie

Reviewed By: aprantl

Subscribers: javed.absar, JDevlieghere, llvm-commits

Tags: #debug-info

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350698 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-09 09:58:59 +00:00
Heejin Ahn
f9a5bcde91 [WebAssembly] Rename StoreResults to MemIntrinsicResults
Summary:
StoreResults pass does not optimize store instructions anymore because
store instructions don't return results values anymore. Now this pass is
used solely for memory intrinsics, so update the pass name accordingly
and fix outdated pass descriptions as well.

This patch does not change any meaningful behavior, but not marked as
NFC because it changes a comment check line in a test case.

Reviewers: dschuff

Subscribers: mgorny, sbc100, jgravelle-google, sunfiish, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350669 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-08 22:35:18 +00:00
Paul Robinson
9597cfd242 Rename DIFlagFixedEnum to DIFlagEnumClass. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350641 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-08 17:52:29 +00:00
Davide Italiano
639e1eaac4 [Verifier] Reject invalid type for DILocalVariable.
Reviewers: aprantl

Subscribers: hiraditya, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350578 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-07 23:09:09 +00:00
Reid Kleckner
3fba0f7f7b [codeview] Check if this 'this' type of a method is a pointer
Fixes crash reported after r347354 for frontends that don't always emit
'this' pointers for methods. Now we will silently produce debug info
that makes functions like this look like static methods, which seems
reasonable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350073 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-26 21:52:17 +00:00
Max Kazantsev
c040b41454 Revert rL350048 and rL350050
These patches have broken almost all buildbots on test
DebugInfo/X86/addr_comments.ll. Reverting to green.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350052 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-24 10:30:04 +00:00