Rafael Espindola
2fe0ee1ce2
Rename DwarfRequiresRelocationForStmtList to
...
DwarfRequiresRelocationForSectionOffset as this is not specific to StmtList.
llvm-svn: 131148
2011-05-10 20:35:05 +00:00
Devang Patel
589845d887
Do not ignore InlinedAt while walking up scope chain to find subprogram node.
...
llvm-svn: 131106
2011-05-09 22:14:49 +00:00
Devang Patel
17b532728b
Move CompileUnit::getOrCreateNameSpace() and CompileUnit::addPubType() from DwarfDebug.cpp to DwarfCompileUnit.cpp
...
llvm-svn: 130991
2011-05-06 16:57:54 +00:00
Rafael Espindola
a716096677
Dead code elimination.
...
llvm-svn: 130984
2011-05-06 14:56:22 +00:00
Devang Patel
d6141e1db2
Remove little used statistical counter.
...
llvm-svn: 130955
2011-05-05 22:00:08 +00:00
Devang Patel
73bc172493
If debug info for inlined function is missing then handle it gracefully.
...
llvm-svn: 130933
2011-05-05 17:54:26 +00:00
Rafael Espindola
a75589171a
Producing a DW_FORM_addr for DW_AT_stmt_list is probably correct, but
...
it is both inefficient and unexpected by dwarfdump. Change to
a DW_FORM_data4.
While in here, change the predicate name to reflect that the position
is not really absolute (it is an offset), just that the linker needs a
relocation.
llvm-svn: 130846
2011-05-04 17:44:06 +00:00
Devang Patel
c981f6299e
Tighten up check for empty (i.e. no meaningful debug info) module. This fixes dwarf-die2.c test case from gcc test suite.
...
llvm-svn: 130842
2011-05-04 16:34:02 +00:00
Devang Patel
543596d57b
Even if the subprogram is going to use AT_specification, emit DW_AT_MIPS_linkage_name. This helps gdb and fixes var-path-expr.exp regression reported by gdb testsuite.
...
llvm-svn: 130794
2011-05-03 21:50:34 +00:00
Devang Patel
e02e58528a
If the front end has emitted llvm.dbg.cu and other debug info anchors (clang does it now) then use them directly. This saves one scan of entire module, to collect debug info, which in turns saves few machine cycles at compile time.
...
llvm-svn: 130759
2011-05-03 16:45:22 +00:00
Devang Patel
420ab5f180
Emit debug info for global variables first.
...
This works around a limitation in gdb which is reported by following inherit.exp test failures from gdb testsuite.
gdb.cp/inherit.exp: print g_vB.vB::vb
gdb.cp/inherit.exp: print g_vB.vB::vx
gdb.cp/inherit.exp: print g_vC.vC::vc
gdb.cp/inherit.exp: print g_vC.vC::vx
gdb.cp/inherit.exp: print g_vD.vB::vb
...
llvm-svn: 130702
2011-05-02 18:19:17 +00:00
Devang Patel
3e021533cd
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
77dc541b00
Simplify handling of variables with complex address (i.e. blocks variables)
...
llvm-svn: 130339
2011-04-27 22:45:24 +00:00
Devang Patel
2606f4d6d2
Rename a local variable.
...
llvm-svn: 130171
2011-04-25 23:05:21 +00:00
Devang Patel
8ce24133fd
Rename a method to match what it really does.
...
s/addVariableAddress/addFrameVariableAddress/g
llvm-svn: 130170
2011-04-25 23:02:17 +00:00
Devang Patel
2688e4aba6
Do not drop a variable's complex address if it is not based on frame base.
...
Observed this while reading code, so I do not have a test case handy here.
llvm-svn: 130167
2011-04-25 22:52:55 +00:00
Devang Patel
1d6bbd41aa
Let front-end tie subprogram declaration with subprogram definition directly.
...
llvm-svn: 130028
2011-04-22 23:10:17 +00:00
Devang Patel
ad45d911bb
Do not leak argument's DbgVariables.
...
llvm-svn: 130004
2011-04-22 18:09:57 +00:00
Devang Patel
2266aa84a1
Refactor.
...
llvm-svn: 129938
2011-04-21 21:07:35 +00:00
Devang Patel
28f2719d83
Add comment in output stream.
...
llvm-svn: 129921
2011-04-21 17:50:24 +00:00
Devang Patel
17740e70d5
Reduce clutter in asm output. Do not emit source location as comment for each instruction.
...
llvm-svn: 129715
2011-04-18 20:26:49 +00:00
Chris Lattner
0ab5e2cded
Fix a ton of comment typos found by codespell. Patch by
...
Luis Felipe Strano Moraes!
llvm-svn: 129558
2011-04-15 05:18:47 +00:00
Devang Patel
e141234940
Remove extra bytes that were added for gdb. We do not have good poiner to understand actual reason behind this fixme. Spot checking suggest that newer gdb does not need this.
...
llvm-svn: 129461
2011-04-13 19:41:17 +00:00
Devang Patel
28dce70364
Simplify. There is no need to use static variable.
...
llvm-svn: 129406
2011-04-12 23:10:47 +00:00
Devang Patel
f20c4f715f
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
5eb4319dba
Refactor CompileUnit into a separate header.
...
llvm-svn: 129367
2011-04-12 17:40:32 +00:00
Devang Patel
778947c203
Simplify array bound checks and clarify comments. One element array can have same non-zero number as lower bound as well as upper bound.
...
llvm-svn: 129170
2011-04-08 23:39:38 +00:00
Devang Patel
e39647951b
Do not emit DW_AT_upper_bound and DW_AT_lower_bound for unbouded array.
...
If lower bound is more then upper bound then consider it is an unbounded array.
An array is unbounded if non-zero lower bound is same as upper bound.
If lower bound and upper bound are zero than array has one element.
llvm-svn: 129156
2011-04-08 21:55:10 +00:00
Devang Patel
9f738849ab
Add support to encode function's template parameters.
...
llvm-svn: 128947
2011-04-05 22:52:06 +00:00
Devang Patel
d4e20eacf0
Refactor.
...
llvm-svn: 128929
2011-04-05 21:08:24 +00:00
Devang Patel
651d06e036
Do not emit empty name.
...
llvm-svn: 128914
2011-04-05 20:14:13 +00:00
Jakob Stoklund Olesen
9a624fa993
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
1886a4c823
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
e01b75cb89
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
a87d80cdca
Don't coalesce identical DBG_VALUE instructions prematurely.
...
Each of these instructions may have a RegsClobberInsn entry that can't be
ignored. Consecutive ranges are coalesced later when DwarfDebug::emitDebugLoc
merges entries.
llvm-svn: 128155
2011-03-23 18:37:30 +00:00
Jakob Stoklund Olesen
ec0ac3ca40
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
b0f98bb5e9
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
c6f4af028d
Clear map after use.
...
This is likely to fix the segfault in llvm-gcc-x86_64-darwin10-cross-mingw32.
llvm-svn: 128051
2011-03-22 01:03:24 +00:00
Jakob Stoklund Olesen
9c057ee440
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
Daniel Dunbar
fd95b016fb
Revert r127757, "Patch to a fix dwarf relocation problem on ARM. One-line fix
...
plus the test where it used to break.", which broke Clang self-host of a
Debug+Asserts compiler, on OS X.
llvm-svn: 127763
2011-03-16 22:16:39 +00:00
Renato Golin
a3aeafeb35
Patch to a fix dwarf relocation problem on ARM. One-line fix plus the test where it used to break.
...
llvm-svn: 127757
2011-03-16 21:05:52 +00:00
Devang Patel
63b3e76370
Fix typo.
...
llvm-svn: 126962
2011-03-03 21:49:41 +00:00
Devang Patel
34a7ab400e
Fix thinko in previous check-in.
...
Add comment.
llvm-svn: 126959
2011-03-03 20:08:10 +00:00
Devang Patel
4ab660b077
llvm::Function argument count is not a good indicator of how many arugments does the function have at source level. If we need more space, just resize vector conservatively. This vector is only used once per function.
...
llvm-svn: 126957
2011-03-03 20:02:02 +00:00
Devang Patel
6c622ef1bc
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
fcf51fd298
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
b037383a35
Enable DebugInfo support for COFF object files.
...
Patch by Nathan Jeffords!
llvm-svn: 126425
2011-02-24 21:04:00 +00:00
Devang Patel
a5d93247c2
Do not use DIFactory.
...
llvm-svn: 126397
2011-02-24 18:49:30 +00:00
Devang Patel
7b0f796c55
Use DW_FORM_data2 for DW_AT_language and let users use DW_LANG_lo_user=0x8000 to DW_LANG_hi_user=0xffff range.
...
llvm-svn: 126339
2011-02-23 22:37:04 +00:00
Devang Patel
5f1b4cdda1
Do not emit empty DW_TAG_lexical_block DIEs. In one test case, size of debug info reduced by almost 7%.
...
llvm-svn: 126009
2011-02-19 01:31:27 +00:00