Commit Graph

2059 Commits

Author SHA1 Message Date
Wolfgang Pieb
45db4ee0fc [NFC] Change the string offsets table tests to generate the object on the fly
which enables us to remove the test scripts and object files from the repository.

https://reviews.llvm.org/D40914


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320227 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09 00:39:53 +00:00
Vedant Kumar
2cac108e97 [Debugify] Add a pass to test debug info preservation
The Debugify pass synthesizes debug info for IR. It's paired with a
CheckDebugify pass which determines how much of the original debug info
is preserved. These passes make it easier to create targeted tests for
debug info preservation.

Here is the Debugify algorithm:

  NextLine = 1
  for (Instruction &I : M)
    attach DebugLoc(NextLine++) to I

  NextVar = 1
  for (Instruction &I : M)
    if (canAttachDebugValue(I))
      attach dbg.value(NextVar++) to I

The CheckDebugify pass expects contiguous ranges of DILocations and
DILocalVariables. If it fails to find all of the expected debug info, it
prints a specific error to stderr which can be FileChecked.

This was discussed on llvm-dev in the thread:
"Passes to add/validate synthetic debug info"

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320202 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08 21:57:28 +00:00
Davide Italiano
4a34fb21ca [DebugInfo] Use llc instead of llc_dwarf to fix this test.
We work around the fact that some platforms add a triple when
they expand llc_dwarf in lit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320164 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08 17:15:50 +00:00
Davide Italiano
ad6f54524b [DebugInfo] Move this test to X86/ now that it specifies a triple.
Should bring back the arm/arm64 bots. Reported by Yvan Roux.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320057 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 16:10:39 +00:00
Francis Visoiu Mistrih
fd11bc0813 [CodeGen] Use MachineOperand::print in the MIRPrinter for MO_Register.
Work towards the unification of MIR and debug output by refactoring the
interfaces.

For MachineOperand::print, keep a simple version that can be easily called
from `dump()`, and a more complex one which will be called from both the
MIRPrinter and MachineInstr::print.

Add extra checks inside MachineOperand for detached operands (operands
with getParent() == nullptr).

https://reviews.llvm.org/D40836

* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/kill: ([^ ]+) ([^ ]+)<def> ([^ ]+)/kill: \1 def \2 \3/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/kill: ([^ ]+) ([^ ]+) ([^ ]+)<def>/kill: \1 \2 def \3/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/kill: def ([^ ]+) ([^ ]+) ([^ ]+)<def>/kill: def \1 \2 def \3/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/<def>//g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<kill>/killed \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<imp-use,kill>/implicit killed \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<dead>/dead \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<def[ ]*,[ ]*dead>/dead \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<imp-def[ ]*,[ ]*dead>/implicit-def dead \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<imp-def>/implicit-def \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<imp-use>/implicit \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<internal>/internal \1/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" -o -name "*.s" \) -type f -print0 | xargs -0 sed -i '' -E 's/([^ ]+)<undef>/undef \1/g'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320022 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 10:40:31 +00:00
Davide Italiano
9855a52b5b [DebugInfo] Explicitly pass a triple to this test.
As we emit different linetables format on different operating
systems, this currently fails on linux. Speculative commit
to fix the bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319997 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 01:22:10 +00:00
Davide Italiano
01e7a568cd [MC/Dwarf] Use the older DWARF linetables format on Darwin.
dsymutil doesn't yet understand the new format and the change,
among others, breaks a large fraction of the debugger tests on
mac OS.

rdar://problem/35856354

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319995 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 00:57:25 +00:00
Zachary Turner
304f979205 Regex out the local hash comparison test.
Since the local hash is a different number of bytes depending
on host architecture, we don't have a consistent value.  I
will need to re-do this test for both x86 and x64.  For now
it accepts any value for the local hash.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319864 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 00:58:12 +00:00
Zachary Turner
7c192eec2f Teach llvm-pdbutil to dump types from object files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319859 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 23:58:18 +00:00
Paul Robinson
a61e335ed0 Re-submit r289925 (Update .debug_line section version to match DWARF version)
Set the .debug_line version to match the requested DWARF version,
except with a maximum of v4 because we don't support v5 yet.

Previously Chromium had issues with this patch; see PR31407.  Chromium
tool issues have been addressed, so hopefully this will go through
this time.

Patch by Katya Romanova!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319699 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-04 21:27:46 +00:00
Francis Visoiu Mistrih
ca0df55065 [CodeGen] Unify MBB reference format in both MIR and debug output
As part of the unification of the debug format and the MIR format, print
MBB references as '%bb.5'.

The MIR printer prints the IR name of a MBB only for block definitions.

* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#" << ([a-zA-Z0-9_]+)->getNumber\(\)/" << printMBBReference(*\1)/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#" << ([a-zA-Z0-9_]+)\.getNumber\(\)/" << printMBBReference(\1)/g'
* find . \( -name "*.txt" -o -name "*.s" -o -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#([0-9]+)/%bb.\1/g'
* grep -nr 'BB#' and fix

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319665 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-04 17:18:51 +00:00
Paul Robinson
89e6e15552 [DebugInfo] Bail out if making no progress dumping line tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319564 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-01 18:25:30 +00:00
Hiroshi Inoue
e983865629 Recommit rL319407: [SROA] enable splitting for non-whole-alloca loads and stores
Recommiting once reverted patch rL319407 after adding a check for bit vector size to avoid failures in some build bots.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319522 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-01 06:05:05 +00:00
Francis Visoiu Mistrih
a2697fc00f [MIR] Fix DebugInfo tests after r319445
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319447 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 16:48:53 +00:00
Francis Visoiu Mistrih
7384652668 [CodeGen] Print "%vreg0" as "%0" in both MIR and debug output
As part of the unification of the debug format and the MIR format, avoid
printing "vreg" for virtual registers (which is one of the current MIR
possibilities).

Basically:

* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E "s/%vreg([0-9]+)/%\1/g"
* grep -nr '%vreg' . and fix if needed
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E "s/ vreg([0-9]+)/ %\1/g"
* grep -nr 'vreg[0-9]\+' . and fix if needed

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319427 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 12:12:19 +00:00
Hiroshi Inoue
50f1f9435a Revert rL319407: [SROA] enable splitting for non-whole-alloca loads and stores
This reverts commit rL319407 due to failures in some buildbot.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319410 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 08:29:51 +00:00
Hiroshi Inoue
39be023c86 [SROA] enable splitting for non-whole-alloca loads and stores
Currently, SROA splits loads and stores only when they are accessing the whole alloca.
This patch relaxes this limitation to allow splitting a load/store if all other loads and stores to the alloca are disjoint to or fully included in the current load/store. If there is no other load or store that crosses the boundary of the current load/store, the current splitting implementation works as is.
The whole-alloca loads and stores meet this new condition and so they are still splittable.

Here is a simplified motivating example.

struct record {
    long long a;
    int b;
    int c;
};

int func(struct record r) {
    for (int i = 0; i < r.c; i++)
        r.b++;
    return r.b;
}

When updating r.b (or r.c as well), LLVM generates redundant instructions on some platforms (such as x86_64, ppc64); here, r.b and r.c are packed into one 64-bit GPR when the struct is passed as a method argument.

With this patch, the above example is compiled into only few instructions without loop.
Without the patch, unnecessary loop-carried dependency is introduced by SROA and the loop cannot be eliminated by the later optimizers.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319407 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 07:44:46 +00:00
Adrian Prantl
ee2e970651 SROA: Don't create variable fragments that are outside of the variable.
An alloca may be larger than a variable that is described to be stored
there. Don't create a dbg.value for fragments that are outside of the
variable.

This fixes PR35447.
https://bugs.llvm.org/show_bug.cgi?id=35447

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319230 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-28 21:30:38 +00:00
Zachary Turner
ab45c0673e [CodeView] Refactor / Rewrite TypeSerializer and TypeTableBuilder.
The motivation behind this patch is that future directions require us to
be able to compute the hash value of records independently of actually
using them for de-duplication.

The current structure of TypeSerializer / TypeTableBuilder being a
single entry point that takes an unserialized type record, and then
hashes and de-duplicates it is not flexible enough to allow this.

At the same time, the existing TypeSerializer is already extremely
complex for this very reason -- it tries to be too many things. In
addition to serializing, hashing, and de-duplicating, ti also supports
splitting up field list records and adding continuations. All of this
functionality crammed into this one class makes it very complicated to
work with and hard to maintain.

To solve all of these problems, I've re-written everything from scratch
and split the functionality into separate pieces that can easily be
reused. The end result is that one class TypeSerializer is turned into 3
new classes SimpleTypeSerializer, ContinuationRecordBuilder, and
TypeTableBuilder, each of which in isolation is simple and
straightforward.

A quick summary of these new classes and their responsibilities are:

- SimpleTypeSerializer : Turns a non-FieldList leaf type into a series of
  bytes. Does not do any hashing. Every time you call it, it will
  re-serialize and return bytes again. The same instance can be re-used
  over and over to avoid re-allocations, and in exchange for this
  optimization the bytes returned by the serializer only live until the
  caller attempts to serialize a new record.

- ContinuationRecordBuilder : Turns a FieldList-like record into a series
  of fragments. Does not do any hashing. Like SimpleTypeSerializer,
  returns references to privately owned bytes, so the storage is
  invalidated as soon as the caller tries to re-use the instance. Works
  equally well for LF_FIELDLIST as it does for LF_METHODLIST, solving a
  long-standing theoretical limitation of the previous implementation.

- TypeTableBuilder : Accepts sequences of bytes that the user has already
  serialized, and inserts them by de-duplicating with a hash table. For
  the sake of convenience and efficiency, this class internally stores a
  SimpleTypeSerializer so that it can accept unserialized records. The
  same is not true of ContinuationRecordBuilder. The user is required to
  create their own instance of ContinuationRecordBuilder.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319198 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-28 18:33:17 +00:00
Francis Visoiu Mistrih
a4ec08b6fd [CodeGen] Print register names in lowercase in both MIR and debug output
As part of the unification of the debug format and the MIR format,
always print registers as lowercase.

* Only debug printing is affected. It now follows MIR.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319187 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-28 17:15:09 +00:00
Adrian Prantl
c8ef2d5d1b SROA: Avoid creating a fragment expression that covers the entire variable.
Fixes PR35416.

https://bugs.llvm.org/show_bug.cgi?id=35416

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319126 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-28 00:57:53 +00:00
Oren Ben Simhon
40090f420c Control-Flow Enforcement Technology - Shadow Stack support (LLVM side)
Shadow stack solution introduces a new stack for return addresses only.
The HW has a Shadow Stack Pointer (SSP) that points to the next return address.
If we return to a different address, an exception is triggered.
The shadow stack is managed using a series of intrinsics that are introduced in this patch as well as the new register (SSP).
The intrinsics are mapped to new instruction set that implements CET mechanism.

The patch also includes initial infrastructure support for IBT.

For more information, please see the following:
https://software.intel.com/sites/default/files/managed/4d/2a/control-flow-enforcement-technology-preview.pdf

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

Change-Id: I4daa1f27e88176be79a4ac3b4cd26a459e88fed4

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318996 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-26 13:02:45 +00:00
Paul Robinson
6d6a4920f5 [DwarfDump] -debug-line=offset applies to .dwo too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318856 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 18:23:55 +00:00
Paul Robinson
e8850416f6 [DebugInfo] Dump a .debug_line section, including line-number program,
without any compile units.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318842 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 15:48:30 +00:00
Paul Robinson
229c3418bc [DWARFv5] Support DW_FORM_strp in the .debug_line.dwo header.
As a side effect, the .debug_line section will be dumped in physical
order, rather than in the order that compile units refer to their
associated portions of the .debug_line section.  These are probably
always the same order anyway, and no tests noticed the difference.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318839 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 15:33:17 +00:00
Paul Robinson
a513cc4aa1 [DWARF] Fix handling of extended line-number opcodes
Differential Revision: https://reviews.llvm.org/D40200

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318838 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-22 15:14:49 +00:00
Jonas Devlieghere
4dac35da72 [DebugInfo] Fix potential CU mismatch for SubprogramScopeDIEs.
In constructAbstractSubprogramScopeDIE there can be a potential mismatch
between `this` and the CU of ContextDIE when a scope is shared between
two DISubprograms belonging to a different CU. In that case, `this` is
the CU that was specified in the IR, but the CU of ContextDIE is that of
the first subprogram that was emitted. This patch fixes the mismatch by
looking up the CU of ContextDIE, and switching to use that.

This fixes PR35212 (https://bugs.llvm.org/show_bug.cgi?id=35212)

Patch by Philip Craig!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318289 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 10:57:05 +00:00
Adrian Prantl
cfcc1f1c64 Fix an assertion in SelectionDAG::transferDbgValues()
when transferring debug info describing the lower bits of an extended SDNode.

rdar://problem/35504722

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318086 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 21:24:54 +00:00
Adrian Prantl
23bd33afd4 Add back target triple to test which I accidentally removed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317912 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-10 19:22:02 +00:00
Adrian Prantl
dc7bbb86a4 Move test into X86 subdirectory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317896 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-10 16:36:04 +00:00
Karl-Johan Karlsson
823bedeb8e [RegisterCoalescer] Move debug value after rematerialize trivial def
Summary:
The associated debug value is updated when the virtual source register
of a copy is completely eliminated and replaced with a rematerialize
value in the defed register of the copy. As the debug value now is
associated with another register it also need to be moved, otherwise
the debug value isn't valid.

Reviewers: aprantl

Reviewed By: aprantl

Subscribers: MatzeB, llvm-commits, qcolombet

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317880 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-10 09:48:40 +00:00
Adrian Prantl
13c8bc9216 Preserve debug info when DAG-combinging (zext (truncate x)) -> (and x, mask).
rdar://problem/27139077

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317825 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-09 19:50:20 +00:00
Adrian Prantl
d6200f6d89 Let replaceVTableHolder accept any type.
In Rust, a trait can be implemented for any type, and if a trait
object pointer is used for the type, then a virtual table will be
emitted for that trait/type combination.

We would like debuggers to be able to inspect trait objects, which
requires finding the concrete type associated with a given vtable.

This patch changes LLVM so that any type can be passed to
replaceVTableHolder. This allows the Rust compiler to emit the needed
debug info -- associating a vtable with the concrete type for which it
was emitted.

This is a DWARF extension: DWARF only specifies the meaning of
DW_AT_containing_type in one specific situation. This style of DWARF
extension is routine, though, and LLVM already has one such case for
DW_AT_containing_type.

Patch by Tom Tromey!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317730 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-08 22:04:43 +00:00
Adrian Prantl
29ba7f646b Un-XFAIL a test after the bugfix in r317702.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317708 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-08 19:18:20 +00:00
Adrian Prantl
27b6b3117f Handle inlined variables in SelectionDAGBuilder::EmitFuncArgumentDbgValue().
In 2010 a commit with no testcase and no further explanation
explicitly disabled the handling of inlined variables in
EmitFuncArgumentDbgValue(). I don't think there is a good reason for
this any more and re-enabling this adds debug locations for variables
associated with an LLVM function argument in functions that are
inlined into the first basic block. The only downside of doing this is
that we may insert a DBG_VALUE before the inlined scope, but (1) this
could be filtered out later, and (2) LiveDebugValues will not
propagate it into subsequent basic blocks if they don't dominate the
variable's lexical scope, so this seems like a small price to pay.

rdar://problem/26228128

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317702 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-08 18:27:13 +00:00
Paul Robinson
d37de6a865 Reapply r317609 with a simpler sed script, thanks to Justin Bogner!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317634 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-07 23:17:43 +00:00
Paul Robinson
aa34334e90 Revert r317609, test fails on one bot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317628 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-07 22:39:12 +00:00
Paul Robinson
2725af0410 Convert a dwarfdump test from checked-in binary to assembler source.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317612 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-07 20:35:44 +00:00
Paul Robinson
a2fd1c7e77 [DWARFv5] Add new test for previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317609 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-07 20:12:58 +00:00
Paul Robinson
e9d757c19e [DWARFv5] Support DW_FORM_strp in the .debug_line header.
Supporting this form in .debug_line.dwo will be done as a follow-up.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317607 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-07 19:57:12 +00:00
Adrian Prantl
0227fe59a9 Make DIExpression::createFragmentExpression() return an Optional.
We can't safely split arithmetic into multiple fragments because we
can't express carry-over between fragments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317534 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-07 00:45:34 +00:00
Adrian Prantl
29c52e4fc9 Invoke salvageDebugInfo from CodeGenPrepare's SinkCast()
This preserves the debug info for the cast operation in the original location.

rdar://problem/33460652

Reapplied r317340 with the test moved into an ARM-specific directory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317375 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-03 21:55:03 +00:00
Vedant Kumar
b57c6f4150 [Verifier] Remove the -verify-debug-info cl::opt
This cl::opt has been dead for a while. It's no longer possible to run
the verifier without also verifying debug info.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317288 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-02 23:44:20 +00:00
Reid Kleckner
207bce3fb1 [codeview] Merge file checksum entries for DIFiles with the same absolute path
Change the map key from DIFile* to the absolute path string. Computing
the absolute path isn't expensive because we already have a map that
caches the full path keyed on DIFile*.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317041 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-31 21:52:15 +00:00
Reid Kleckner
eb271e82ff [PDB] Handle an empty globals hash table with no buckets
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316722 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-27 00:45:51 +00:00
Adrian Prantl
4a39ef301e Implement salavageDebugInfo functionality for SelectionDAG.
Similar to how llvm::salvagDebugInfo hooks into InstCombine, this adds
a hook that can be invoked before an SDNode that is associated with an
SDDbgValue is erased to capture the effect of the deleted node in a
DIExpression.

The motivating example is an SDDebugValue attached to an ADD operation
that gets folded into a LOAD+OFFSET operation.

rdar://problem/32121503

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316525 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-24 22:55:12 +00:00
Reid Kleckner
f00e16113a [codeview] Don't emit FPO data in funclet prologues
Attempt 3 to work around bugs in FPO data with funclets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315600 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-12 18:20:35 +00:00
Reid Kleckner
7d539ce559 [codeview] Implement FPO data assembler directives
Summary:
This adds a set of new directives that describe 32-bit x86 prologues.
The directives are limited and do not expose the full complexity of
codeview FPO data. They are merely a convenience for the compiler to
generate more readable assembly so we don't need to generate tons of
labels in CodeGen. If our prologue emission changes in the future, we
can change the set of available directives to suit our needs. These are
modelled after the .seh_ directives, which use a different format that
interacts with exception handling.

The directives are:
  .cv_fpo_proc _foo
  .cv_fpo_pushreg ebp/ebx/etc
  .cv_fpo_setframe ebp/esi/etc
  .cv_fpo_stackalloc 200
  .cv_fpo_endprologue
  .cv_fpo_endproc
  .cv_fpo_data _foo

I tried to follow the implementation of ARM EHABI CFI directives by
sinking most directives out of MCStreamer and into X86TargetStreamer.
This helps avoid polluting non-X86 code with WinCOFF specific logic.

I used cdb to confirm that this can show locals in parent CSRs in a few
cases, most importantly the one where we use ESI as a frame pointer,
i.e. the one in http://crbug.com/756153#c28

Once we have cdb integration in debuginfo-tests, we can add integration
tests there.

Reviewers: majnemer, hans

Subscribers: aemerson, mgorny, kristof.beyls, llvm-commits, hiraditya

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315513 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-11 21:24:33 +00:00
Jonas Devlieghere
771d209701 Re-land "[llvm-dwarfdump] Print type names in DW_AT_type DIEs"
This patch adds printing for DW_AT_type DIEs like it is already the case
for DW_AT_specification DIEs. This is a rather naive approach and only a
start. We should have pretty printers for different languages.

Recommit after being reverted in r315299.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315316 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-10 14:15:25 +00:00
Jonas Devlieghere
269a7003bb Revert "[llvm-dwarfdump] Print type names in DW_AT_type DIEs"
This reverts commit r315297.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315299 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-10 11:49:56 +00:00