Devang Patel
20b2a77765
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
4598eb6214
Add support to handle debug info attached to an instruction.
...
This is not yet enabled.
llvm-svn: 83400
2009-10-06 18:37:31 +00:00
Devang Patel
7d838bb66e
Fix cut-n-pasto.
...
llvm-svn: 83367
2009-10-06 03:15:38 +00:00
Devang Patel
2980a22028
Remove dead code.
...
llvm-svn: 83362
2009-10-06 02:01:32 +00:00
Devang Patel
8db360da7b
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
475d32a987
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
d859d86538
Existence of a compile unit for input source file is a good indicator to check debug info's presence in a module.
...
llvm-svn: 83348
2009-10-06 00:03:14 +00:00
Devang Patel
1c9eef72b4
If subprogram die is not available then construct new one.
...
This can happen if debug info is processed lazily.
llvm-svn: 83347
2009-10-05 23:59:00 +00:00
Devang Patel
4c420eca41
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
4144a82154
Set address while constructing DIE.
...
llvm-svn: 83343
2009-10-05 23:22:08 +00:00
Devang Patel
2089d16140
Gracefully handle various scopes while recording source line info.
...
llvm-svn: 83317
2009-10-05 18:03:19 +00:00
Devang Patel
75cc16c0f2
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
787f94c28d
Record first and last instruction of a scope in DbgScope.
...
llvm-svn: 83207
2009-10-01 18:25:23 +00:00
Devang Patel
3256c751f5
Use MDNode * directly as an RecordSourceLine() argument.
...
llvm-svn: 83182
2009-09-30 22:51:28 +00:00
Mike Stump
14cf8ecf0b
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
b296942f6d
Remove std::string uses from DebugInfo interface.
...
llvm-svn: 83083
2009-09-29 18:40:58 +00:00
Mike Stump
944fa25934
Delete space after function name, before (, reflow a comment and
...
delete a few blank lines.
llvm-svn: 82729
2009-09-24 23:21:26 +00:00
Mike Stump
d6f9a2f90b
Fix spacing.
...
llvm-svn: 82727
2009-09-24 23:11:08 +00:00
Mike Stump
8808063181
This is overly constraining with respect to clang.
...
llvm-svn: 82591
2009-09-23 00:13:30 +00:00
Daniel Dunbar
be22ec4cfc
Fix indentation.
...
llvm-svn: 82333
2009-09-19 20:40:14 +00:00
Daniel Dunbar
c418d6b106
Strip trailing whitespace.
...
llvm-svn: 82332
2009-09-19 20:40:05 +00:00
Chris Lattner
dd5a989034
eliminate the horrid AsmPrinter::getGlobalLinkName method, inlining
...
it into all of its call sites and simplifying them.
llvm-svn: 81962
2009-09-16 00:08:41 +00:00
Caroline Tice
183a519771
Don't generate Dwarf line table entries for source line 0.
...
llvm-svn: 81542
2009-09-11 18:25:54 +00:00
Chris Lattner
321bc99a74
remove DebugLoc from MCInst and eliminate "Comment printing" from
...
the MCInst path of the asmprinter. Instead, pull comment printing
out of the autogenerated asmprinter into each target that uses the
autogenerated asmprinter. This causes code duplication into each
target, but in a way that will be easier to clean up later when more
asmprinter stuff is commonized into the base AsmPrinter class.
This also fixes an xcore strangeness where it inserted two tabs
before every instruction.
llvm-svn: 81396
2009-09-09 23:14:36 +00:00
Devang Patel
f5d5360065
Ignore malformed global variable debug info.
...
llvm-svn: 81055
2009-09-04 23:59:07 +00:00
Devang Patel
b2de5fa689
Subprogram is a scope. Derive DISubprogram from DIScope.
...
llvm-svn: 80637
2009-08-31 22:47:13 +00:00
Devang Patel
869529c58c
Rename DIBlock as DILexicalBlock.
...
llvm-svn: 80633
2009-08-31 22:00:15 +00:00
Caroline Tice
c87c1e2cfd
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
9fda4bd998
Simplify isDerivedType() and other predicate interface.
...
llvm-svn: 80602
2009-08-31 18:49:10 +00:00
Devang Patel
80ae34974b
Reapply 79977.
...
Use MDNodes to encode debug info in llvm IR.
llvm-svn: 80406
2009-08-28 23:24:31 +00:00
Devang Patel
3082c01d68
Closure is a very generic name. Use AppleBlock instead.
...
llvm-svn: 80307
2009-08-27 23:51:51 +00:00
Devang Patel
f08e35d9dc
Revert 79977. It causes llvm-gcc bootstrap failures on some platforms.
...
llvm-svn: 80073
2009-08-26 05:01:18 +00:00
Devang Patel
a1b4dd96f2
Add isClosure() predicate. This is used to add DW_AT_APPLE_block attribute.
...
Patch by Caroline Tice.
llvm-svn: 80061
2009-08-26 00:39:50 +00:00
Devang Patel
02aac922b4
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
06fa176862
prune the #includes in raw_ostream.h by moving a
...
member out of line. ftostr is not particularly speedy,
so that method is presumably not perf sensitive.
llvm-svn: 79885
2009-08-24 03:52:50 +00:00
Chris Lattner
c521f54198
Prune #includes from llvm/Linker.h and llvm/System/Path.h,
...
forcing them down into various .cpp files.
This change also:
1. Renames TimeValue::toString() and Path::toString() to ::str()
for similarity with the STL.
2. Removes all stream insertion support for sys::Path, forcing
clients to call .str().
3. Removes a use of Config/alloca.h from bugpoint, using smallvector
instead.
4. Weans llvm-db off <iostream>
sys::Path really needs to be gutted, but I don't have the desire to
do it at this point.
llvm-svn: 79869
2009-08-23 22:45:37 +00:00
Chris Lattner
81e8e02e2f
remove some random indentation stuff, yay for efficiency.
...
llvm-svn: 79797
2009-08-23 00:51:00 +00:00
Chris Lattner
e9a75a6654
rename TAI -> MAI, being careful not to make MAILJMP instructions :)
...
llvm-svn: 79777
2009-08-22 21:43:10 +00:00
Chris Lattner
7b26fce23e
Rename TargetAsmInfo (and its subclasses) to MCAsmInfo.
...
llvm-svn: 79763
2009-08-22 20:48:53 +00:00
Devang Patel
0939595711
Record variable debug info at ISel time directly.
...
llvm-svn: 79742
2009-08-22 17:12:53 +00:00
David Greene
829b3e8b14
Add missing includes.
...
llvm-svn: 79473
2009-08-19 21:52:55 +00:00
Chris Lattner
4b7dadb76e
eliminate AsmPrinter::SwitchToSection and just have clients
...
talk to the MCStreamer directly instead.
llvm-svn: 79405
2009-08-19 05:49:37 +00:00
Devang Patel
f691df3536
Do not completely skip subrange info for a zero sized array.
...
llvm-svn: 79044
2009-08-14 20:59:16 +00:00
Chris Lattner
591105c540
sink the 'name' and 'isdirective' state out of MCSection into its derived classes.
...
This totally optimizes PIC16 sections by not having an 'isdirective' bit anymore!! ;-)
llvm-svn: 78517
2009-08-08 23:39:42 +00:00
Chris Lattner
8ce12538c1
eliminate CurrentSection, rename CurrentSection_ -> CurrentSection, make it private,
...
eliminate IsInTextSection.
llvm-svn: 78017
2009-08-03 23:20:21 +00:00
Chris Lattner
1472cf5b3f
move dwarf debug info section selection stuff from TAI to
...
TLOF, unifying all the dwarf targets at the same time.
llvm-svn: 77889
2009-08-02 07:24:22 +00:00
Chris Lattner
4d2c0f9008
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
6352444635
Start using DebugInfoFinder.
...
llvm-svn: 77621
2009-07-30 18:56:46 +00:00
Chris Lattner
5e693ed07b
Rip all of the global variable lowering logic out of TargetAsmInfo. Since
...
it is highly specific to the object file that will be generated in the end,
this introduces a new TargetLoweringObjectFile interface that is implemented
for each of ELF/MachO/COFF/Alpha/PIC16 and XCore.
Though still is still a brutal and ugly refactoring, this is a major step
towards goodness.
This patch also:
1. fixes a bunch of dangling pointer problems in the PIC16 backend.
2. disables the TargetLowering copy ctor which PIC16 was accidentally using.
3. gets us closer to xcore having its own crazy target section flags and
pic16 not having to shadow sections with its own objects.
4. fixes wierdness where ELF targets would set CStringSection but not
CStringSection_. Factor the code better.
5. fixes some bugs in string lowering on ELF targets.
llvm-svn: 77294
2009-07-28 03:13:23 +00:00
Daniel Dunbar
6115b39ffd
Remove Value::getName{Start,End}, the last of the old Name APIs.
...
llvm-svn: 77152
2009-07-26 09:48:23 +00:00
Devang Patel
f281bf803e
Skip special LLVM prefix '1' while emitting linknage name.
...
This prefix is used by LLVM to inform the asm printer to not emit usual global symbol prefix before the symbol name.
llvm-svn: 75875
2009-07-16 01:01:22 +00:00
Chris Lattner
f34815b32f
Change the internal interface to makeNameProper to take a bool that
...
indicates whether the label is private or not, instead of taking
prefix stuff. One effect of this is that symbols will be generated
with *just* the private prefix, instead of both the private prefix
*and* the user-label-prefix, but this doesn't matter as long as it
is consistent. For example we'll now get "Lfoo" instead of "L_foo".
These are just assembler temporary labels anyway, so they never even
make it into the .o file.
llvm-svn: 75607
2009-07-14 04:50:12 +00:00
Devang Patel
cdfc858ec0
Do not use Mangler to remove '1' from linkage name.
...
llvm-svn: 75574
2009-07-14 00:55:28 +00:00
Devang Patel
9efced9817
Use assertion.
...
llvm-svn: 75540
2009-07-13 22:46:19 +00:00
Devang Patel
9d582d1782
Use AsmPrinter's Mangler to remove leading '1' from linkage names.
...
llvm-svn: 75515
2009-07-13 21:48:26 +00:00
Devang Patel
b4c9579e69
revert rev. 75503 for now.
...
llvm-svn: 75507
2009-07-13 21:26:33 +00:00
Devang Patel
31b3d7b53f
Use Mangler to remove leading '1' from linkage names.
...
llvm-svn: 75503
2009-07-13 21:19:56 +00:00
Devang Patel
14fd73b08d
Accidently dropped this while removing dead code in previous commit.
...
llvm-svn: 74953
2009-07-07 21:55:14 +00:00
Devang Patel
270d747359
Remove dead code.
...
llvm-svn: 74949
2009-07-07 21:12:32 +00:00
Devang Patel
0a9f9759a3
Struct types are described using field types only.
...
llvm-svn: 74477
2009-06-29 23:46:50 +00:00
Devang Patel
40d784180b
s/MainCU/ModuleCU/g
...
llvm-svn: 74452
2009-06-29 20:45:18 +00:00
Devang Patel
8635345d8a
Multiple DW_TAG_compile_unit is not used, afaict, on any target.
...
Update dwarf writer to only emit one DW_TAG_compile_unit per .o file.
llvm-svn: 74449
2009-06-29 20:38:13 +00:00
Devang Patel
0751a28888
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
Devang Patel
0c044ecdb0
Simplify.
...
llvm-svn: 74215
2009-06-25 22:36:02 +00:00
Owen Anderson
9becc183e1
Down with statics!
...
llvm-svn: 74134
2009-06-24 22:53:20 +00:00
Chris Lattner
09081b25a5
simplify macro debug info directive handling.
...
llvm-svn: 73736
2009-06-18 23:31:37 +00:00
Devang Patel
14491abe48
Use MainCU if it is available.
...
llvm-svn: 73457
2009-06-16 02:09:30 +00:00
Devang Patel
56e6fe1642
Gracefully handle imbalanced inline function begin and end markers.
...
llvm-svn: 73426
2009-06-15 21:45:50 +00:00
Devang Patel
64e6529e76
llvm.dbg.region.end() intrinsic is not required to be in _last_ basic block in a function. If that happens then any basic block that follows (lexically) the block with regin.end will not have scope info available. LexicalScopeStack relies on processing basic block in CFG order, but this processing order is not guaranteed. Things get complicated when the optimizer gets a chance to optimizer IR with dbg intrinsics.
...
Apply defensive patch to preserve at least one lexical scope till the end of function.
llvm-svn: 73282
2009-06-13 02:16:18 +00:00
Devang Patel
c1fee72162
Clear AbstractInstanceRootMap at the end of the function.
...
llvm-svn: 73244
2009-06-12 19:24:05 +00:00
Dan Gohman
d9ef48a73e
Remove some unnecessary #includes.
...
llvm-svn: 72948
2009-06-05 16:32:58 +00:00
Bill Wendling
5ea3e9db43
Accidental commit. This isn't ready for prime time just yet.
...
llvm-svn: 72699
2009-06-01 20:18:46 +00:00
Bill Wendling
09f17a8479
Untabification.
...
llvm-svn: 72604
2009-05-30 01:09:53 +00:00
Bill Wendling
8658bb565d
Minor code cleanup. No functionality change.
...
llvm-svn: 72198
2009-05-20 23:31:45 +00:00
Bill Wendling
744668d5af
Merge 'ConstructFunctionDbgScope' and 'ConstructAbstractDbgScope'.
...
llvm-svn: 72197
2009-05-20 23:28:48 +00:00
Bill Wendling
bcad77a8d5
Rename 'New*' methods to 'Create*' to be consistent. 'NewString' isn't used.
...
llvm-svn: 72196
2009-05-20 23:24:48 +00:00
Bill Wendling
806535f908
Add comment for emit section.
...
llvm-svn: 72195
2009-05-20 23:22:40 +00:00
Bill Wendling
480ff32120
Move 'Emit' methods down to their own place.
...
llvm-svn: 72194
2009-05-20 23:21:38 +00:00
Bill Wendling
2b128d70c5
Revert r72192. It was causing a build failure.
...
llvm-svn: 72193
2009-05-20 23:19:06 +00:00
Bill Wendling
8d7533d3e5
Do some mechanical changes. Combine the 'construct abastract dbg thingy' in with
...
the 'constract function dbg thingy'. Rename some methods to make them consistent
with the rest of the methods. Move the 'Emit' methods to the end of the file.
llvm-svn: 72192
2009-05-20 23:04:56 +00:00
Bill Wendling
ec78f1516d
Don't set the "location" information for inlined functions' variables.
...
llvm-svn: 72064
2009-05-18 23:08:55 +00:00
Bill Wendling
1992f86733
Small code cleanup.
...
llvm-svn: 72057
2009-05-18 22:33:01 +00:00
Bill Wendling
bc308569a3
RecordVariable is called each time a DECLARE node is encountered. For an inlined
...
function, this could be many, many times. We don't want to re-add variables to
that DIE for each time. We just want to add them once. Check to make sure that
we haven't added them already.
llvm-svn: 72047
2009-05-18 22:02:36 +00:00
Bill Wendling
2f921f82e4
Split out the DwarfDebug module from the DwarfWriter module.
...
Again, no intendtional functionality change.
llvm-svn: 71854
2009-05-15 09:23:25 +00:00