Commit Graph

76 Commits

Author SHA1 Message Date
Devang Patel dc866e119c Simplify code and add comments, in code that generate debug info for constant integer globals, based on Chris's feedback.
llvm-svn: 110694
2010-08-10 17:53:33 +00:00
Devang Patel e03edfd3e7 Even if a constant's evaluated value is used, emit debug info for the constant variable.
llvm-svn: 110660
2010-08-10 07:24:25 +00:00
Devang Patel 4f6e73b168 Always use current working directory for DW_AT_comp_dir.
llvm-svn: 109535
2010-07-27 20:49:59 +00:00
Devang Patel 6014edd117 Reapply 109303.
llvm-svn: 109507
2010-07-27 15:17:16 +00:00
Devang Patel 6005082354 Revert 109303.
llvm-svn: 109426
2010-07-26 18:49:27 +00:00
Devang Patel 268ad093a7 Untangle filename/dirname confusion. Store constructed strings on the side. Avoid use of Path.makeAbsolute().
DW_TAG_compile_unit uses two attributes DW_AT_name and DW_AT_comp_dir. Their expected values are:

$ clang foo.c -g
  DW_AT_name - foo.c
  DW_AT_comp_dir - `pwd`

$ clang one/two/foo.c -g
  DW_AT_name - one/two/foo.c
  DW_AT_comp_dir - `pwd`

$ clang /tmp/one/foo.c -g
  DW_AT_name - /tmp/one/foo.c
  DW_AT_comp_dir - empty

llvm-svn: 109303
2010-07-24 00:59:16 +00:00
Devang Patel 0884a60eb5 Keep track of artificial scopes introduced by line directives. For example,
#line 41 "bar.c"
  dummy (1, i);
#line 24 "bar.h"
  i = f2 (i);
#line 44 "bar.c"

This is tested by step-line.exp in gdb testsuite.

llvm-svn: 109189
2010-07-22 22:29:16 +00:00
Devang Patel 11a42a4655 Remove unused argument.
llvm-svn: 108946
2010-07-20 22:20:10 +00:00
Devang Patel 6c01820900 Print template argument names for template class.
llvm-svn: 108916
2010-07-20 20:24:18 +00:00
John McCall 8b07ec253d Substantially alter the design of the Objective C type AST by introducing
ObjCObjectType, which is basically just a pair of
  one of {primitive-id, primitive-Class, user-defined @class}
with
  a list of protocols.
An ObjCObjectPointerType is therefore just a pointer which always points to
one of these types (possibly sugared).  ObjCInterfaceType is now just a kind
of ObjCObjectType which happens to not carry any protocols.

Alter a rather large number of use sites to use ObjCObjectType instead of
ObjCInterfaceType.  Store an ObjCInterfaceType as a pointer on the decl rather
than hashing them in a FoldingSet.  Remove some number of methods that are no
longer used, at least after this patch.

By simplifying ObjCObjectPointerType, we are now able to easily remove and apply
pointers to Objective-C types, which is crucial for a certain kind of ObjC++
metaprogramming common in WebKit.

llvm-svn: 103870
2010-05-15 11:32:37 +00:00
Devang Patel c5ffabc94f If given location is invalid then use current location.
This fixes recent regressions reported by gdb testsuite. 
Tighter verification of debug info generated by FE found these regressions.

Refactor code to extract line number and column number from SourceLocation.

llvm-svn: 103678
2010-05-12 23:46:38 +00:00
Benjamin Kramer 20f2d4382f Fix pasto, add a comment.
llvm-svn: 102263
2010-04-24 20:26:20 +00:00
Benjamin Kramer bbb5deace6 Factor code. No functionality change.
llvm-svn: 102262
2010-04-24 20:19:58 +00:00
Anders Carlsson 11e5140db9 Vtable -> VTable renames across the board.
llvm-svn: 101666
2010-04-17 20:15:18 +00:00
Benjamin Kramer 9e2e1c9024 Minor include pruning.
llvm-svn: 100007
2010-03-31 15:04:05 +00:00
Ted Kremenek dbb8cd1d34 Cache results computed by CGDebugInfo::getOrCreateFile() in a DenseMap.
This reduces '-c -g' time on one file in 403.gcc by 12%.

llvm-svn: 99857
2010-03-30 00:27:51 +00:00
Ted Kremenek ac031880af Remove FIXME comment.
llvm-svn: 99828
2010-03-29 19:10:41 +00:00
Ted Kremenek 23c29f0cbe Change 'TypeCache' from being an std::map to a llvm::DenseMap. This reduces codegen time
on one .i file from 403.gcc by 0.5%.

llvm-svn: 99823
2010-03-29 18:29:57 +00:00
Devang Patel 4f26205ba8 More then one anonymous aggregates on one line creates chaos when MDNode uniquness is combined with RAUW operation. Right solution is to avoid using RAUW.
This fixes PR 6554.

llvm-svn: 98083
2010-03-09 21:32:27 +00:00
Devang Patel 408dcf60aa Start using DIFile. Corresponding llvm patch is r98020.
llvm-svn: 98021
2010-03-09 00:44:50 +00:00
Devang Patel b407338fe2 Emit debug info for VectorType.
llvm-svn: 96999
2010-02-23 22:59:39 +00:00
Devang Patel 535fdaf020 Refactor code that generates debug info for variables that has BlocksAttr.
llvm-svn: 95786
2010-02-10 18:49:08 +00:00
Devang Patel 973f2eb0cd Emit debug info for namespaces.
llvm-svn: 94991
2010-02-01 19:16:32 +00:00
Devang Patel 92e2541599 Maintain a map of regions (lexical scopes) and use it to find context for a global variable.
llvm-svn: 94817
2010-01-29 18:11:03 +00:00
Devang Patel 7bfc596fcf s/CGDebugInfo::getContext/CGDebugInfo::getContextDescriptor/g to avoid confusion.
llvm-svn: 94760
2010-01-28 23:15:27 +00:00
Devang Patel 0d61eebd81 s/FunctionNames/DebugInfoNames/g
llvm-svn: 94753
2010-01-28 18:21:00 +00:00
Devang Patel 84033fb240 Emit vtable info.
llvm-svn: 94751
2010-01-28 18:11:52 +00:00
Devang Patel 3d4e6d9dd0 Include "this" pointer argument while emitting debug info for a C++ method.
llvm-svn: 94710
2010-01-28 00:28:01 +00:00
Anders Carlsson 17ed0496c5 Fix the test I broke, and also fix a crash when declaring a virtual destructor. Add debug info support for pure virtual member functions.
llvm-svn: 94519
2010-01-26 05:19:50 +00:00
Anders Carlsson b85f0ab976 Factor creating the DISubprogram for a member function out into a separate function.
llvm-svn: 94513
2010-01-26 04:49:33 +00:00
Devang Patel c54353d935 First cut at emitting inheritance info.
llvm-svn: 94473
2010-01-25 23:32:18 +00:00
Devang Patel 7a12ad0dc1 First cut at emitting debugging information for C++ member functions.
There is lot more work to do in this area.

llvm-svn: 93836
2010-01-19 01:54:44 +00:00
Devang Patel 889ce76f41 Refactor.
llvm-svn: 93814
2010-01-19 00:00:59 +00:00
Devang Patel 934661ed73 Emit human readable names for c/c++ functions. Avoid emitting linkage name if it matches regular name.
llvm-svn: 93383
2010-01-14 00:36:21 +00:00
Benjamin Kramer ba8451b243 Use StringRef in CGDebugInfo::EmitFunctionStart.
llvm-svn: 90856
2009-12-08 14:04:35 +00:00
Anders Carlsson 3efc6e6f46 Add rudimentary support for member pointers to CGDebugInfo.
llvm-svn: 90711
2009-12-06 18:00:51 +00:00
Devang Patel b40f295037 Do not store DIDescriptor directly into a container. Store MDNode directly, through TrackingVH.
llvm-svn: 88677
2009-11-13 19:10:24 +00:00
Anders Carlsson 443f677302 Simplify the debug info code, handle lvalue references and template specializations.
llvm-svn: 86277
2009-11-06 19:19:55 +00:00
Mike Stump ae2559a221 Fixup the return type of functions.
llvm-svn: 84922
2009-10-23 01:52:13 +00:00
Devang Patel 5d90d62701 Add support to attach debug info to an instruction.
This is not yet enabled.

llvm-svn: 83399
2009-10-06 18:36:08 +00:00
Devang Patel faf7e9ad24 Set appropriate context for a global variable while emitting debug info.
llvm-svn: 83352
2009-10-06 00:35:31 +00:00
Mike Stump 2e722b915c Improve debugging information for BlockDeclRefExpr. WIP. Given this
scheme, we can switch the previous scheme over to using this code
path.  There's a bit of simplifications yet to do as well.

llvm-svn: 83138
2009-09-30 02:43:10 +00:00
John McCall 0cf155174e Fix an infinite loop arising when trying to generate debug information
for a ObjC class with an ivar of weak self type.

llvm-svn: 82745
2009-09-25 01:40:47 +00:00
Daniel Dunbar 9996138a80 Ok, an AssertingVH definitely doesn't work for now because we free our cache after the optimizer may have hacked on the module. Use a WeakVH instead.
llvm-svn: 82324
2009-09-19 20:17:48 +00:00
Daniel Dunbar 1cbaae56cf Switch CGDebugInfo type cache to using an AssertingVH.
llvm-svn: 82321
2009-09-19 19:27:24 +00:00
Daniel Dunbar de870bdcf2 Factor out CGDebugInfo::CreateTypeNode method.
- No functionality change.

llvm-svn: 82320
2009-09-19 19:27:14 +00:00
Mike Stump 11289f4280 Remove tabs, and whitespace cleanups.
llvm-svn: 81346
2009-09-09 15:08:12 +00:00
Devang Patel 9be7b20401 Revert 75648 for now. It is causing test failures.
llvm-svn: 75684
2009-07-14 21:31:22 +00:00
Devang Patel d6c256696b Use LLVM mangler to get mangled name for debug info entry.
llvm-svn: 75589
2009-07-14 02:47:58 +00:00
Daniel Dunbar f5c79709bc Update debug info generation for ObjCObjectPointer changes.
- Previously this would crash on recursive types, and it was also incorrectly
   stripping off a level of indirection.
 - I'm not 100% convinced this is all correct, but it should be a monotonic
   improvment.

llvm-svn: 75582
2009-07-14 01:20:56 +00:00