Devang Patel
0d733b5d9f
Use lightweight DebugInfo objects directly.
...
llvm-svn: 62341
2009-01-16 19:28:14 +00:00
Devang Patel
867df54606
Align source code.
...
llvm-svn: 62328
2009-01-16 18:01:58 +00:00
Devang Patel
e067a7988c
Validate debug info values only if DwarfDebug is initialized.
...
llvm-svn: 62298
2009-01-16 02:15:14 +00:00
Devang Patel
32fed1c0ef
Any debug info symbol is only valid if atleast one compile unit is seen.
...
llvm-svn: 62294
2009-01-16 01:49:46 +00:00
Devang Patel
fa1b408b3b
Do not stumble over forward declared struct member.
...
llvm-svn: 62288
2009-01-16 00:50:53 +00:00
Devang Patel
76d190cf4a
Validate dbg_* intrinsics before lowering them.
...
llvm-svn: 62286
2009-01-15 23:41:32 +00:00
Rafael Espindola
6de96a1b5d
Add the private linkage.
...
llvm-svn: 62279
2009-01-15 20:18:42 +00:00
Devang Patel
851cdaf1fd
Use lightweight DebugInfo objects directly.
...
llvm-svn: 62276
2009-01-15 19:26:23 +00:00
Devang Patel
8bdc698336
Use variable's context to identify respective DbgScope.
...
Use light weight DebugInfo object directly.
llvm-svn: 62269
2009-01-15 18:25:17 +00:00
Devang Patel
dedd3e1e14
Do not construct debug scope if RootScope *is* null.
...
llvm-svn: 62209
2009-01-14 01:34:32 +00:00
Devang Patel
3c82aa0209
Removoe MachineModuleInfo methods (and related DebugInfoDesc class hierarchy) that were used to handle debug info.
...
llvm-svn: 62199
2009-01-13 23:54:55 +00:00
Devang Patel
7b13aeedea
Keep "has debug info" big in MachineModuleInfo to avoid circular dependency between AsmPrinter and CodeGen.
...
llvm-svn: 62191
2009-01-13 23:02:17 +00:00
Devang Patel
fe9581f0cd
Undo previous checkin.
...
llvm-svn: 62190
2009-01-13 22:54:57 +00:00
Devang Patel
dd25a9d0aa
Use DwarfWriter to record dbg variables.
...
llvm-svn: 62185
2009-01-13 21:44:10 +00:00
Devang Patel
ca997988c3
Use dwarf writer to decide whether the module has debug info or not.
...
llvm-svn: 62184
2009-01-13 21:25:00 +00:00
Devang Patel
f3456e8f07
Start using DebugInfo API to emit debug info.
...
llvm-svn: 62125
2009-01-13 00:20:51 +00:00
Devang Patel
243b4add9a
Emit debug info, only if at least one compile unit is seen.
...
llvm-svn: 62118
2009-01-12 23:09:42 +00:00
Devang Patel
b71fbeb19f
If multiple compile units are seen then emit them independently. In other words, do not force all DIEs into first, whatever it is, compile unit.
...
Note, multiple compile unit support is not well tested (it did not work correctly until now anyway.)
llvm-svn: 62116
2009-01-12 23:05:55 +00:00
Devang Patel
4aa4128ced
Avoid cast<>, use light weith wrapper directly.
...
llvm-svn: 62115
2009-01-12 22:58:14 +00:00
Devang Patel
4223582f00
Use SrcLineInfo from DwarfWriter. The MachineModuleInfo copy will disappear soon.
...
llvm-svn: 62114
2009-01-12 22:54:42 +00:00
Devang Patel
df31a7256d
Add DwarfWriter interface to mainipulate source location info.
...
( May be this info should be directly handled by the dwarf writer ? )
llvm-svn: 62096
2009-01-12 19:17:34 +00:00
Devang Patel
f033d53264
Clear debug info at the end of function processing.
...
llvm-svn: 62092
2009-01-12 18:48:36 +00:00
Devang Patel
5daa1abf25
There is no need to maintain separate labelid list in the dwarf writer. It is not a good idea.
...
llvm-svn: 62090
2009-01-12 18:41:00 +00:00
Devang Patel
af7d04207c
Reduce initial small vector sizes.
...
llvm-svn: 62023
2009-01-10 02:42:49 +00:00
Devang Patel
5491f25810
Fix thinko. Create parent scope if parent descriptor is *not* null.
...
llvm-svn: 62022
2009-01-10 02:34:18 +00:00
Devang Patel
f646668799
Convert DwarfWriter into a pass.
...
Now Users request DwarfWriter through getAnalysisUsage() instead of creating an instance of DwarfWriter object directly.
llvm-svn: 61955
2009-01-08 23:40:34 +00:00
Devang Patel
65143c537c
Add DebugInfo based APIs to record source line info.
...
llvm-svn: 61928
2009-01-08 17:19:22 +00:00
Devang Patel
145a7cfa85
Add APIs to record regions and variables.
...
Again, shamelessly copied from MMI.
llvm-svn: 61912
2009-01-08 02:49:34 +00:00
Devang Patel
fbbe93bf68
Add APIs to manage scope using DebugInfo interface.
...
This is a shameless copy of similar APIs from MachineModuleInfo. The copy from MMI will be deleted in near future.
llvm-svn: 61908
2009-01-08 02:33:41 +00:00
Devang Patel
928d465b6b
Set up DwarfDebug using DebugInfo API.
...
llvm-svn: 61822
2009-01-06 21:07:30 +00:00
Bill Wendling
a055b8c0d3
Forgot that this was needed for Linux. This should fix the builds.
...
llvm-svn: 61819
2009-01-06 19:13:55 +00:00
Devang Patel
244a649764
Construct subprogram DIEs using DebugInfo.
...
llvm-svn: 61772
2009-01-05 23:21:35 +00:00
Devang Patel
245a73ac16
Construct global variable DIEs using DebugInfo.
...
llvm-svn: 61771
2009-01-05 23:11:11 +00:00
Devang Patel
0479d7647f
Construct compile unit dies using DebugInfo.
...
llvm-svn: 61768
2009-01-05 23:03:32 +00:00
Bill Wendling
f9b5ba7bcb
Revert r61415 and r61484. Duncan was correct that these weren't needed.
...
llvm-svn: 61765
2009-01-05 22:53:45 +00:00
Devang Patel
ced6524437
Extract source location info from DebugInfo.
...
Add methods to add source location info in a DIE.
llvm-svn: 61761
2009-01-05 22:35:52 +00:00
Devang Patel
c0a190085d
Add type DIEs using DebugInfo.
...
llvm-svn: 61757
2009-01-05 21:47:57 +00:00
Devang Patel
1054a852b2
Construct composite type DIE using DebugInfo.
...
llvm-svn: 61741
2009-01-05 19:55:51 +00:00
Devang Patel
2c2eeabb54
s/ConstructType/ConstructTypeDIE/g
...
llvm-svn: 61731
2009-01-05 19:07:53 +00:00
Devang Patel
5024d377f2
Construct stuct field DIEs.
...
llvm-svn: 61729
2009-01-05 18:59:44 +00:00
Devang Patel
c0adc6b9bc
Construct enumerator DIE using DebugInfo.
...
llvm-svn: 61726
2009-01-05 18:38:38 +00:00
Devang Patel
758e7d7781
Construct array/vector type DIEs using DebugInfo.
...
llvm-svn: 61724
2009-01-05 18:33:01 +00:00
Devang Patel
1e03f7f19e
Construct basic and derived type DIEs using DebugInfo.
...
llvm-svn: 61714
2009-01-05 17:57:47 +00:00
Devang Patel
15deef2a3c
subsume ConstructPointerType()
...
llvm-svn: 61711
2009-01-05 17:45:59 +00:00
Devang Patel
ef2a94e8df
subsume ConstructBasicType().
...
llvm-svn: 61709
2009-01-05 17:44:11 +00:00
Bill Wendling
03f2af79b8
Linux wants the FDE initial location and address range to be forced to 32-bit.
...
Darwin doesn't. Make this optional for platforms.
llvm-svn: 61484
2008-12-29 22:12:11 +00:00
Bill Wendling
b13c83ac18
The FDE initial location and address range data should be free to be 64-bit
...
(quad) on a 64-bit platform. This fixes a problem with EH frames on Darwin.
llvm-svn: 61483
2008-12-29 21:51:42 +00:00
Bill Wendling
d6bd7e9372
Darwin likes for the EH frame to be non-local.
...
llvm-svn: 61420
2008-12-24 08:05:17 +00:00
Bill Wendling
066b5f6724
GCC doesn't emit DW_EH_PE_sdata4 for the FDE encoding on Darwin. I'm not sure
...
about other platforms.
llvm-svn: 61415
2008-12-24 05:25:49 +00:00
Devang Patel
70bd60d1d4
Fix typo.
...
Silence unused variable warning.
llvm-svn: 61391
2008-12-23 21:55:38 +00:00
Rafael Espindola
770b4b830a
Fix bug 3202.
...
The EH_frame and .eh symbols are now private, except for darwin9 and earlier.
The patch also fixes the definition of PrivateGlobalPrefix on pcc linux.
llvm-svn: 61242
2008-12-19 10:55:56 +00:00
Devang Patel
42828e8168
Do not print empty DW_AT_comp_dir.
...
llvm-svn: 60965
2008-12-12 21:57:54 +00:00
Evan Cheng
288fbd2133
Fix a couple of Dwarf bugs.
...
- Emit DW_AT_byte_size for struct and union of size zero.
- Emit DW_AT_declaration for forward type declaration.
llvm-svn: 60812
2008-12-10 00:15:44 +00:00
Evan Cheng
74a24b260e
Cosmetic changes.
...
llvm-svn: 60771
2008-12-09 17:56:30 +00:00
Bill Wendling
fe9e2c587d
The Dwarf writer was comparing mangled and unmangled names for C++ code when we
...
have an unreachable block in a function. This was triggering the assert. This is
a horrid hack to cover this up.
Oh! for a good debug info architecture!
llvm-svn: 57714
2008-10-17 18:48:57 +00:00
Dale Johannesen
d796164e89
Align EH tables before label is emitted, not after,
...
thus aligning the label.
llvm-svn: 57310
2008-10-08 21:50:21 +00:00
Dan Gohman
0d1e9a8e04
Switch the MachineOperand accessors back to the short names like
...
isReg, etc., from isRegister, etc.
llvm-svn: 57006
2008-10-03 15:45:36 +00:00
Bill Wendling
374d7f2b16
If we have a function with an unreachable statement such that the ending debug
...
information is in an unreachable block, then it's possible that the high/low pc
values won't be set for the dwarf information. E.g., this function:
void abort(void) __attribute__((__noreturn__));
void dead_beef(void) __attribute__ ((noreturn));
int *b;
void dead_beef(void) {
*b=0xdeadbeef;
abort();
}
has a call to "@llvm.dbg.region.end" only in the unreachable block:
define void @dead_beef() noreturn nounwind {
entry:
call void @llvm.dbg.func.start(...)
call void @llvm.dbg.stoppoint(...)
...
call void @abort( ) noreturn nounwind
unreachable
return: ; No predecessors!
call void @llvm.dbg.stoppoint(...)
call void @llvm.dbg.region.end(...)
ret void
}
The dwarf information emitted is something like:
0x00000084: TAG_subprogram [5]
AT_name( "dead_beef" )
AT_external( 0x01 )
AT_prototyped( 0x01 )
AT_decl_file( 0x01 )
AT_decl_line( 0x08 )
Note that this is *not* the best fix for this problem, but a band-aid for an
gaping wound. This code needs to be changed when we revamp our debugging
information.
llvm-svn: 56628
2008-09-26 00:28:12 +00:00
Anton Korobeynikov
7497762606
Get rid of duplicate char*/Section* DataSection
...
llvm-svn: 56575
2008-09-24 22:16:16 +00:00
Anton Korobeynikov
f8dc8aac3c
Get rid of duplicate char*/Section* TextSection
...
llvm-svn: 56574
2008-09-24 22:15:21 +00:00
Owen Anderson
9371964f47
Use raw_ostream throughout the AsmPrinter.
...
llvm-svn: 55092
2008-08-21 00:14:44 +00:00
Anton Korobeynikov
9cb0e94dc7
Move all assembler printing related stuff into new libAsmPrinter
...
llvm-svn: 54885
2008-08-17 13:53:04 +00:00