Commit Graph

232 Commits

Author SHA1 Message Date
Devang Patel 7973e78800 Update DebugInfoFinder to match recent debug info encoding changes.
llvm-svn: 142295
2011-10-17 22:30:34 +00:00
Eric Christopher 6647b83087 Add a new wrapper node for a DILexicalBlock that encapsulates it and a
file. Since it should only be used when necessary propagate it through
the backend code generation and tweak testcases accordingly.

This helps with code like in clang's test/CodeGen/debug-info-line.c where
we have multiple #line directives within a single lexical block and want
to generate only a single block that contains each file change.

Part of rdar://10246360

llvm-svn: 141729
2011-10-11 22:59:11 +00:00
Devang Patel 04d6d47865 Add support to emit debug info for C++0x nullptr type.
llvm-svn: 139751
2011-09-14 23:13:28 +00:00
Devang Patel 5ea5d7965b Now, named mdnode llvm.dbg.cu keeps track of all compile units in a module. Update DebugInfoFinder to collect compile units from llvm.dbg.cu.
llvm-svn: 139147
2011-09-06 17:40:08 +00:00
Devang Patel df060bc3c2 After r138010, subroutine type does not have context info. Update type verifier accordingly.
This fixes ptype.exp gdb testsuite regressions.

llvm-svn: 138869
2011-08-31 18:04:31 +00:00
Devang Patel 59e27c5f12 Do not use named md nodes to track variables that are completely optimized. This does not scale while doing LTO with debug info. New approach is to include list of variables in the subprogram info directly.
llvm-svn: 138145
2011-08-19 23:28:12 +00:00
Devang Patel eb1bb4e419 Until now all debug info MDNodes referred to a root MDNode, a compile unit. This simplified handling of these needs in dwarf writer. However, one side effect of this is that during link time optimization all these MDNodes are _not_ uniqued. In other words there will be N number of MDNodes describing "int", "char" and all other types, which would suddenly grow when each object file starts using libraries like STL.
MDNodes graph structure such that compiler unit keeps track of important MDNodes and update dwarf writer to process mdnodes top-down instead of bottom up.

llvm-svn: 137778
2011-08-16 22:09:43 +00:00
Devang Patel dfd6ec3ce1 Refactor. Global variables are part of compile unit so let CompileUnit create new global variable.
llvm-svn: 137621
2011-08-15 17:57:41 +00:00
Devang Patel bb23a4a9a5 Distinguish between two copies of one inlined variable. Take 2.
llvm-svn: 137253
2011-08-10 21:50:54 +00:00
Devang Patel 3d6e38942d Provide method to print variable's extended name which includes inline location.
llvm-svn: 137095
2011-08-09 01:03:14 +00:00
Chandler Carruth 81b7e11c89 Temporarily revert r135528 which distinguishes between two copies of one
inlined variable, based on the discussion in PR10542.

This explodes the runtime of several passes down the pipeline due to
a large number of "copies" remaining live across a large function. This
only shows up with both debug and opt, but when it does it creates
a many-minute compile when self-hosting LLVM+Clang. There are several
other cases that show these types of regressions.

All of this is tracked in PR10542, and progress is being made on fixing
the issue. Once its addressed, the re-instated, but until then this
restores the performance for self-hosting and other opt+debug builds.

Devang, let me know if this causes any trouble, or impedes fixing it in
any way, and thanks for working on this!

llvm-svn: 136953
2011-08-05 00:51:31 +00:00
Devang Patel 8fb9fd6769 There are two ways to map a variable to its lexical scope. Lexical scope information is embedded in MDNode describing the variable. It is also available as a part of DebugLoc attached with DBG_VALUE instruction. DebugLoc attached with an instruction is less reliable in optimized code so use information embedded in the MDNode.
llvm-svn: 135629
2011-07-20 22:18:50 +00:00
Devang Patel a59b24b090 Distinguish between two copies of one inlined variable.
llvm-svn: 135528
2011-07-19 22:31:15 +00:00
Devang Patel cfa82a378d Reapply r135457. This needs llvm-gcc change, that I forgot to check-in yesterday.
llvm-svn: 135504
2011-07-19 19:41:54 +00:00
Bob Wilson da30cf84c3 Revert "Make a provision to encode inline location in a variable. This will enable dwarf writer to easily distinguish between two instances of a inlined variable in one basic block."
This reverts commit 9fec5e346efdf744b151ae6604f912908315fa7a.

llvm-svn: 135486
2011-07-19 16:32:50 +00:00
Devang Patel ac532dedf1 Make a provision to encode inline location in a variable. This will enable dwarf writer to easily distinguish between two instances of a inlined variable in one basic block.
llvm-svn: 135457
2011-07-19 01:03:32 +00:00
Benjamin Kramer 9319e9c5d8 Simplify code. No functionality change.
llvm-svn: 133351
2011-06-18 14:42:42 +00:00
Duncan Sands bf577d6a86 Remove DIFactory. Patch by Devang.
llvm-svn: 126871
2011-03-02 20:30:37 +00:00
Devang Patel 4ab0852080 Move DbgInfoPrinter specific utlities inside DbgInfoPrinter.cpp
llvm-svn: 125571
2011-02-15 17:36:11 +00:00
Devang Patel 27924da676 Print function info. Patch by Minjang Kim.
llvm-svn: 125567
2011-02-15 17:24:56 +00:00
Devang Patel df0dd7dc69 Fix typo in comment.
llvm-svn: 124759
2011-02-03 00:13:47 +00:00
Devang Patel be933b470a Add support to describe template value parameter in debug info.
llvm-svn: 124755
2011-02-02 22:35:53 +00:00
Devang Patel 3a9e65efb6 Add support to describe template parameter type in debug info.
llvm-svn: 124752
2011-02-02 21:38:25 +00:00
Devang Patel 81c3c87717 Add support to create class type.
llvm-svn: 121279
2010-12-08 20:18:20 +00:00
Devang Patel 89ea4f27a8 Add support to create vector, array, enums etc...
llvm-svn: 121224
2010-12-08 01:50:15 +00:00
Devang Patel 746660fc7b Add support to create variables, structs etc.. using DIBuilder.
This is still work in progress.

llvm-svn: 121205
2010-12-07 23:25:47 +00:00
Jakob Stoklund Olesen 8bdfb0c166 Also inore '()' while creating mdnode name from ObjC symbol name.
llvm-svn: 120856
2010-12-03 23:40:45 +00:00
Devang Patel f0227ccf3f Ignore '+' while creating mdnode name from ObjC symbol name.
llvm-svn: 120853
2010-12-03 23:29:30 +00:00
Devang Patel 364bf04267 Take care of special characters while creating named MDNode name to hold function specific local variable's info.
This fixes radar 8653152. I am checking in testcase as a separate check-in.

llvm-svn: 118726
2010-11-10 22:19:21 +00:00
Devang Patel 415c551459 Fix DIType verifier. The element 3 is DIFile now.
llvm-svn: 118054
2010-11-02 20:41:13 +00:00
Devang Patel 9a33ec24eb Add support for DW_TAG_unspecified_parameters.
llvm-svn: 115833
2010-10-06 20:50:40 +00:00
Devang Patel bea08d1c85 Let FE mark a variable as artificial variable.
llvm-svn: 115102
2010-09-29 23:07:21 +00:00
Devang Patel 95ae73c394 Generalize DISubprogram element to encode various flags instead of just one boolean for isArtificial.
This is a backword compatible change.

llvm-svn: 115084
2010-09-29 21:04:46 +00:00
Devang Patel 7a55481fa4 Provide an interface to let FEs anchor debug info for types.
llvm-svn: 114969
2010-09-28 18:08:20 +00:00
Benjamin Kramer 4b57204e80 Simplify code.
llvm-svn: 114444
2010-09-21 16:41:29 +00:00
Benjamin Kramer 4021d906f1 Make CreateComplexVariable independent of SmallVector.
llvm-svn: 114439
2010-09-21 16:00:03 +00:00
Devang Patel dd719f701d Let FE use derived types for DW_TAG_friend.
Patch by Alexander Herz!

llvm-svn: 111861
2010-08-23 23:16:25 +00:00
Devang Patel a8652674e0 Handle qualified constants that are directly folded by FE.
PR 7920.

llvm-svn: 111820
2010-08-23 18:25:56 +00:00
Dan Gohman 5fc55dc3cf CreateTemporaryType doesn't needs its Context argument.
llvm-svn: 111687
2010-08-20 22:39:47 +00:00
Dan Gohman 16a5d98c3a Introduce a new temporary MDNode concept. Temporary MDNodes are
not part of the IR, are not uniqued, and may be safely RAUW'd.
This replaces a variety of alternate mechanisms for achieving
the same effect.

llvm-svn: 111681
2010-08-20 22:02:26 +00:00
Devang Patel 4d597e8268 Even if a variable has constant value all the time, it is still a variable in gdb's eyes.
Tested by scope.exp in gdb testsuite.

llvm-svn: 110876
2010-08-11 23:17:54 +00:00
Devang Patel 3e4d04230b Add missing argument. CreateCompositeTypeEx() users, please verify.
llvm-svn: 110717
2010-08-10 20:22:49 +00:00
Devang Patel 8e06a5eb47 Do not forget debug info for enums. Use named mdnode to keep track of these types.
llvm-svn: 110712
2010-08-10 20:01:20 +00:00
Devang Patel b219746c80 Handle TAG_constant for integers.
llvm-svn: 110656
2010-08-10 07:11:13 +00:00
Devang Patel c7cf14f5f6 Refactor.
llvm-svn: 110607
2010-08-09 21:39:24 +00:00
Devang Patel 33a2cdf3f9 Add explicit constructors. Patch by Renato Golin.
llvm-svn: 110072
2010-08-02 22:51:46 +00:00
Dan Gohman 2637cc1a38 Make NamedMDNode not be a subclass of Value, and simplify the interface
for creating and populating NamedMDNodes.

llvm-svn: 109061
2010-07-21 23:38:33 +00:00
Jim Grosbach 6cd0deb997 tidy up.
llvm-svn: 109038
2010-07-21 21:36:25 +00:00
Dan Gohman 093cb79d4b Disallow null as a named metadata operand.
Make MDNode::destroy private.
Fix the one thing that used MDNode::destroy, outside of MDNode itself.

One should never delete or destroy an MDNode explicitly. MDNodes
implicitly go away when there are no references to them (implementation
details aside).

llvm-svn: 109028
2010-07-21 18:54:18 +00:00
Stuart Hastings 61475c5c3c Correct line info for declarations/definitions. Radar 8063111.
llvm-svn: 108784
2010-07-19 23:56:30 +00:00