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

270 Commits

Author SHA1 Message Date
Bill Wendling
62c4c8bc44 StringMap<DIE*>::iterator::first() returns a pointer to the first character of
the key. This will cause it to create a new std::string, which isn't
wanted. Instead, pass back the "const char*". Modify the EmitString() method to
take a "const char*".

llvm-svn: 68741
2009-04-09 23:51:31 +00:00
Bill Wendling
e1dd8c815b Use a StringMap instead of std::map for storing std::string->DIE* maps. This
gives a micro speedup in the Dwarf writer.

llvm-svn: 68728
2009-04-09 21:49:15 +00:00
Devang Patel
187a4c385a If subprogram type is not tagged as DW_TAG_subroutine_type then use it directly as a return value type.
llvm-svn: 68647
2009-04-08 22:18:45 +00:00
Chris Lattner
80cbd85a29 change printStringChar to emit characters as unsigned char instead of char,
avoiding sign extension for the top octet.  For "negative" chars, we'd print
stuff like:

.asciz	"\702...
now we print:
.asciz	"\302...

llvm-svn: 68577
2009-04-08 00:28:38 +00:00
Evan Cheng
3a7489a4cc CodeGen still defaults to non-verbose asm, but llc now overrides it and default to verbose.
llvm-svn: 67668
2009-03-25 01:47:28 +00:00
Devang Patel
225831fc9e Do not ignore DW_TAG_class_type!
llvm-svn: 67661
2009-03-25 00:28:40 +00:00
Evan Cheng
b3196f1298 Do not emit comments unless -asm-verbose.
llvm-svn: 67580
2009-03-24 00:17:40 +00:00
Dale Johannesen
34123aba43 Fix internal representation of fp80 to be the
same as a normal i80 {low64, high16} rather
than its own {high64, low16}.  A depressing number
of places know about this; I think I got them all.
Bitcode readers and writers convert back to the old
form to avoid breaking compatibility.

llvm-svn: 67562
2009-03-23 21:16:53 +00:00
Evan Cheng
0c629db2aa For inline asm output operand that matches an input. Encode the input operand index in the high bits.
llvm-svn: 67387
2009-03-20 18:03:34 +00:00
Evan Cheng
f9951d1557 Fix some significant problems with constant pools that resulted in unnecessary paddings between constant pool entries, larger than necessary alignments (e.g. 8 byte alignment for .literal4 sections), and potentially other issues.
1. ConstantPoolSDNode alignment field is log2 value of the alignment requirement. This is not consistent with other SDNode variants.
2. MachineConstantPool alignment field is also a log2 value.
3. However, some places are creating ConstantPoolSDNode with alignment value rather than log2 values. This creates entries with artificially large alignments, e.g. 256 for SSE vector values.
4. Constant pool entry offsets are computed when they are created. However, asm printer group them by sections. That means the offsets are no longer valid. However, asm printer uses them to determine size of padding between entries.
5. Asm printer uses expensive data structure multimap to track constant pool entries by sections.
6. Asm printer iterate over SmallPtrSet when it's emitting constant pool entries. This is non-deterministic.


Solutions:
1. ConstantPoolSDNode alignment field is changed to keep non-log2 value.
2. MachineConstantPool alignment field is also changed to keep non-log2 value.
3. Functions that create ConstantPool nodes are passing in non-log2 alignments.
4. MachineConstantPoolEntry no longer keeps an offset field. It's replaced with an alignment field. Offsets are not computed when constant pool entries are created. They are computed on the fly in asm printer and JIT.
5. Asm printer uses cheaper data structure to group constant pool entries.
6. Asm printer compute entry offsets after grouping is done.
7. Change JIT code to compute entry offsets on the fly.

llvm-svn: 66875
2009-03-13 07:51:59 +00:00
Bill Wendling
5499163a0a Oops...I committed too much.
llvm-svn: 66867
2009-03-13 04:39:26 +00:00
Bill Wendling
02a239b837 Temporarily XFAIL this test.
llvm-svn: 66866
2009-03-13 04:37:11 +00:00
Bill Wendling
e22e99addb Put the assignment back at the top of this method.
llvm-svn: 66611
2009-03-11 00:03:50 +00:00
Bill Wendling
5f1261bf32 Make ivars private. Other cleanup. No functionality change.
llvm-svn: 66607
2009-03-10 23:57:09 +00:00
Bill Wendling
45ffb6a251 Just make the Dwarf timer group static inside of the getter function. No need to alloc/dealloc.
llvm-svn: 66591
2009-03-10 22:58:53 +00:00
Bill Wendling
3ebcbacf4e Don't put static functions in anonymous namespace.
llvm-svn: 66589
2009-03-10 22:36:31 +00:00
Bill Wendling
6a7265aeaa These should *stop* the timer, not start it again.
llvm-svn: 66586
2009-03-10 22:02:13 +00:00
Bill Wendling
1c78143120 - Fix misspelled method name.
- Remove unused method.

llvm-svn: 66585
2009-03-10 21:59:25 +00:00
Bill Wendling
30a55f9386 - Create GetOrCreateSourceID from getOrCreateSourceID. GetOrCreateSourceID is
the untimed version of getOrCreateSourceID. getOrCreateSourceID calls
  GetOrCreateSourceID, of course.

- Move some methods into the "private" section. Constify at least one method.

- General clean-ups.

llvm-svn: 66582
2009-03-10 21:47:45 +00:00
Bill Wendling
c0ffcaacf8 Refine the Dwarf writer timers so that they measure exception writing and debug
writing individually.

llvm-svn: 66577
2009-03-10 21:23:25 +00:00
Bill Wendling
4609f8d7c1 Add a timer to the DwarfWriter pass that measures the total time it takes to
emit exception and debug Dwarf info.

llvm-svn: 66571
2009-03-10 20:41:52 +00:00
Chris Lattner
03060f6d50 wire up support for emitting "special" values from inline asm
format strings with the standard ${:foo} syntax.

llvm-svn: 66527
2009-03-10 05:37:13 +00:00
Chris Lattner
7917d8fd89 just remove the use_empty() check entirely, the only reason it
existed was for llvm-gcc 3.4 (which used the __main hack) which 
is really really long dead.

llvm-svn: 66417
2009-03-09 08:18:48 +00:00
Chris Lattner
6b52b88467 Make the code generator rip of dead constant expr uses before deciding
whether a global is dead or not.  This should fix PR3749 - linker adds 
spurious use to appending globals.  I can't reasonably add a testcase
for this, because the bc writer/reader strip dead constant users.

llvm-svn: 66404
2009-03-09 05:52:15 +00:00
Bill Wendling
13fcab1ef3 Pass in a std::string when getting the names of debugging things. This cuts down
on the number of times a std::string is created and copied.

llvm-svn: 66396
2009-03-09 05:04:40 +00:00
Duncan Sands
5ab54d488f Introduce new linkage types linkonce_odr, weak_odr, common_odr
and extern_weak_odr.  These are the same as the non-odr versions,
except that they indicate that the global will only be overridden
by an *equivalent* global.  In C, a function with weak linkage can
be overridden by a function which behaves completely differently.
This means that IP passes have to skip weak functions, since any
deductions made from the function definition might be wrong, since
the definition could be replaced by something completely different
at link time.   This is not allowed in C++, thanks to the ODR
(One-Definition-Rule): if a function is replaced by another at
link-time, then the new function must be the same as the original
function.  If a language knows that a function or other global can
only be overridden by an equivalent global, it can give it the
weak_odr linkage type, and the optimizers will understand that it
is alright to make deductions based on the function body.  The
code generators on the other hand map weak and weak_odr linkage
to the same thing.

llvm-svn: 66339
2009-03-07 15:45:40 +00:00
Devang Patel
c908eb0dba It is possible that subprgoram definition is only encoding return value directly, instsad of an DIArray of all argument types.
llvm-svn: 65643
2009-02-27 18:05:21 +00:00
Devang Patel
2fd41ecef5 Print variable's display name in dwarf DIE.
llvm-svn: 65468
2009-02-25 19:41:35 +00:00
Evan Cheng
befebff8fc Clean up dwarf writer, part 1. This eliminated the horrible recursive getGlobalVariablesUsing and replaced it something readable. It eliminated use of slow UniqueVector and replaced it with StringMap, SmallVector, and DenseMap, etc. It also fixed some non-deterministic behavior.
This is a very minor compile time win.

llvm-svn: 65438
2009-02-25 07:04:34 +00:00
Bill Wendling
9d4eb136da Overhaul my earlier submission due to feedback. It's a large patch, but most of
them are generic changes.

- Use the "fast" flag that's already being passed into the asm printers instead
  of shoving it into the DwarfWriter.

- Instead of calling "MI->getParent()->getParent()" for every MI, set the
  machine function when calling "runOnMachineFunction" in the asm printers.

llvm-svn: 65379
2009-02-24 08:30:20 +00:00
Devang Patel
49b26ded5d gdb uses DW_AT_prototyped to identify K&R style in C based languages.
This fixes objc.dg/dwarf-prototypes.m scan-assembler DW_AT_prototyped from llvmgcc42 test suite.

llvm-svn: 65357
2009-02-24 00:52:19 +00:00
Devang Patel
98ea831c24 If there is not any debug info available for any global variables and any subprograms then there is not any debug info to emit.
llvm-svn: 65352
2009-02-24 00:02:15 +00:00
Anton Korobeynikov
5df82e3e25 Drop bunch of half-working stuff in the ext_weak linkage support.
Now we're using one gross, but quite robust hack :) (previous ones
did not work, for example, when ext_weak symbol was used deep inside
constant expression in the initializer).

The proper fix of this problem will require some quite huge asmprinter
changes and that's why was postponed. This fixes PR3629 by the way :)

llvm-svn: 65230
2009-02-21 11:53:32 +00:00
Bill Wendling
9e675be841 - Early exit a nested block.
- Correct comment.
- Whitespace changes.

llvm-svn: 65149
2009-02-20 20:40:28 +00:00
Bill Wendling
75751a4769 Add an accessor method to DwarfWriter to tell of debugging info should be emitted.
llvm-svn: 65092
2009-02-20 00:44:43 +00:00
Devang Patel
bf7153b721 The subprogram die may not exist while creating "default" scope.
llvm-svn: 64920
2009-02-18 17:29:38 +00:00
Devang Patel
25f2741ae9 The debugger sometimes lookup dynamically in the runtime to find ivar info of any Objective-C classes. It would be very helpful to debugger if the compiler encodes runtime version number in DWARF.
Add support for two additional DWARF attributes to encode Objective-C runtime version number.

llvm-svn: 64834
2009-02-17 22:43:44 +00:00
Devang Patel
1d4e0292fb Emit debug info for bitfields.
llvm-svn: 64815
2009-02-17 21:23:59 +00:00
Devang Patel
0cb3e1c047 Validate file id.
llvm-svn: 64204
2009-02-10 06:04:08 +00:00
Chris Lattner
d8f77bbc07 if we have a large GEP offset on a 32-bit or other target, make
sure to print the value properly sext'd to the right pointer size.
This fixes PR3481.

llvm-svn: 63843
2009-02-05 06:55:21 +00:00
Bill Wendling
3543edc608 More whitespace fixin'.
llvm-svn: 63663
2009-02-03 21:38:21 +00:00
Bill Wendling
716a4f7bfe Whitespace and comment changes. No functionality change.
llvm-svn: 63660
2009-02-03 21:17:20 +00:00
Devang Patel
7f2ea2d067 Do not add redundant arguments in a method definition DIE.
llvm-svn: 63527
2009-02-02 17:51:41 +00:00
Devang Patel
58511a356b Each input file is encoded as a separate compile unit in LLVM debugging
information output. However, many target specific tool chains prefer to encode
only one compile unit in an object file. In this situation, the LLVM code
generator will include  debugging information entities in the compile unit 
that is marked as main compile unit. The code generator accepts maximum one main
compile unit per module. If a module does not contain any main compile unit 
then the code generator will emit multiple compile units in the output object 
file.

[Part 1]

Update DebugInfo APIs to accept optional boolean value while creating DICompileUnit  to mark the unit as "main" unit. By defaults all units are considered  non-main.  Update SourceLevelDebugging.html to document "main" compile unit.

Update DebugInfo APIs to not accept and encode separate source file/directory entries while creating various llvm.dbg.* entities. There was a recent, yet to be documented, change to include this additional information so no documentation changes are required here.

Update DwarfDebug to handle "main" compile unit. If "main" compile unit is seen then all DIEs are inserted into "main" compile unit. All other compile units are used to find source location for llvm.dbg.* values. If there is not any "main" compile unit then create unique compile unit DIEs for each llvm.dbg.compile_unit.

[Part 2]

Create separate llvm.dbg.compile_unit for each input file. Mark compile unit create for main_input_filename as "main" compile unit. Use appropriate compile unit, based on source location information collected from the tree node, while creating llvm.dbg.* values using DebugInfo APIs.

---

This is Part 1.

llvm-svn: 63400
2009-01-30 18:20:31 +00:00
Sanjiv Gupta
e442452ade Enable emitting of constant values in non-default address space as well. The APIs emitting constants now take an additional parameter signifying the address space in which to emit. The APIs like getData8BitsDirective() etc are made virtual enabling targets to be able to define appropirate directivers for various sizes and address spaces.
llvm-svn: 63377
2009-01-30 04:25:10 +00:00
Devang Patel
270009c8ab Remove dead code, again.
llvm-svn: 63358
2009-01-30 01:27:49 +00:00
Devang Patel
180d237792 Remove dead code.
llvm-svn: 63357
2009-01-30 01:25:47 +00:00
Devang Patel
779653b60e Add DW_AT_declaration for class methods.
llvm-svn: 63356
2009-01-30 01:21:46 +00:00
Devang Patel
be2267211f Do not forget to derived type while constructing an array type.
llvm-svn: 63233
2009-01-28 21:08:20 +00:00
Duncan Sands
aee16d4916 Rename getAnalysisToUpdate to getAnalysisIfAvailable.
llvm-svn: 63198
2009-01-28 13:14:17 +00:00
Devang Patel
031a8a1ef5 Add type DIE into appropriate context DIE.
llvm-svn: 63154
2009-01-27 23:22:55 +00:00
Devang Patel
4353517ac4 Assorted debug info fixes.
- DW_AT_bit_size is only suitable for bitfields.
- Encode source location info for derived types.
- Source location and type size info is not useful for subroutine_type (info is included in respective DISubprogram) and array_type.

llvm-svn: 63077
2009-01-27 00:45:04 +00:00
Scott Michel
56fa9ba0b6 Make the Dwarf macro information section optional; CellSPU's assembler
doesn't support it. The default is set to 'true', so this should not
impact any other target backends.

llvm-svn: 63058
2009-01-26 22:32:51 +00:00
Devang Patel
d980abaae2 Introduce two DWARF attribute extentions DW_AT_APPLE_optimized, DW_AT_APPLE_flags.
DW_AT_APPLE_optimized flag is set when a compile_unit is optimized. The debugger takes advantage of this information some way.

DW_AT_APPLE_flags encodes command line options when certain env. variable is set. This is used by build engineers to track various gcc command lines used by by  a project, irrespective of whether the project used makefile, Xcode or something else.

llvm-gcc patch is next.

llvm-svn: 62888
2009-01-23 22:33:47 +00:00
Devang Patel
37b2017172 Empty DIType represents void. In this case no need to construct any type DIE.
llvm-svn: 62861
2009-01-23 19:13:31 +00:00
Devang Patel
86e54f5636 Code did not follow associated comment. not a good idea.
llvm-svn: 62828
2009-01-23 01:25:58 +00:00
Devang Patel
b638679d9d Set appropriate tag for the composite type.
llvm-svn: 62827
2009-01-23 01:19:09 +00:00
Chris Lattner
c843f0f484 do not sign extend characters input to isprint. This improves
compatibility with VC++.  Patch by Max Burke!

llvm-svn: 62813
2009-01-22 23:38:45 +00:00
Sanjiv Gupta
7173c05b38 Few targets like the tiny little PIC16 have only 16-bit pointers.
llvm-svn: 62763
2009-01-22 10:14:21 +00:00
Devang Patel
c129e798c7 Encode member accessibility.
llvm-svn: 62638
2009-01-21 00:08:04 +00:00
Devang Patel
bb4362571a Appropriately mark fowrad decls.
llvm-svn: 62625
2009-01-20 22:27:02 +00:00
Devang Patel
4c79c8be26 Fix struct member's debug info.
llvm-svn: 62610
2009-01-20 21:02:02 +00:00
Devang Patel
ccc3162f69 Need only one set of debug info versions enum.
llvm-svn: 62602
2009-01-20 19:22:03 +00:00
Devang Patel
10f2f03c68 Fix global variable's address in a DIE.
llvm-svn: 62596
2009-01-20 18:55:39 +00:00
Devang Patel
7f6ef3bdd6 Enable debug info for enums.
llvm-svn: 62594
2009-01-20 18:35:14 +00:00
Devang Patel
6bd9ebdef8 Enable debug info for composite types.
llvm-svn: 62589
2009-01-20 18:13:03 +00:00
Devang Patel
6a88f8849b Do not use DenseMap because the iterator is invalidated while constructing types. After all there was a reason why std::map was used initially!
llvm-svn: 62555
2009-01-20 00:58:55 +00:00
Devang Patel
7c2157602d Verify debug info.
llvm-svn: 62545
2009-01-19 23:21:49 +00:00
Devang Patel
4a7a53217b Remove tabs.
llvm-svn: 62423
2009-01-17 08:05:14 +00:00
Devang Patel
97cd6a4a7c Refactor code
llvm-svn: 62421
2009-01-17 08:01:33 +00:00
Devang Patel
2fc394ddfd Assign argument type to appropriate DIE.
llvm-svn: 62412
2009-01-17 06:57:25 +00:00
Devang Patel
24e250ee74 Remove dead code.
llvm-svn: 62410
2009-01-17 06:51:37 +00:00
Devang Patel
732220a09f Disable composite type debug info for now.
llvm-svn: 62406
2009-01-17 05:05:12 +00:00
Devang Patel
9ecd23c14d Fix comments.
llvm-svn: 62358
2009-01-16 21:07:53 +00:00
Devang Patel
6f83d4b68f Use lightweight DebugInfo objects directly.
llvm-svn: 62341
2009-01-16 19:28:14 +00:00
Devang Patel
627bb2afb9 Align source code.
llvm-svn: 62328
2009-01-16 18:01:58 +00:00
Mikhail Glushenkov
49be18cfc6 Registry.h should not depend on CommandLine.h.
Split Support/Registry.h into two files so that we have less to
recompile every time CommandLine.h is changed.

llvm-svn: 62312
2009-01-16 07:02:28 +00:00
Mikhail Glushenkov
5000223556 Delete trailing whitespace.
llvm-svn: 62307
2009-01-16 06:53:46 +00:00
Devang Patel
434239cc4f Validate debug info values only if DwarfDebug is initialized.
llvm-svn: 62298
2009-01-16 02:15:14 +00:00
Devang Patel
befef54e67 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
f0e1e4cc51 Do not stumble over forward declared struct member.
llvm-svn: 62288
2009-01-16 00:50:53 +00:00
Devang Patel
1ee58c7d8c Validate dbg_* intrinsics before lowering them.
llvm-svn: 62286
2009-01-15 23:41:32 +00:00
Rafael Espindola
0aba6c9435 Add the private linkage.
llvm-svn: 62279
2009-01-15 20:18:42 +00:00
Devang Patel
97d45c48c5 Use lightweight DebugInfo objects directly.
llvm-svn: 62276
2009-01-15 19:26:23 +00:00
Devang Patel
307fac7f3a 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
cf0db71b85 Do not construct debug scope if RootScope *is* null.
llvm-svn: 62209
2009-01-14 01:34:32 +00:00
Devang Patel
1da8253b35 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
ba388f3905 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
7a618394f6 Undo previous checkin.
llvm-svn: 62190
2009-01-13 22:54:57 +00:00
Devang Patel
e0f23e966d Use DwarfWriter to record dbg variables.
llvm-svn: 62185
2009-01-13 21:44:10 +00:00
Devang Patel
ab5ef6abf1 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
13a43a3789 Start using DebugInfo API to emit debug info.
llvm-svn: 62125
2009-01-13 00:20:51 +00:00
Devang Patel
68ef0f4ecb 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
4379343f92 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
283436f4b9 Avoid cast<>, use light weith wrapper directly.
llvm-svn: 62115
2009-01-12 22:58:14 +00:00
Devang Patel
261d3cb2af Use SrcLineInfo from DwarfWriter. The MachineModuleInfo copy will disappear soon.
llvm-svn: 62114
2009-01-12 22:54:42 +00:00
Duncan Sands
bcdbfb63dc Rename getABITypeSize to getTypePaddedSize, as
suggested by Chris.

llvm-svn: 62099
2009-01-12 20:38:59 +00:00
Devang Patel
27f9c78c56 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
149d412a0e Clear debug info at the end of function processing.
llvm-svn: 62092
2009-01-12 18:48:36 +00:00
Devang Patel
89a815941c 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
a350457725 Reduce initial small vector sizes.
llvm-svn: 62023
2009-01-10 02:42:49 +00:00
Devang Patel
77332761ef Fix thinko. Create parent scope if parent descriptor is *not* null.
llvm-svn: 62022
2009-01-10 02:34:18 +00:00
Misha Brukman
71c7e40966 Removed trailing whitespace from Makefiles.
llvm-svn: 61991
2009-01-09 16:44:42 +00:00
Devang Patel
747d4b38ad 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
97863f513c Add DebugInfo based APIs to record source line info.
llvm-svn: 61928
2009-01-08 17:19:22 +00:00
Devang Patel
3125e21ae4 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
0db006ea38 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
6c23870973 Set up DwarfDebug using DebugInfo API.
llvm-svn: 61822
2009-01-06 21:07:30 +00:00
Bill Wendling
0a611529e5 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
b06184d4a2 Construct subprogram DIEs using DebugInfo.
llvm-svn: 61772
2009-01-05 23:21:35 +00:00
Devang Patel
9f27e8354b Construct global variable DIEs using DebugInfo.
llvm-svn: 61771
2009-01-05 23:11:11 +00:00
Devang Patel
7d98385702 Construct compile unit dies using DebugInfo.
llvm-svn: 61768
2009-01-05 23:03:32 +00:00
Bill Wendling
891f9abdbb 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
dc395b96fb 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
b54d136d11 Add type DIEs using DebugInfo.
llvm-svn: 61757
2009-01-05 21:47:57 +00:00
Devang Patel
94ba049403 Construct composite type DIE using DebugInfo.
llvm-svn: 61741
2009-01-05 19:55:51 +00:00
Devang Patel
beb5774035 s/ConstructType/ConstructTypeDIE/g
llvm-svn: 61731
2009-01-05 19:07:53 +00:00
Devang Patel
c1998b026f Construct stuct field DIEs.
llvm-svn: 61729
2009-01-05 18:59:44 +00:00
Devang Patel
de65ed6370 Construct enumerator DIE using DebugInfo.
llvm-svn: 61726
2009-01-05 18:38:38 +00:00
Devang Patel
c4c51439bf Construct array/vector type DIEs using DebugInfo.
llvm-svn: 61724
2009-01-05 18:33:01 +00:00
Devang Patel
38d7f4dc2c Construct basic and derived type DIEs using DebugInfo.
llvm-svn: 61714
2009-01-05 17:57:47 +00:00
Devang Patel
bf19721647 subsume ConstructPointerType()
llvm-svn: 61711
2009-01-05 17:45:59 +00:00
Devang Patel
24288bc651 subsume ConstructBasicType().
llvm-svn: 61709
2009-01-05 17:44:11 +00:00
Bill Wendling
067c48f7a6 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
4749654506 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
044248aad1 Darwin likes for the EH frame to be non-local.
llvm-svn: 61420
2008-12-24 08:05:17 +00:00
Bill Wendling
6add893a14 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
1a9c404ed2 Fix typo.
Silence unused variable warning.

llvm-svn: 61391
2008-12-23 21:55:38 +00:00
Dan Gohman
fd906f6a07 Refactor a bunch of code out of AsmPrinter::EmitGlobalConstant into separate
functions.

llvm-svn: 61345
2008-12-22 21:14:27 +00:00
Rafael Espindola
7593f0004f 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
5b7938b1cc Do not print empty DW_AT_comp_dir.
llvm-svn: 60965
2008-12-12 21:57:54 +00:00
Evan Cheng
9419dfe08a 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
92299e0722 Cosmetic changes.
llvm-svn: 60771
2008-12-09 17:56:30 +00:00
Rafael Espindola
0c800cf35e Fix bug 3140.
Print a single parameter .file directive if we have an ELF target.

llvm-svn: 60480
2008-12-03 11:01:37 +00:00
Anton Korobeynikov
ba74a11c9b Make a convenient helper for printing offsets.
llvm-svn: 59872
2008-11-22 16:15:34 +00:00
Chris Lattner
ed6022f676 eliminate a couple more uses of utohexstr.
llvm-svn: 58963
2008-11-10 04:35:24 +00:00
Chris Lattner
1185c9a72c Use utohex_buffer instead of utohexstr to avoid creating a temporary
string in the .ll and .s printers.

llvm-svn: 58962
2008-11-10 04:30:26 +00:00
Anton Korobeynikov
a4933e408d Temporary revert my last commit: it seems it's triggering some subtle bug in backend
and breaks llvm-gcc

llvm-svn: 58926
2008-11-08 23:05:05 +00:00
Anton Korobeynikov
e3b9284fa8 Factor out offset printing code into generic AsmPrinter.
FIXME: it seems, that most of targets don't support
offsets wrt CPI/GlobalAddress', was it intentional?

llvm-svn: 58917
2008-11-08 17:21:38 +00:00
Bill Wendling
39b0625fe0 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
0c6ea38b92 Remove some overzealous checks that were rejecting
valid comments in inline assembly.
gcc.target/i386/20011009-1.c

llvm-svn: 57365
2008-10-10 21:04:42 +00:00
Dale Johannesen
075a62519f Add a "loses information" return value to APFloat::convert
and APFloat::convertToInteger.  Restore return value to
IEEE754.  Adjust all users accordingly.

llvm-svn: 57329
2008-10-09 23:00:39 +00:00
Dale Johannesen
9e57068854 Rename APFloat::convertToAPInt to bitcastToAPInt to
make it clearer what the function does.  No functional
change.

llvm-svn: 57325
2008-10-09 18:53:47 +00:00
Dale Johannesen
9c6ffd55b4 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
30c5ce1b7d 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
bf75299f0a 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
ccd9174b23 Use helper
llvm-svn: 56584
2008-09-24 22:21:04 +00:00
Anton Korobeynikov
f465171596 SmallPtrSet will be better
llvm-svn: 56583
2008-09-24 22:20:46 +00:00
Anton Korobeynikov
f95cbd4834 Use generic section-handling stuff to emit constant pool entries
llvm-svn: 56579
2008-09-24 22:17:59 +00:00
Anton Korobeynikov
dca16f3acf Get rid of duplicate char*/Section* DataSection
llvm-svn: 56575
2008-09-24 22:16:16 +00:00