Commit Graph

1341 Commits

Author SHA1 Message Date
Devang Patel e7181b5fdb A DBG_VALUE that truncates a range does not start another dbg value range.
llvm-svn: 132433
2011-06-01 23:00:17 +00:00
Devang Patel 324f843107 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 562c74284f Incomplete type may not have corresponding DIE, so do not check DIEEntry eagerly.
llvm-svn: 132377
2011-06-01 00:23:24 +00:00
Devang Patel 1cb8ab456c Refactor.
llvm-svn: 132373
2011-05-31 23:30:30 +00:00
Devang Patel e9853f25ad Include global types, that are referenced through local variables, in debug_pubtypes list.
llvm-svn: 132371
2011-05-31 22:56:51 +00:00
Charles Davis a575226fd8 Emit the handler's data area. For GCC-style exceptions under Win64, the
handler's data area starts with a 4-byte reference to the personality
function, followed by the DWARF LSDA.

llvm-svn: 132302
2011-05-30 00:13:34 +00:00
Charles Davis b025724b46 When generating against the Win64 EH scheme, set the handler to the GCC-specific
handler.

At this moment, only GCC-style exceptions are supported. Other kinds
of exceptions, including "traditional" SEH and Microsoft Visual C++ exceptions,
need more work--and an compiler exception model that isn't specific to
GCC-style exceptions!

In particular, I imagine that it would be possible to mix "traditional" SEH
with GCC-style EH or Microsoft C++ EH. Currently LLVM has no way (beyond some
target-specific defaults and whole-module compiler switches) of knowing which
scheme to use when.

llvm-svn: 132283
2011-05-29 04:28:35 +00:00
Charles Davis 5638b9f01e When generating code for Win64 EH, emit StartProc and EndProc directives.
llvm-svn: 132250
2011-05-28 04:21:04 +00:00
Devang Patel 8816bbc02d Select DW_AT_const_value size based on global variable size.
llvm-svn: 132239
2011-05-28 00:39:18 +00:00
Rafael Espindola 836f7db2cc Fix the root cause of the bootstrap failure:
There was no way to check if a given register/mode pair was valid. We now return
an error code (-2) instead of asserting. If anyone thinks that an assert
at this point  is really needed, we can autogen a hasValidDwarfRegNum instead.

llvm-svn: 132236
2011-05-28 00:13:01 +00:00
Charles Davis 91ed799eb4 Stub out support for Win64-style exceptions. Note that this is merely using
the Win64 EH mechanism to implement GCC-style exceptions. LLVM supports
hardly anything else at this point!

llvm-svn: 132234
2011-05-27 23:47:32 +00:00
Rafael Espindola b8e08be77d Fix a regression I recently introduced by removing DwarfRegNum of
subregisters:

When a value is in a subregister, at least report the location as being
the superregister. We should extend the .td files to encode the bit
range so that we can produce a DW_OP_bit_piece.

llvm-svn: 132224
2011-05-27 22:15:01 +00:00
Rafael Espindola d23bfb8a7a Make size computation less brittle.
llvm-svn: 132222
2011-05-27 22:05:41 +00:00
Devang Patel 39e22eae49 Keep this simple. Use DIType to get signness and size of a type. Based on size, select appropraite form.
llvm-svn: 132206
2011-05-27 19:13:26 +00:00
Devang Patel f1d04706fb Handle signed types gracefully.
This fixes regressions reported by buildbots as a fallout of r132193.

llvm-svn: 132197
2011-05-27 18:15:52 +00:00
Devang Patel 3c6aed2d98 Select DW_AT_const_value size based on variable size.
llvm-svn: 132193
2011-05-27 16:45:18 +00:00
Rafael Espindola fc9bae6f8b Replace the -unwind-tables option with a per function flag. This is more
LTO friendly as we can now correctly merge files compiled with or without
-fasynchronous-unwind-tables.

llvm-svn: 132033
2011-05-25 03:44:17 +00:00
Devang Patel 354fa0798f Fix debug info for blocks' variable.
llvm-svn: 131940
2011-05-24 00:22:25 +00:00
Devang Patel faaa16ea2c Remove unnecessary comment.
llvm-svn: 131936
2011-05-23 23:16:14 +00:00
Jim Grosbach 8aded86edb No reason not to allow defining the CFA as a reg w/ offset zero.
llvm-svn: 131760
2011-05-20 21:50:09 +00:00
Jim Grosbach 17c1d13ee4 Fix typo.
llvm-svn: 131757
2011-05-20 21:35:39 +00:00
Jim Grosbach 83c4bb157a Add support for frame info use of the .cfi_def_cfa directive.
llvm-svn: 131756
2011-05-20 21:23:17 +00:00
Devang Patel 12419aee7a Doug convinced me that DW_AT_APPLE_objc_complete_type is more appropriate name.
s/DW_AT_APPLE_objc_class_extension/DW_AT_APPLE_objc_complete_type/g

llvm-svn: 131244
2011-05-12 21:29:42 +00:00
Devang Patel 2409e7843b Let Objective-C front-end identify class extension, in dwarf output, using an attribute DW_AT_APPLE_objc_class_extension.
llvm-svn: 131238
2011-05-12 19:06:16 +00:00
Devang Patel 34a6620748 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 a678098f24 Initialize moveTypeModule.
llvm-svn: 131157
2011-05-10 21:54:59 +00:00
Rafael Espindola 19c1a56287 Produce a __debug_frame section on darwin ARM when appropriate.
llvm-svn: 131151
2011-05-10 21:04:45 +00:00
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
Rafael Espindola fdc3e6fab6 Use .cfi_sections to put the unwind info in .debug_frame when possible. With
this clang will use .debug_frame in, for example,
clang -g -c -m32 test.c
This matches gcc's behaviour. It looks like .debug_frame is a bit bigger
than .eh_frame, but has the big advantage of not being allocated.

llvm-svn: 131140
2011-05-10 18:39:09 +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 705d25a1f4 Nothing else uses this label.
llvm-svn: 130989
2011-05-06 15:44:29 +00:00
Rafael Espindola 6e4fa20efb Yet more dead code.
llvm-svn: 130988
2011-05-06 15:31:55 +00:00
Rafael Espindola d06c2c1b81 Update comments.
llvm-svn: 130987
2011-05-06 15:28:56 +00:00
Rafael Espindola 4bfa978ca5 More dead code elimination.
llvm-svn: 130985
2011-05-06 15:22:26 +00:00
Rafael Espindola a716096677 Dead code elimination.
llvm-svn: 130984
2011-05-06 14:56:22 +00:00
Rafael Espindola bb237c72a6 Remove DwarfTableException.
llvm-svn: 130964
2011-05-05 23:19:54 +00:00
Rafael Espindola ec0a3a0bbf Remove the DwarfTable enum.
llvm-svn: 130959
2011-05-05 22:14:31 +00:00
Devang Patel d6141e1db2 Remove little used statistical counter.
llvm-svn: 130955
2011-05-05 22:00:08 +00:00
Rafael Espindola 59b6bfdbc6 Implement a really simple DwarfSjLjException.
llvm-svn: 130947
2011-05-05 20:48:31 +00:00
Rafael Espindola 240c96e2ca List all exception types in a switch.
llvm-svn: 130944
2011-05-05 19:48:34 +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
Bill Wendling a48b1375df Remove a flag that would set the ".eh" symbol as .globl. MachO was the only one
who used this flag, and it now emits CFI and doesn't emit this anymore. All
other targets left this flag "false".
<rdar://problem/8486371>

llvm-svn: 130918
2011-05-05 06:49:15 +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
Rafael Espindola e406670954 Only produce the eh_frame section if we have at least one personality function.
llvm-svn: 130692
2011-05-02 15:49:52 +00:00
Rafael Espindola 750cb61553 GCC uses a different encoding of pointers in the FDE when using
-fno-dwarf2-cfi-asm. Implement the same behavior.

llvm-svn: 130637
2011-05-01 04:49:54 +00:00