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

357 Commits

Author SHA1 Message Date
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
Devang Patel
2b99c27e47 Add support to preserve type info for the variables that are removed by the optimizer.
llvm-svn: 103798
2010-05-14 21:01:35 +00:00
Devang Patel
23f7323e7f Enable multiple Compile Units in one module.
This means now 'llvm-ld a.bc b.bc' will preserve debug info appropriately.

llvm-svn: 103439
2010-05-10 22:49:55 +00:00
Devang Patel
14f07a8625 Remove DIGlobal.
llvm-svn: 103325
2010-05-07 23:19:07 +00:00
Devang Patel
0638b539bb Wrap const MDNode * inside DIDescriptor.
llvm-svn: 103295
2010-05-07 20:54:48 +00:00
Devang Patel
d848109a46 Refactor.
llvm-svn: 102481
2010-04-28 01:03:09 +00:00
Devang Patel
4698fffbb8 Identify when a lexical scope is split in to multiple instruction ranges. Emit such ranges using DW_AT_ranges.
This patch fixes bug (PR6894) introduced by previous version of this patch.

llvm-svn: 102454
2010-04-27 19:46:33 +00:00
Dan Gohman
8b1e26715e Revert 102135, 102129, 102127, 102106, 102104, 102102, 102012, 102004,
because 102004 causes codegen to emit invalid assembly on at least
x86_64-unknown-gnu-linux.

llvm-svn: 102155
2010-04-23 01:18:53 +00:00
Devang Patel
ce6eb17106 Add comment.
llvm-svn: 102129
2010-04-22 20:56:35 +00:00
Devang Patel
cf9bece3dd Adjust debug range offsets for isWeakForLinker() functions.
llvm-svn: 102127
2010-04-22 20:52:00 +00:00
Devang Patel
c58366a423 Rename InsnAfterLabelMap and InsnBeforeLabelMap.
llvm-svn: 102106
2010-04-22 18:43:35 +00:00
Devang Patel
bae79885a8 Keep track of MCSymbol used to mark beginning of a function.
llvm-svn: 102104
2010-04-22 18:39:21 +00:00
Devang Patel
158b496cd1 Identify when a lexical scope is split in to multiple instruction ranges. Emit such ranges using DW_AT_ranges.
llvm-svn: 102004
2010-04-21 16:32:19 +00:00
Devang Patel
1929d78e71 Add support to emit dwarf ranges.
llvm-svn: 101575
2010-04-16 23:33:45 +00:00
Devang Patel
1b457aa5cd Add comment.
llvm-svn: 101317
2010-04-15 00:02:49 +00:00
Devang Patel
2374ea6452 There is no need to track compile unit offsets if there is only one compile unit.
llvm-svn: 101315
2010-04-14 23:56:24 +00:00
Devang Patel
321a86f14b Remove dead code.
llvm-svn: 101314
2010-04-14 23:54:13 +00:00
Devang Patel
17b5b1dd88 Rename a function.
llvm-svn: 100797
2010-04-08 18:43:56 +00:00
Devang Patel
89756fdbfc One instruction may start (or end) multiple lexical scopes.
There is no need to remember labels identifying regions marked by such instructions in each scope.

llvm-svn: 100781
2010-04-08 16:50:29 +00:00
Devang Patel
3cc4a24666 Remove dead code.
llvm-svn: 100771
2010-04-08 15:48:02 +00:00
Devang Patel
9ada7b28a2 Refactor.
llvm-svn: 100768
2010-04-08 15:37:09 +00:00
Benjamin Kramer
389c863692 Remove unused method.
llvm-svn: 100620
2010-04-07 11:23:46 +00:00
Bill Wendling
8282504a14 Use the "NamedGroupTimer" class to categorize DWARF emission better.
llvm-svn: 100616
2010-04-07 09:28:04 +00:00
Stuart Hastings
4f6cdc07e9 Reverting 100530 & 100531 due to regressions in the GDB test suite.
llvm-svn: 100563
2010-04-06 21:38:29 +00:00
Stuart Hastings
749cf45929 Revise debug info machinery to digest nested functions and classes.
A certain GDB testsuite case (local.cc) has a function nested inside a
class nested inside another function.  GCC presents the innermost
function to llvm-convert first.  Heretofore, the debug info mistakenly
placed the inner function at module scope.  This patch walks the GCC
context links and instantiates the outer class and function so the
debug info is properly nested.  Radar 7426545.

llvm-svn: 100530
2010-04-06 17:19:32 +00:00
Chris Lattner
91309715b4 hopefully sate the clang self host build, which is apparently
instantiating some folding set stuff that GCC isn't, requiring 
some types to not be incomplete.

I don't know if clang is right or wrong, but unbreaking the
bot is goodness.  Here's the broken build:
http://google1.osuosl.org:8011/builders/clang-x86_64-darwin10-selfhost/builds/1813/steps/compile.llvm.stage2/logs/stdio

llvm-svn: 100418
2010-04-05 06:12:01 +00:00
Chris Lattner
341747c032 privatize more stuff, eliminate vtables.
llvm-svn: 100410
2010-04-05 05:32:45 +00:00
Chris Lattner
5d96bd2bbe reprivatize now that DwarfWriter is gone.
llvm-svn: 100409
2010-04-05 05:31:04 +00:00
Chris Lattner
f2fb401571 prune #includes, realize the MMI can never be null.
llvm-svn: 100407
2010-04-05 05:24:55 +00:00
Chris Lattner
df6b0827aa change AsmPrinter to use DwarfDebug/DwarfException directly
instead of going through DwarfWriter.

llvm-svn: 100405
2010-04-05 05:11:15 +00:00
Chris Lattner
16ed3bfb2b eliminate DwarfDebug::shouldEmit, which is the same now as MMI::hasDebugInfo
llvm-svn: 100386
2010-04-05 03:52:55 +00:00
Chris Lattner
1fda8b3a8b fastisel doesn't need DwarfWriter, remove some tendricles.
llvm-svn: 100381
2010-04-05 02:19:28 +00:00
Chris Lattner
2b89b0d279 1) make DIE take AsmPrinter instead of DwarfPrinter.
2) change DwarfDebug to not inherit from DwarfPrinter.

llvm-svn: 100372
2010-04-05 00:13:49 +00:00
Chris Lattner
7295a273aa I was wrong, ocaml isn't referencing 'Ldata_begin', so remove it.
llvm-svn: 100365
2010-04-04 23:10:38 +00:00
Chris Lattner
265b59119d Store an use the symbols emitted at the start of the debug
sections instead of magically rematerializing them later.

llvm-svn: 100362
2010-04-04 22:59:04 +00:00
Chris Lattner
53453a2dc8 remove the didInitial ivar, rename emitInitial to be more
descriptive, change EmitSectionOffset back to taking a
symbol instead of a string.

llvm-svn: 100361
2010-04-04 22:33:59 +00:00
Chris Lattner
1917725796 remove the raw_ostream from various dwarf printing things.
The only thing left is LEB printing, which uses EmitRawText
for now.

llvm-svn: 100325
2010-04-04 07:48:20 +00:00
Chris Lattner
305c84b8ee Switch the code generator (except the JIT) onto the new DebugLoc
representation.  This eliminates the 'DILocation' MDNodes for 
file/line/col tuples from -O0 -g codegen.

This remove the old DebugLoc class, making it a typedef for DebugLoc,
I'll rename NewDebugLoc next.

I didn't update the JIT to use the new apis, so it will continue to
work, but be as slow as before.  Someone should eventually do this
or, better yet, rip out the JIT debug info stuff and build the JIT
on top of MC.

llvm-svn: 100209
2010-04-02 19:42:39 +00:00
Stuart Hastings
7c358afa1d Reverting 100048; it broke two Frontend debug info tests.
llvm-svn: 100058
2010-03-31 23:08:46 +00:00
Stuart Hastings
3a9c4bcef8 Debug info can now properly represent functions inside classes inside other functions. Partial fix for Radar 7424645.
llvm-svn: 100048
2010-03-31 21:10:54 +00:00
Benjamin Kramer
a71501e0dd DwarfDebug: Allocate DIEValues with a BumpPtrAllocator. Most of them are
POD-like anyway, so we don't even care about calling their d'tors (DIEBlock
being the exception).

~6% less mallocs and ~1% compile time improvement on clang -O0 -g oggenc.c

llvm-svn: 100035
2010-03-31 19:34:01 +00:00
Devang Patel
953a86e2bb Encode start location of debug value, communicated through DBG_VALUE machine instruction, in a variable's DIE.
llvm-svn: 99845
2010-03-29 22:59:58 +00:00
Devang Patel
cfd24dc84c Refactor code to push DILocation prcessing into DwarfDebug.cpp from AsmPrinter.cpp.
This is same as r99772 (which was reverted) with just one meaningful difference where two source lines exchanged their positions.

llvm-svn: 99816
2010-03-29 17:20:31 +00:00
Devang Patel
66e9b05428 Revert 99772.
llvm-svn: 99778
2010-03-28 21:23:37 +00:00
Devang Patel
bb5063a8cd Refactoring. Push DILocation processing in to DwarfDebug from AsmPrinter.
llvm-svn: 99772
2010-03-28 18:57:09 +00:00
Devang Patel
5f38bf4c87 Add comment.
llvm-svn: 99507
2010-03-25 15:09:44 +00:00
Devang Patel
48af12e998 DW_AT_stmt_list attribute attached with a compile unit encodes offset of line number information for this compile unit in debug_line section. This offset is always zero when only one compile unit is emitted in a object file.
llvm-svn: 99223
2010-03-22 22:38:48 +00:00
Devang Patel
3244526a3b Emit dwarf variable info communicated by code generator through DBG_VALUE machine instructions.
This is a work in progress.

llvm-svn: 98556
2010-03-15 18:33:46 +00:00
Chris Lattner
5ee7841af2 change SrcLineInfo to contain a label instead of a label ID.
llvm-svn: 98483
2010-03-14 08:15:55 +00:00
Chris Lattner
bfdbd2f3a2 reimplement the string pool used for inlined function
entries to not thrash std::strings and MCSymbols.

llvm-svn: 98415
2010-03-13 02:17:42 +00:00
Jeffrey Yasskin
824bd1b30d Free DbgScopes in DwarfDebug::endFunction(). Also increased the const-ness of
several fields to make it easier to figure out where bugs might be creeping in.

llvm-svn: 98358
2010-03-12 17:45:06 +00:00
Jeffrey Yasskin
239beb0e85 Avoid leaking CompileUnits in DwarfDebug.cpp.
llvm-svn: 98268
2010-03-11 18:29:55 +00:00
Chris Lattner
d51f1bdc58 reapply r98035:
Now that setStartLabel takes an MCSymbol, we can de-ID'ize
beginScope and RecordSourceLine.

llvm-svn: 98047
2010-03-09 04:54:43 +00:00
Eric Christopher
8875eba06a Speculatively revert r98035. It appears to have caused a set of buildbot
failures.

llvm-svn: 98039
2010-03-09 02:36:31 +00:00
Chris Lattner
c4a74bf48b Now that setStartLabel takes an MCSymbol, we can de-ID'ize
beginScope and RecordSourceLine.

llvm-svn: 98035
2010-03-09 02:08:02 +00:00
Chris Lattner
db93b91db1 make InlineInfoLabels hold MCSymbol*'s, avoiding
recomputation of the labels.

llvm-svn: 98016
2010-03-09 00:31:02 +00:00
Chris Lattner
10d571f349 simplify EmitSectionOffset to always use .set if it is
available, the only thing this affects is that we produce
.set in one case we didn't before, which shouldn't harm
anything.  Make EmitSectionOffset call EmitDifference
instead of duplicating it.

llvm-svn: 98005
2010-03-08 23:23:25 +00:00
Chris Lattner
bfd38653e6 merge DIEObjectLabel and DIEDwarfLabel into DIELabel.
Yes, DIE you fiendish labels, die all of you.

llvm-svn: 97995
2010-03-08 22:31:46 +00:00
Chris Lattner
cbce2df237 elimiante the DWLabel class, using MCSymbol instead. Start
switching some stuff over to passing around MCSymbol* instead
of stem+ID.

llvm-svn: 97993
2010-03-08 22:23:36 +00:00
Devang Patel
ea239f6e0a Derive DIType from DIScope. This simplifies getContext() where for members the context is a type. This also eliminates need of CompileUnitMaps maintained by dwarf writer.
llvm-svn: 97990
2010-03-08 22:02:50 +00:00
Devang Patel
176dc29a62 Avoid using DIDescriptor.isNull().
This is a first step towards eliminating checks in Descriptor constructors.

llvm-svn: 97975
2010-03-08 20:52:55 +00:00
Devang Patel
a716e313d6 Revert r97947.
llvm-svn: 97963
2010-03-08 19:20:38 +00:00
Devang Patel
1527b2657b Avoid using DIDescriptor.isNull().
This is a first step towards eliminating unncessary constructor checks in light weight DIDescriptor wrappers.

llvm-svn: 97947
2010-03-08 18:25:48 +00:00
Douglas Gregor
c52fc8f922 Revert r97917, which was causing Clang Debug self-host failures.
llvm-svn: 97932
2010-03-08 02:58:37 +00:00
Jeffrey Yasskin
2c23c1d1a1 Roll r97906 forward again, without double-deleting CompileUnit::IndexTyDie.
llvm-svn: 97917
2010-03-07 17:10:13 +00:00
Jeffrey Yasskin
c68dc05867 _2_ gcc crashes, ah, ah, ah...
(Rolling back r97906.)

llvm-svn: 97909
2010-03-07 07:16:49 +00:00
Jeffrey Yasskin
c0123f0033 Avoid leaking CompileUnits and DbgScopes from DwarfDebug. Leaks found by Valgrind!
llvm-svn: 97906
2010-03-07 06:55:35 +00:00
Dan Gohman
92b6122204 Fix "the the" and similar typos.
llvm-svn: 95781
2010-02-10 16:03:48 +00:00
Chris Lattner
7dbd5458b2 constify a bunch of dwarf stuff now that the registerinfo method
is constified.

llvm-svn: 94613
2010-01-26 23:18:02 +00:00
Chris Lattner
7976cac884 rename the dwarf class to DwarfPrinter. This matches the filename
and much more accurately describes what it is all about.

llvm-svn: 94233
2010-01-22 22:23:57 +00:00
Devang Patel
a230047a58 MDNodes are not expected to disappear or replaced by another MDNode, so there is no need to pay the cost of WeakVH and ValueMaps.
llvm-svn: 93865
2010-01-19 06:19:05 +00:00
Chris Lattner
04b7c11880 Change DIEObjectLabel to take an MCSymbol instead of std::string.
llvm-svn: 93647
2010-01-16 18:50:28 +00:00
Devang Patel
ffb33d1df8 Add support to emit debug info for C++ namespaces.
llvm-svn: 91440
2009-12-15 19:16:48 +00:00
Devang Patel
101a4bdd4a Use DW_AT_specification to point to DIE describing function declaration.
llvm-svn: 91278
2009-12-14 16:18:45 +00:00
Devang Patel
888cd4aa89 Construct CompileUnits lazily.
llvm-svn: 91159
2009-12-11 21:37:07 +00:00
Devang Patel
30bc9263b9 Refactor code that finds context for a given die.
Create global variable DIEs after creating subprogram DIEs. This allows function level static variable's to find their context at the time of DIE creation.

llvm-svn: 91055
2009-12-10 19:14:49 +00:00
Devang Patel
32e16ff8a2 Refactor.
llvm-svn: 91051
2009-12-10 18:05:33 +00:00
Devang Patel
796d04d168 Reapply r90858, a cleanup patch.
llvm-svn: 90979
2009-12-09 18:24:21 +00:00
Devang Patel
11874672da Revert 90858 90875 and 90805 for now.
llvm-svn: 90898
2009-12-08 23:21:45 +00:00
Devang Patel
5905a705fe Cleanup.
There is no need to supply ModuleCU to addType() as a parameter.

llvm-svn: 90858
2009-12-08 15:31:31 +00:00
Devang Patel
e59f4f7204 Add support to emit debug info for c++ style namespaces.
llvm-svn: 90805
2009-12-07 21:41:32 +00:00
Devang Patel
fe7cf074f0 Add support to emit debug info for virtual functions and virtual base classes.
llvm-svn: 90474
2009-12-03 19:11:07 +00:00
Devang Patel
45a72a7032 Emit method definition DIE at module level (even for methods with inlined functino body at soure level) so that the debugger can invoke it. This fixes many test failures in gdb test suite.
llvm-svn: 90375
2009-12-03 01:25:38 +00:00
Devang Patel
d50fc13c19 Use StringRef (again) in DebugInfo interface.
llvm-svn: 89866
2009-11-25 17:36:49 +00:00
Devang Patel
f01ac414c5 Use StringRef instead of std::string in DIEString.
llvm-svn: 89793
2009-11-24 19:42:17 +00:00
Devang Patel
11c5d09a35 Emit pubtypes.
llvm-svn: 89725
2009-11-24 01:14:22 +00:00
Devang Patel
7f5e6b43a0 Cosmetic changes, which were long overdue, in DwarfDebug.cpp.
llvm-svn: 89537
2009-11-21 02:48:08 +00:00
Devang Patel
8d7175f85f There is no need to use FoldingSet to unique DIEs.
DIEs are created from MDNode, which are already uniqued. And DwarfDebug already uses ValueMaps to find and use existing DIE for a given MDNode.

llvm-svn: 89518
2009-11-21 00:31:03 +00:00
Nick Lewycky
70113e8a1b Remove VISIBILITY_HIDDEN from the classes in this directory. Fixes bug 5507.
llvm-svn: 89075
2009-11-17 09:17:08 +00:00
Devang Patel
c024e96ca3 "Attach debug info with llvm instructions" mode was enabled a month ago. Now make it permanent and remove old way of inserting intrinsics to encode debug info for line number and scopes.
llvm-svn: 87014
2009-11-12 19:02:56 +00:00
Devang Patel
5c983cb2ab Implement support to debug inlined functions.
llvm-svn: 86748
2009-11-10 23:06:00 +00:00
Devang Patel
635c6192e6 Do not held on to DenseMap slot accross map insertion. The insertion may cause the map to grow rending the slot invalid.
Use this opportunity to use ValueMap instead of DenseMap.

llvm-svn: 85298
2009-10-27 20:47:17 +00:00
Devang Patel
22761afada Add support to record DbgScope as inlined scope.
llvm-svn: 84134
2009-10-14 21:08:09 +00:00
Devang Patel
c97c44b584 Extract scope information from the variable itself, instead of relying on alloca or llvm.dbg.declare location.
While recording beginning of a function, use scope info from the first location entry instead of just relying on first location entry itself.

llvm-svn: 83684
2009-10-09 22:42:28 +00:00
Devang Patel
e16aac2206 Do not record line number to implicitly mark start of function if function has arguments. Extra line number entries trip gdb in some cases.
llvm-svn: 83563
2009-10-08 18:48:03 +00:00
Devang Patel
3200e99109 Remove dead code.
llvm-svn: 83362
2009-10-06 02:01:32 +00:00
Devang Patel
0141a90812 Add utility routine to set begin and end labels for DbgScopes.
This will be used by processDebugLoc().

llvm-svn: 83361
2009-10-06 01:50:42 +00:00
Devang Patel
2001f5878b Remove unintentional function decl.
llvm-svn: 83356
2009-10-06 01:31:35 +00:00
Devang Patel
ac511d1acf Add utility routine to collect variable debug info. This is not yet used.
llvm-svn: 83355
2009-10-06 01:26:37 +00:00
Devang Patel
dff583ac49 Adjust context for the global variables that are not at file scope, e.g.
void foo() { static int bar = 42; }
Here, foo's DIE is parent of bar's DIE.

llvm-svn: 83344
2009-10-05 23:40:42 +00:00
Devang Patel
7aa19711f8 Add support to extract lexical scope information from DebugLoc attached with an machine instruction.
This is not yet enabled.

llvm-svn: 83210
2009-10-01 20:31:14 +00:00
Devang Patel
044648c2d7 Use MDNode * directly as an RecordSourceLine() argument.
llvm-svn: 83182
2009-09-30 22:51:28 +00:00
Mike Stump
a3bce35a07 Add a way for a frontend to generate more complex dwarf location
information.  This allows arbitrary code involving DW_OP_plus_uconst
and DW_OP_deref.  The scheme allows for easy extention to include,
any, or all of the DW_OP_ opcodes.  I thought about just exposing all
of them, but, wasn't sure if people wanted the dwarf opcodes exposed
in the api.  Is that a layering violation?

With this scheme, the entire existing block scheme used by llvm-gcc
can be switched over to the new scheme.  I think that would be
cleaner, as then the compiler specific bits are not present in llvm
proper.  Before the old code can be yanked however, similar code in
clang would have to be removed.

Next up, more testing.

llvm-svn: 83120
2009-09-30 00:08:22 +00:00
Devang Patel
e5be8e79df Remove std::string uses from DebugInfo interface.
llvm-svn: 83083
2009-09-29 18:40:58 +00:00
Devang Patel
fb8892d0e1 Subprogram is a scope. Derive DISubprogram from DIScope.
llvm-svn: 80637
2009-08-31 22:47:13 +00:00
Caroline Tice
e49e2d352c Add flag to mark structs for Apple Block "byref" variables; also add code to
modify the type and location debug information for these variables to match the
programmer's expectations.

llvm-svn: 80625
2009-08-31 21:19:37 +00:00
Devang Patel
fbaeda732e Reapply 79977.
Use MDNodes to encode debug info in llvm IR.

llvm-svn: 80406
2009-08-28 23:24:31 +00:00
Devang Patel
10c075a316 Revert 79977. It causes llvm-gcc bootstrap failures on some platforms.
llvm-svn: 80073
2009-08-26 05:01:18 +00:00
Devang Patel
7d42bfab6c Update DebugInfo interface to use metadata, instead of special named llvm.dbg.... global variables, to encode debugging information in llvm IR. This is mostly a mechanical change that tests metadata support very well.
This change speeds up llvm-gcc by more then 6% at "-O0 -g" (measured by compiling InstructionCombining.cpp!)

llvm-svn: 79977
2009-08-25 05:24:07 +00:00
Chris Lattner
5d8af49626 Rename TargetAsmInfo (and its subclasses) to MCAsmInfo.
llvm-svn: 79763
2009-08-22 20:48:53 +00:00
Devang Patel
c071d6c1b4 Record variable debug info at ISel time directly.
llvm-svn: 79742
2009-08-22 17:12:53 +00:00
Chris Lattner
75b7692e66 switch off of 'Section' onto MCSection. We're not properly using
MCSection subclasses yet, but this is a step in the right direction.

llvm-svn: 77708
2009-07-31 18:48:30 +00:00
Devang Patel
f1387bc427 revert rev. 75503 for now.
llvm-svn: 75507
2009-07-13 21:26:33 +00:00
Devang Patel
ca075d2f7a Use Mangler to remove leading '1' from linkage names.
llvm-svn: 75503
2009-07-13 21:19:56 +00:00
Devang Patel
4fdc3e6c1d Remove dead code.
llvm-svn: 74949
2009-07-07 21:12:32 +00:00
Devang Patel
bff451b95b s/MainCU/ModuleCU/g
llvm-svn: 74452
2009-06-29 20:45:18 +00:00
Devang Patel
84a8914a4a Remove debug info anchors - llvm.dbg.compile_units, llvm.dbg.subprograms
and llvm.dbg.global_variables.

llvm-svn: 74251
2009-06-26 01:49:18 +00:00