Commit Graph

507 Commits

Author SHA1 Message Date
Devang Patel
70d75ca310 "Attach debug info with llvm instructions" mode was enabled a month ago. Now make it permanent and remove old way of inserting intrinsics to encode debug info for line number and scopes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87014 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12 19:02:56 +00:00
Bill Wendling
73b5551058 Don't mark a call as potentially throwing if the function it's calling has the
"nounwind" attribute.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86897 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 23:17:02 +00:00
Devang Patel
3380cc5307 If doesSupportDebugInformation() is false then do not try to emit dwarf debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86874 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 19:55:08 +00:00
Daniel Dunbar
c032679d3e Fix -Asserts warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86794 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 03:09:50 +00:00
Bill Wendling
ee161a6824 Make sure that the exception handling data has the same visibility as the
function it's generated for.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86779 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 01:24:59 +00:00
Devang Patel
39ae3ff6d1 Do not assume first function scope seen represents current function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86771 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 00:31:36 +00:00
Devang Patel
2f105c6e18 While creating DbgScopes, do not forget parent scope.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86763 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11 00:18:40 +00:00
Devang Patel
fb0ee43438 Ignore variable if scope info is not available.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86753 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 23:20:04 +00:00
Devang Patel
53bb5c95af Implement support to debug inlined functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86748 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 23:06:00 +00:00
Jeffrey Yasskin
81cf432569 Fix DenseMap iterator constness.
This patch forbids implicit conversion of DenseMap::const_iterator to
DenseMap::iterator which was possible because DenseMapIterator inherited
(publicly) from DenseMapConstIterator. Conversion the other way around is now
allowed as one may expect.

The template DenseMapConstIterator is removed and the template parameter
IsConst which specifies whether the iterator is constant is added to
DenseMapIterator.

Actually IsConst parameter is not necessary since the constness can be
determined from KeyT but this is not relevant to the fix and can be addressed
later.

Patch by Victor Zverovich!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86636 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-10 01:02:17 +00:00
Bob Wilson
c0ef244499 Fix comment typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86295 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-06 22:38:38 +00:00
Devang Patel
84c73e9b82 Do not bother to emit debug info for nameless global variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86259 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-06 17:58:12 +00:00
Devang Patel
465c3bed16 Do not try to emit debug info entry for dead global variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86212 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-06 01:30:04 +00:00
Dan Gohman
40c57860da Factor out the printing of the leading tab into printInlineAsm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86199 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-06 00:04:54 +00:00
Dan Gohman
568a3be545 Fix the label name generation for address-taken labels to avoid potential
problems with name collisions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86189 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-05 23:14:35 +00:00
Devang Patel
61ecbd196c While calculating original type size for a derived type, handle type variants encoded as DIDerivedType appropriately.
This improves bitfield support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86073 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 23:48:00 +00:00
Devang Patel
33db508283 Fix DW_AT_data_member_location for bit-fields. It points to the location of annonymous field that covers respective field.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86054 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 22:06:12 +00:00
Devang Patel
c416d3b25d Array element size does not match array size but array is not a bitfield.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86043 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 19:37:40 +00:00
Jakob Stoklund Olesen
ad68264f59 Print out an informative comment for KILL instructions.
The KILL pseudo-instruction may survive to the asm printer pass, just like the IMPLICIT_DEF. Print the KILL as a comment instead of just leaving a blank line in the output.

With -asm-verbose=0, a blank line is printed, like IMPLICIT?DEF.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86041 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-04 19:24:37 +00:00
Devang Patel
1b845976d0 Ignore unnamed variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85909 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 18:30:27 +00:00
Jeffrey Yasskin
36d52bf4df Fix a funky "declared with greater visibility than the type of its field"
warning from gcc by removing VISIBILITY_HIDDEN attributes.  


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85873 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-03 06:29:36 +00:00
Dan Gohman
b953c944b6 Fix a missing newline in the dwarf output code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85684 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-31 20:59:09 +00:00
Dan Gohman
6a55e62996 Add support for BlockAddress static initializers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85562 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-30 01:45:18 +00:00
Dan Gohman
6ae5b32e48 Add a FIXME comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85559 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-30 01:38:20 +00:00
Dan Gohman
b1cac33856 Add some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85558 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-30 01:34:35 +00:00
Dan Gohman
8c2b52552c Initial target-independent CodeGen support for BlockAddresses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85556 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-30 01:27:03 +00:00
Devang Patel
bdf45cbe15 Do not held on to DenseMap slot accross map insertion. The insertion may cause the map to grow rending the slot invalid.
Use this opportunity to use ValueMap instead of DenseMap.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85298 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 20:47:17 +00:00
Nick Lewycky
f5a86f45e7 Remove includes of Support/Compiler.h that are no longer needed after the
VISIBILITY_HIDDEN removal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85043 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 06:57:41 +00:00
Nick Lewycky
6726b6d75a Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.
Chris claims we should never have visibility_hidden inside any .cpp file but
that's still not true even after this commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85042 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 06:33:48 +00:00
Bill Wendling
48dc29ef91 Tidying up some code and comments. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84894 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-22 20:48:59 +00:00
Devang Patel
808b82664f Do not emit name entry for a pointer type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84276 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 21:27:43 +00:00
Devang Patel
149aa7cce3 If there is not any llvm instruction associated with each lexical scope encoded in debug info then create such scope on demand for variable info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84262 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 18:18:03 +00:00
Devang Patel
c90aefe95e Add support to record DbgScope as inlined scope.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84134 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 21:08:09 +00:00
Devang Patel
1619dc3b9e s/DebugLoc.CompileUnit/DebugLoc.Scope/g
s/DebugLoc.InlinedLoc/DebugLoc.InlinedAtLoc/g



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84054 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 23:28:53 +00:00
Daniel Dunbar
6e4bdfc229 Fix a -Asserts warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83950 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 06:47:08 +00:00
Devang Patel
6ef7517314 Find enclosing subprogram info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83922 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-12 23:11:24 +00:00
Devang Patel
ac1ceb3dd3 Extract scope information from the variable itself, instead of relying on alloca or llvm.dbg.declare location.
While recording beginning of a function, use scope info from the first location entry instead of just relying on first location entry itself.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83684 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-09 22:42:28 +00:00
Devang Patel
c525472828 Check invalid debug info for enums. This may happen when underlyng enum is optimized away. Eventually DwarfChecker will clean this up during llvm verification stage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83655 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-09 17:51:49 +00:00
Devang Patel
eda312193d Do not record line number to implicitly mark start of function if function has arguments. Extra line number entries trip gdb in some cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83563 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 18:48:03 +00:00
Devang Patel
60b35bd8ec Add support to handle debug info attached to an instruction.
This is not yet enabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83400 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 18:37:31 +00:00
Dan Gohman
e3cc3f3c84 Instead of printing unnecessary basic block labels as labels in
verbose-asm mode, print comments instead. This eliminates a non-comment
difference between verbose-asm mode and non-verbose-asm mode.

Also, factor out the relevant code out of all the targets and into
target-independent code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83392 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 17:38:38 +00:00
Devang Patel
8a4087ddc7 Fix cut-n-pasto.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83367 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 03:15:38 +00:00
Devang Patel
af0e272683 Update processDebugLoc() so that it can be used to process debug info before and after printing an instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83363 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 02:19:11 +00:00
Devang Patel
89703cf838 Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83362 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 02:01:32 +00:00
Devang Patel
0d20ac8d17 Add utility routine to set begin and end labels for DbgScopes.
This will be used by processDebugLoc().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83361 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 01:50:42 +00:00
Devang Patel
b39566d719 Remove unintentional function decl.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83356 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 01:31:35 +00:00
Devang Patel
e717faa467 Add utility routine to collect variable debug info. This is not yet used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83355 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 01:26:37 +00:00
Devang Patel
6f3dc920b0 Existence of a compile unit for input source file is a good indicator to check debug info's presence in a module.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83348 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 00:03:14 +00:00
Devang Patel
ffd9c3dd4a If subprogram die is not available then construct new one.
This can happen if debug info is processed lazily.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83347 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 23:59:00 +00:00
Devang Patel
fd07cf56cd 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83344 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 23:40:42 +00:00