1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

373 Commits

Author SHA1 Message Date
Eric Christopher
0b1ab8f51b Remove unnecessary forward declare.
llvm-svn: 185495
2013-07-03 01:57:20 +00:00
Manman Ren
4245062b12 Debug Info: use module flag to set up Dwarf version.
Correctly handles ref_addr depending on the Dwarf version. Emit Dwarf with
version from module flag.

TODO: turn on/off features depending on the Dwarf version.
llvm-svn: 185484
2013-07-02 23:40:10 +00:00
Ulrich Weigand
d8bd69e85f [DebugInfo] Hold generic MCExpr in AddrPool
This changes the AddrPool infrastructure to enable it to hold
generic MCExpr expressions, not just MCSymbolRefExpr.

This is in preparation for supporting debug info for TLS variables
on PowerPC, where we need to describe the variable location using
a more complex expression than just MCSymbolRefExpr.

llvm-svn: 185459
2013-07-02 18:46:46 +00:00
David Blaikie
742cfe7ffb PR14728: DebugInfo: TLS variables with -gsplit-dwarf
llvm-svn: 185398
2013-07-01 23:55:52 +00:00
David Blaikie
11bb2e64f2 DebugInfo: Simplify the AddressPool representation
llvm-svn: 185189
2013-06-28 18:47:19 +00:00
David Blaikie
9f141a4f1b DebugInfo: constify the AddressPool MCSymbol pointers
llvm-svn: 185188
2013-06-28 18:47:14 +00:00
Manman Ren
7ef1e78101 LTO+Debug Info: revert r182791.
Since the testing case uses ref_addr, which requires version 3+ to work,
we will solve the dwarf version issue first.

This patch also causes failures in one of the bots. I will update the patch
accordingly in my next attempt.

rdar://13926659

llvm-svn: 182867
2013-05-29 17:16:59 +00:00
Manman Ren
f51e67e9a2 LTO+Debug Info: correctly emit inlined_subroutine when the inlined callee is
from a different CU.

We used to print out an error message and fail to generate inlined_subroutine.

If we use ref_addr in the generated DWARF, the DWARF version should be 3 or
above.
rdar://13926659

llvm-svn: 182791
2013-05-28 19:01:58 +00:00
Rafael Espindola
32589d78a2 Remove more dead code.
llvm-svn: 181656
2013-05-11 02:24:41 +00:00
David Blaikie
c1ede7b228 Finish renaming constructImportedModuleDIE to constructImportedEntityDIE
llvm-svn: 181391
2013-05-08 06:01:38 +00:00
David Blaikie
0e8a5b9d09 Rename DIImportedModule to DIImportedEntity and allow imported declarations
DIBuilder::createImportedDeclaration isn't fully plumbed through (note,
lacking in AsmPrinter/DwarfDebug support) but this seemed like a
sufficiently useful division of code to make the subsequent patch(es)
easier to follow.

llvm-svn: 181364
2013-05-07 21:35:53 +00:00
David Blaikie
b40dfb39c7 DebugInfo: Support imported modules in lexical blocks
llvm-svn: 181271
2013-05-06 23:33:07 +00:00
David Blaikie
9bfe15c313 Revert "Revert "PR14606: debug info imported_module support""
This reverts commit r179840 with a fix to test/DebugInfo/two-cus-from-same-file.ll

I'm not sure why that test only failed on ARM & MIPS and not X86 Linux, even
though the debug info was clearly invalid on all of them, but this ought to fix
it.

llvm-svn: 179996
2013-04-22 06:12:31 +00:00
Eric Christopher
88bdd26cc9 Revert "PR14606: debug info imported_module support"
This reverts commit r179836 as it seems to have caused test failures.

llvm-svn: 179840
2013-04-19 07:47:16 +00:00
David Blaikie
46f35f8e56 PR14606: debug info imported_module support
Adding another CU-wide list, in this case of imported_modules (since they
should be relatively rare, it seemed better to add a list where each element
had a "context" value, rather than add a (usually empty) list to every scope).
This takes care of DW_TAG_imported_module, but to fully address PR14606 we'll
need to expand this to cover DW_TAG_imported_declaration too.

llvm-svn: 179836
2013-04-19 06:57:04 +00:00
Eric Christopher
546e1942f2 DW_FORM_sec_offset should be a relocation on platforms that use
a relocation across sections. Do this for DW_AT_stmt list in the
skeleton CU and check the relocations in the debug_info section.

Add a FIXME for multiple CUs.

llvm-svn: 178969
2013-04-07 03:43:09 +00:00
Manman Ren
d88019ac47 Debug Info: use DW_FORM_ref_addr instead of DW_FORM_ref4 if the referenced DIE
belongs to a different compile unit.

DW_FORM_ref_addr should be used for cross compile-unit reference.

When compiling a large application, we got a dwarfdump verification error where
abstract_origin points to nowhere.

This error can't be reproduced on any testing case in MultiSource.
We may have other cases where we use DW_FORM_ref4 unconditionally.

rdar://problem/13370501

llvm-svn: 176882
2013-03-12 18:27:15 +00:00
David Blaikie
cae22d7ca6 Remove support for versioned debug info.
Versioned debug info support has been a burden to maintain & also compromised
current debug info verification by causing test cases testing old debug info to
remain rather than being updated to the latest. It also makes it hard to add or
change the metadata schema by requiring various backwards-compatibility in the
DI* hierarchy.

So it's being removed in preparation for new changes to the schema to tidy up
old/unnecessary fields and add new fields needed for new debug info (well, new
to LLVM at least).

The more surprising part of this is the changes to DI*::Verify - this became
necessary due to the changes to AsmWriter. AsmWriter was relying on the version
test to decide which bits of metadata were actually debug info when printing
the comment annotations. Without the version information the tag numbers were
too common & it would print debug info on random metadata that happened to
start with an integer that matched a tag number. Instead this change makes the
Verify functions more precise (just adding "number of operands" checks - not
type checking those operands yet) & relies on that to decide which metadata is
debug info metadata.

llvm-svn: 176838
2013-03-11 23:39:23 +00:00
Manman Ren
4287c8ee15 Debug Info: store the files and directories for each compile unit.
We now emit a line table for each compile unit. To reduce the prologue size
of each line table, the files and directories used by each compile unit are
stored in std::map<unsigned, std::vector< > > instead of std::vector< >.

The prologue for a lto'ed image can be as big as 93K. Duplicating 93K for each
compile unit causes a huge increase of debug info. With this patch, each
prologue will only emit the files required by the compile unit.

rdar://problem/13342023

llvm-svn: 176605
2013-03-07 01:42:00 +00:00
Krzysztof Parzyszek
bb3116f965 Allow optionally generating pubnames section in DWARF info. Introduce
option "generate-dwarf-pubnames" to control it, set to "false" by default.

llvm-svn: 174981
2013-02-12 18:00:14 +00:00
Eric Christopher
37c96d530b "Clean up" line section symbol emission by emitting the section
syms before constructing the compile units so we're not emitting
section references to sections not there already.

llvm-svn: 174663
2013-02-07 21:19:50 +00:00
Eric Christopher
19e3875192 Clean up multiple skeleton compile units if we have multiple compile
units coming in.

llvm-svn: 174548
2013-02-06 21:53:56 +00:00
Eric Christopher
9d072d2846 Remove some dead code.
llvm-svn: 174547
2013-02-06 21:53:53 +00:00
Eric Christopher
a159b6c731 Split address information for DWARF5 split dwarf proposal. This involves
using the DW_FORM_GNU_addr_index and a separate .debug_addr section which
stays in the executable and is fully linked.

Sneak in two other small changes:

a) Print out the debug_str_offsets.dwo section.
b) Change form we're expecting the entries in the debug_str_offsets.dwo
   section to take from ULEB128 to U32.

Add tests for all of this in the fission-cu.ll test.

llvm-svn: 172578
2013-01-15 23:56:56 +00:00
Eric Christopher
11f9d2e631 Move the string pools down into the units. No functional change.
llvm-svn: 171905
2013-01-08 22:22:06 +00:00
Eric Christopher
ba738518f0 Add support for separating strings for the split debug info DWARF5
proposal. This leaves the strings in the skeleton die as strp,
but in all dwo files they're accessed now via DW_FORM_GNU_str_index.

Add support for dumping these sections and modify the fission-cu.ll
testcase to have the correct strings and form. Fix a small bug
in the fixed form sizes routine that involved out of array accesses
for the table and add a FIXME in the extractFast routine to fix
this up.

llvm-svn: 171779
2013-01-07 19:32:41 +00:00
Eric Christopher
7096eb5a5c For the dwarf5 split debug info code split out the string section
per compile unit/skeleton compile unit. Update tests accordingly.

llvm-svn: 171133
2012-12-27 02:14:01 +00:00
Eric Christopher
537c3f1bc9 Whitespace and 80-column cleanup.
llvm-svn: 170771
2012-12-20 21:58:40 +00:00
Eric Christopher
622a4d5b97 Start splitting out the debug string section handling by moving it
into the DwarfUnits class.

llvm-svn: 170770
2012-12-20 21:58:36 +00:00
Eric Christopher
0f1dd74523 Split out abbreviations for the skeleton info from the rest of
the abbreviations. Part of implementing split dwarf.

llvm-svn: 170589
2012-12-19 22:02:53 +00:00
Bill Wendling
56d9c4b832 Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future.
llvm-svn: 170502
2012-12-19 07:18:57 +00:00
Dmitri Gribenko
79a7f51c9a Declare class DwarfDebug before use instead of relying on a forward declaration
from some other unrelated header.

Patch by Kai.

llvm-svn: 170284
2012-12-16 12:57:36 +00:00
Eric Christopher
9e773fa45e To simplify some code move the unit emission into the holders.
Make emitDIE public accordingly. No functional change.

llvm-svn: 170258
2012-12-15 00:04:07 +00:00
Eric Christopher
1a93fc9d67 Update some comments.
llvm-svn: 169907
2012-12-11 19:42:09 +00:00
Eric Christopher
2d11b002bc Refactor out the abbreviation handling into a separate class that
controls each of the abbreviation sets (only a single one at the
moment) and computes offsets separately as well for each set
of DIEs.

No real function change, ordering of abbreviations for the skeleton
CU changed but only because we're computing in a separate order. Fix
the testcase not to care.

llvm-svn: 169793
2012-12-10 23:34:43 +00:00
Eric Christopher
b3b9b702cb Rearrange vars and make comments more obvious.
llvm-svn: 169780
2012-12-10 22:25:41 +00:00
Eric Christopher
c67794597d Use the somewhat semantic term "split dwarf" it more matches what's
going on and makes a lot of the terminology in comments make more sense.

llvm-svn: 169758
2012-12-10 19:51:21 +00:00
Eric Christopher
67243c354a Reorder fission variables.
llvm-svn: 169756
2012-12-10 19:51:13 +00:00
Chandler Carruth
a98c778194 Sort includes for all of the .h files under the 'lib' tree. These were
missed in the first pass because the script didn't yet handle include
guards.

Note that the script is now able to handle all of these headers without
manual edits. =]

llvm-svn: 169224
2012-12-04 07:12:27 +00:00
Eli Bendersky
4b06c42c76 Fix PR12942: Allow two CUs to be generated from the same source file.
Thanks Eric for the review.

llvm-svn: 169142
2012-12-03 18:45:45 +00:00
Eric Christopher
17e71f21a8 Add some first skeleton work for the DWARF5 Fission proposal. Emit
part of the compile unit CU and start separating out information into
the various sections that will be pulled out later.

WIP.

llvm-svn: 169061
2012-11-30 23:59:06 +00:00
Eric Christopher
20076dc191 More comment.
llvm-svn: 168952
2012-11-29 22:56:13 +00:00
Eric Christopher
fdaa21621d Attempt to make the comments for dwarf debug look more like
the coding standard would like.

llvm-svn: 168737
2012-11-27 22:43:45 +00:00
Eric Christopher
a2656421d8 Make comment names match function names.
llvm-svn: 168644
2012-11-27 00:41:57 +00:00
Eric Christopher
41a20c2fec Pull some code out into functions to make rearranging them a bit easier.
llvm-svn: 168481
2012-11-22 00:59:49 +00:00
Eric Christopher
9ba928ae46 Update for some of the coding standard before rearranging functions
around.

llvm-svn: 168401
2012-11-21 00:34:35 +00:00
Eric Christopher
2b632babb4 Update some comments.
llvm-svn: 168400
2012-11-21 00:17:49 +00:00
Eric Christopher
b46aced215 Update and add some comments.
llvm-svn: 168399
2012-11-21 00:03:31 +00:00
Eric Christopher
6179304fc4 Whitespace.
llvm-svn: 168398
2012-11-21 00:03:28 +00:00
Eric Christopher
40554d2b5f Remove constness from this, it modifies the output stream as does
everything else underneath.

llvm-svn: 168395
2012-11-20 23:30:11 +00:00
Eric Christopher
d6e6be52c0 Remove unused function argument, add a bit to the comment.
llvm-svn: 168387
2012-11-20 22:14:13 +00:00
Eric Christopher
9c2055893d Remove a function argument and propagate const around accordingly.
llvm-svn: 168338
2012-11-19 22:42:15 +00:00
Eric Christopher
32873f6ec7 Add an option to enable prototype "fission" capabilities and debug changes.
llvm-svn: 167765
2012-11-12 22:22:20 +00:00
Benjamin Kramer
83badeb894 Replace some instances of UniqueVector with SetVector, which is slightly cheaper.
No functionality change.

llvm-svn: 167116
2012-10-31 13:45:49 +00:00
Eric Christopher
b67c16fe92 Have the DbgVariable "isArtificial" and "isObjectPointer" not
care about it being an argument variable so that we can decide
that captured block and lambda vars that don't happen to
be arguments could be an argument pointer.

Add the object pointer for one case onto the subprogram die.

rdar://12001329

llvm-svn: 164419
2012-09-21 22:18:52 +00:00
Eric Christopher
853a000638 Recommit, with fixes:
Add some support for dealing with an object pointer on arguments.

    Part of rdar://9797999

which now supports adding the object pointer attribute to the
subprogram as it should.

llvm-svn: 163754
2012-09-12 23:36:19 +00:00
Eric Christopher
e2dae503e6 Revert "Add some support for dealing with an object pointer on arguments."
This should be done on the subprogram, not the variable itself.

llvm-svn: 163734
2012-09-12 18:42:31 +00:00
Eric Christopher
9a8f37667b Add some support for dealing with an object pointer on arguments.
Part of rdar://9797999

llvm-svn: 163667
2012-09-12 00:26:55 +00:00
Eric Christopher
a327d985db 80-col fixup.
llvm-svn: 163569
2012-09-10 23:34:03 +00:00
Eric Christopher
b5562e6c57 Turn these two options in to trinary state so that they can be
turned on and off separate from the platform if you're on darwin.

llvm-svn: 162487
2012-08-23 22:36:40 +00:00
Eric Christopher
797ebecc1a Add a flag to DwarfDebug to allow it to communicate whether or not
we're using the darwin old gdb compat mode for emitting dwarf.

llvm-svn: 162486
2012-08-23 22:36:36 +00:00
Eric Christopher
dde7784606 Temporarily revert c23b933d5f8be9b51a1d22e717c0311f65f87dcd. It's causing
failures in the debug testsuite and possibly PR13486.

llvm-svn: 161121
2012-08-01 18:19:01 +00:00
Eric Christopher
acd91c534d Add a DW_AT_high_pc for CUs that are a single address range. Update
all tests accordingly.

Fixes PR13351.

Patch by shinichiro hamaji!

llvm-svn: 160899
2012-07-27 22:00:05 +00:00
Alexey Samsonov
7d35420c19 Cleanup in DwarfDebug - fix a typo and remove two unused functions
llvm-svn: 159433
2012-06-29 16:04:14 +00:00
Bill Wendling
e8949ecfa6 Move lib/Analysis/DebugInfo.cpp to lib/VMCore/DebugInfo.cpp and
include/llvm/Analysis/DebugInfo.h to include/llvm/DebugInfo.h.

The reasoning is because the DebugInfo module is simply an interface to the
debug info MDNodes and has nothing to do with analysis.

llvm-svn: 159312
2012-06-28 00:05:13 +00:00
Benjamin Kramer
bbdde33ff0 Allocate the contents of DwarfDebug's StringMaps in a single big BumpPtrAllocator.
llvm-svn: 158265
2012-06-09 10:34:15 +00:00
Benjamin Kramer
c798b7be6d DwarfDebug: Store the filename/dirname pair as a zero-separated string in a stringmap, instead of using a highly inefficient std::map of a pair of std::strings.
llvm-svn: 152541
2012-03-11 14:56:26 +00:00
Eric Christopher
73cbb37d7a Grammar.
llvm-svn: 151874
2012-03-02 01:57:55 +00:00
Chris Lattner
bed3b11d94 tidy up forward declarations.
llvm-svn: 149078
2012-01-26 20:44:57 +00:00
Eric Christopher
c916a28d7f Remove the pubnames section, no one consumes it.
llvm-svn: 144169
2011-11-09 05:24:07 +00:00
Eric Christopher
fddc6980b7 Remove unnecessary addition to API. Replace with something much simpler.
llvm-svn: 143925
2011-11-07 09:38:42 +00:00
Eric Christopher
f9c4db49bd Add the support code to enable the dwarf accelerator tables. Upcoming patches
to fix the types section (all types, not just global types), and testcases.

The code to do the final emission is disabled by default.

llvm-svn: 143923
2011-11-07 09:24:32 +00:00
Eric Christopher
64ea0f378b Expose a way to get the beginning of the dwarf string section.
llvm-svn: 143920
2011-11-07 09:18:38 +00:00
Nick Lewycky
691d7f80c2 Don't emit a directory entry for the value in DW_AT_comp_dir, that is always
implied by directory index zero.

llvm-svn: 143570
2011-11-02 20:55:33 +00:00
Nick Lewycky
651475977d Teach our Dwarf emission to use the string pool.
llvm-svn: 143097
2011-10-27 06:44:11 +00:00
Eric Christopher
9361aaeec3 Remove unused forward decl.
llvm-svn: 142892
2011-10-25 00:55:35 +00:00
Nick Lewycky
7624680f12 Missed a spot!
llvm-svn: 142436
2011-10-18 22:40:18 +00:00
Nick Lewycky
0de6ef455c Fix some typo/formatting issues. No functionality change.
llvm-svn: 142435
2011-10-18 22:39:43 +00:00
Nick Lewycky
c551c1c5f9 Add support for a new extension to the .file directive:
.file filenumber "directory" "filename"

This removes one join+split of the directory+filename in MC internals. Because
bitcode files have independent fields for directory and filenames in debug info,
this patch may change the .o files written by existing .bc files.

llvm-svn: 142300
2011-10-17 23:05:28 +00:00
Devang Patel
68d2232bfe Eliminate unnecessary forwarding function.
llvm-svn: 138006
2011-08-18 23:17:55 +00:00
Devang Patel
630d8ce36b Until now all debug info MDNodes referred to a root MDNode, a compile unit. This simplified handling of these needs in dwarf writer. However, one side effect of this is that during link time optimization all these MDNodes are _not_ uniqued. In other words there will be N number of MDNodes describing "int", "char" and all other types, which would suddenly grow when each object file starts using libraries like STL.
MDNodes graph structure such that compiler unit keeps track of important MDNodes and update dwarf writer to process mdnodes top-down instead of bottom up.

llvm-svn: 137778
2011-08-16 22:09:43 +00:00
Devang Patel
00c82827ab Refactor.
llvm-svn: 137689
2011-08-15 23:47:24 +00:00
Devang Patel
822410da56 Continue to hoist uses of getCompileUnit() up. The goal is to get rid of uses of getCompileUnit().
llvm-svn: 137683
2011-08-15 23:36:40 +00:00
Devang Patel
e0aa92d509 This is somewhat déjà-vu, but avoid using getCompileUnit() as much as possible.
llvm-svn: 137668
2011-08-15 22:24:32 +00:00
Devang Patel
8fe83ecaf3 Refactor. Variables are part of compile unit so let CompileUnit create new variable.
llvm-svn: 137663
2011-08-15 22:04:40 +00:00
Devang Patel
f5e3a86ea0 There is no need to maintain a set to keep track of variables that use location expressions. In such cases, AT_location attribute's value will be a label.
llvm-svn: 137659
2011-08-15 21:43:21 +00:00
Devang Patel
9ea2ce9b7b Fix warning.
llvm-svn: 137658
2011-08-15 21:35:16 +00:00
Devang Patel
1113107823 Simplify. Let DbgVariable keep track of variable's DBG_VALUE machine instruction.
llvm-svn: 137656
2011-08-15 21:24:36 +00:00
Devang Patel
7e0fc7cf86 Simplify mapping to variable from its abstract variable info.
When a variable is inlined multiple places, abstract variable keeps name, location, type etc.. info and all other concreate instances of the variable directly refers to abstract variable.

llvm-svn: 137637
2011-08-15 19:01:20 +00:00
Devang Patel
2b6f546226 Refactor.
llvm-svn: 137632
2011-08-15 18:40:16 +00:00
Devang Patel
84b2564244 Refactor.
llvm-svn: 137631
2011-08-15 18:35:42 +00:00
Devang Patel
ec9a83977b Refactor. A subprogram is part of compile unit so let CompileUnit construct new subprogram.
llvm-svn: 137618
2011-08-15 17:24:54 +00:00
Devang Patel
de73daa98c Start using LexicalScopes utility. No intetional functionality change.
llvm-svn: 137246
2011-08-10 20:55:27 +00:00
Devang Patel
bf27de8340 Refactor.
llvm-svn: 135633
2011-07-20 23:00:27 +00:00
Evan Cheng
10c6820ff4 Move getInitialFrameState from TargetFrameInfo to MCAsmInfo (suggestions for
better location welcome).

llvm-svn: 135438
2011-07-18 22:29:13 +00:00
Devang Patel
647ad13add Use DebugLoc directly to map inlined functions' instructions to respective lexical scope.
llvm-svn: 135302
2011-07-15 21:25:44 +00:00
Devang Patel
d539f30c73 Eliminate redundant map.
llvm-svn: 135278
2011-07-15 16:38:42 +00:00
Devang Patel
44a684072d Refactor.
llvm-svn: 135212
2011-07-14 23:17:49 +00:00
Devang Patel
ccc8ba373c Eliminate redundant LLVMContext argument.
Improve DbgScope->dump() output.

llvm-svn: 135207
2011-07-14 22:30:56 +00:00
Devang Patel
1856a523ea Simplify and delay extracting DebugLoc elements, scope and InlinedAt, as much as possible.
llvm-svn: 135124
2011-07-14 01:14:57 +00:00
Devang Patel
756482ca98 Make provision to have floating point constants in .debug_loc expressions.
llvm-svn: 134702
2011-07-08 16:49:43 +00:00
Devang Patel
1a3058d727 Do not drop constant values when a variable's content is described using .debug_loc entries.
llvm-svn: 132427
2011-06-01 22:03:25 +00:00
Devang Patel
344808fbe5 Identify end of prologue (and beginning of function body) using DW_LNS_set_prologue_end line table opcode.
llvm-svn: 131194
2011-05-11 19:22:19 +00:00
Rafael Espindola
59462d8ae3 Dead code elimination.
llvm-svn: 130984
2011-05-06 14:56:22 +00:00
Devang Patel
900ceb725b Teach dwarf writer to handle complex address expression for .debug_loc entries.
This fixes clang generated blocks' variables' debug info.
Radar 9279956.

llvm-svn: 130373
2011-04-28 02:22:40 +00:00
Devang Patel
f288e23b3f This mechanical patch moves type handling into CompileUnit from DwarfDebug. In case of multiple compile unit in one object file, each compile unit is responsible for its own set of type entries anyway. This refactoring makes this obvious.
llvm-svn: 129402
2011-04-12 22:53:02 +00:00
Devang Patel
c115961589 Remove dead typedef.
llvm-svn: 129368
2011-04-12 17:43:12 +00:00
Devang Patel
af7f5f4ada Refactor.
llvm-svn: 128929
2011-04-05 21:08:24 +00:00
Devang Patel
eb032aede2 Remove dead code.
llvm-svn: 128639
2011-03-31 16:53:49 +00:00
Jakob Stoklund Olesen
446412de55 Collect and coalesce DBG_VALUE instructions before emitting the function.
Correctly terminate the range of register DBG_VALUEs when the register is
clobbered or when the basic block ends.

The code is now ready to deal with variables that are sometimes in a register
and sometimes on the stack. We just need to teach emitDebugLoc to say 'stack
slot'.

llvm-svn: 128327
2011-03-26 02:19:36 +00:00
Jakob Stoklund Olesen
ab0501221b Emit less labels for debug info and stop emitting .loc directives for DBG_VALUEs.
The .dot directives don't need labels, that is a leftover from when we created
line number info manually.

Instructions following a DBG_VALUE can share its label since the DBG_VALUE
doesn't produce any code.

llvm-svn: 128284
2011-03-25 17:20:59 +00:00
Devang Patel
4909f41ec5 Keep track of directory namd and fIx regression caused by Rafael's patch r119613.
A better approach would be to move source id handling inside MC.

llvm-svn: 128233
2011-03-24 20:30:50 +00:00
Jakob Stoklund Olesen
28ebc380f6 Reapply r128045 and r128051 with fixes.
This will extend the ranges of debug info variables in registers until they are
clobbered.

Fix 1: Don't mistake DBG_VALUE instructions referring to incoming arguments on
the stack with DBG_VALUE instructions referring to variables in the frame
pointer. This fixes the gdb test-suite failure.

Fix 2: Don't trace through copies to physical registers setting up call
arguments. These registers are call clobbered, and the source register is more
likely to be a callee-saved register that can be extended through the call
instruction.

llvm-svn: 128114
2011-03-22 22:33:08 +00:00
Andrew Trick
63dc418ea3 Revert r128045 and r128051, debug info enhancements.
Temporarily reverting these to see if we can get llvm-objdump to link. Hopefully this is not the problem.

llvm-svn: 128097
2011-03-22 19:18:42 +00:00
Jakob Stoklund Olesen
fc9e8a04c3 Dont emit 'DBG_VALUE %noreg, ...' to terminate user variable ranges.
These ranges get completely jumbled by the post-ra scheduler, and it is not
really reasonable to expect it to make sense of them.

Instead, teach DwarfDebug to notice when user variables in registers are
clobbered, and terminate the ranges there.

llvm-svn: 128045
2011-03-22 00:21:41 +00:00
Devang Patel
8233c58f5d If argument numbering is encoded in metadata then emit arguments' debug info in that order.
llvm-svn: 126794
2011-03-01 22:58:55 +00:00
Cameron Zwarich
974208a607 Roll out r126425 and r126450 to see if it fixes the failures on the buildbots.
llvm-svn: 126488
2011-02-25 16:30:32 +00:00
Devang Patel
f2b2417c2c Enable DebugInfo support for COFF object files.
Patch by Nathan Jeffords!

llvm-svn: 126425
2011-02-24 21:04:00 +00:00
Devang Patel
930b4b16a1 Merge .debug_loc entries whenever possible to reduce debug_loc size.
llvm-svn: 124904
2011-02-04 22:57:18 +00:00
Devang Patel
71b1fadf20 Add support to describe template value parameter in debug info.
llvm-svn: 124755
2011-02-02 22:35:53 +00:00
Devang Patel
89455dc7cd Add support to describe template parameter type in debug info.
llvm-svn: 124752
2011-02-02 21:38:25 +00:00
Devang Patel
7cb0e7c2ef Emit 128 bit constant.
This fixes PR 8913 crash.

llvm-svn: 122971
2011-01-06 21:39:25 +00:00
Rafael Espindola
93a07b464e Change CodeGen to use .loc directives. This produces a lot more readable output
and testing is easier.  A good example is the unknown-location.ll test that
now can just look for ".loc 1 0 0".  We also don't use a DW_LNE_set_address for
every address change anymore.

llvm-svn: 119613
2010-11-18 02:04:25 +00:00
Devang Patel
3dd764feda Remove DW_AT_start_scope support. It is incomplete and superseeded by location entries support.
llvm-svn: 118940
2010-11-12 23:20:42 +00:00
Devang Patel
e544bb3842 s/beginScope/beginInstruction/g
s/endScope/endInstruction/g

llvm-svn: 117376
2010-10-26 17:49:02 +00:00
Devang Patel
0a414c918a Remove dead argument.
llvm-svn: 114920
2010-09-27 23:15:27 +00:00
Benjamin Kramer
9859d9eee4 Fix linux/msvc build, move include.
llvm-svn: 113776
2010-09-13 20:04:49 +00:00
Devang Patel
2eeab37306 Simplify.
llvm-svn: 112583
2010-08-31 06:11:28 +00:00
Devang Patel
9024c19242 Revert r107202. It is not adding any value.
llvm-svn: 111870
2010-08-24 00:06:12 +00:00
Devang Patel
8edc7575a4 Simplify.
llvm-svn: 110653
2010-08-10 04:12:17 +00:00
Devang Patel
191ed4c41d Drop "const". It does not add value here.
llvm-svn: 110652
2010-08-10 04:09:06 +00:00
Devang Patel
ef61383343 Do not include file static variable in pubnames list.
Refactor and simplify code to avoid redundant checks.

llvm-svn: 110642
2010-08-10 01:37:23 +00:00
Devang Patel
c5f885e228 Undo accidental commit.
llvm-svn: 110623
2010-08-09 23:28:52 +00:00
Devang Patel
4ccbd73f20 Simplify. Avoid redundant checks.
llvm-svn: 110621
2010-08-09 23:26:06 +00:00
Devang Patel
2d9b975304 Refactoring. Update DbgVarible to handle queries itself.
llvm-svn: 110600
2010-08-09 21:01:39 +00:00
Devang Patel
9110ec63bc It is ok, and convenient, to pass descriptors by value.
llvm-svn: 110590
2010-08-09 20:20:05 +00:00
Devang Patel
69b391b5b1 Reuse DIEInteger for 1. This is frequently used while emitting an attribute using dwarf::DW_FORM_flag form.
llvm-svn: 107903
2010-07-08 20:10:35 +00:00
Devang Patel
3d7c71dbbb One MDNode may be used to create regular DIE as well as abstract DIE.
Keep track of abstract subprogram DIEs. 

llvm-svn: 107822
2010-07-07 22:20:57 +00:00
Devang Patel
8052c941ca Do not hardcode DW_AT_stmt_list value.
Inspired by Artur Pietrek.

llvm-svn: 107202
2010-06-29 20:17:53 +00:00
Devang Patel
dffbf36af7 Preserve deleted function's local variables' debug info.
Radar 8122864.

llvm-svn: 107027
2010-06-28 18:25:03 +00:00
Devang Patel
1929457a0f Remove dead code.
llvm-svn: 106990
2010-06-28 05:59:13 +00:00
Devang Patel
b5b193fb87 Collect debug info for optimized variables of inlined functions.
llvm-svn: 106895
2010-06-25 22:07:34 +00:00
Devang Patel
a5f4e6f4d9 Use local small vector.
llvm-svn: 105332
2010-06-02 16:42:51 +00:00
Devang Patel
c24a269116 Identify instructions, that needs a label to mark debug info entity, in advance. This simplifies beginScope().
llvm-svn: 104720
2010-05-26 19:37:24 +00:00
Devang Patel
6f08a37562 Remove dead code.
llvm-svn: 104706
2010-05-26 17:42:50 +00:00
Devang Patel
d7ad8ac4c0 First cut at supporting .debug_loc section.
This is used to track variable information.

llvm-svn: 104649
2010-05-25 23:40:22 +00:00
Devang Patel
32a1ce3b3a Refactor.
llvm-svn: 104265
2010-05-20 19:57:06 +00:00
Devang Patel
f90f78669f Split DbgVariable. Eventually, variable info will be communicated through frame index, or DBG_VALUE instruction, or collection of DBG_VALUE instructions. Plus each DbgVariable may not need a label.
llvm-svn: 104233
2010-05-20 16:36:41 +00:00
Devang Patel
069568c287 Revert r104165.
llvm-svn: 104172
2010-05-19 21:58:28 +00:00
Devang Patel
d0b5830f72 There is no need to maintain InsnsBeginScopeSet separately.
llvm-svn: 104165
2010-05-19 21:26:53 +00:00