Commit Graph

402 Commits

Author SHA1 Message Date
Douglas Gregor b8c7fe9dc9 Debug info generation for rvalue references
llvm-svn: 124020
2011-01-22 01:58:15 +00:00
John McCall 424cec97bd Change QualType::getTypePtr() to return a const pointer, then change a
thousand other things which were (generally inadvertantly) relying on that.

llvm-svn: 123814
2011-01-19 06:33:43 +00:00
Devang Patel 283e89dd22 Simplify.
llvm-svn: 123682
2011-01-17 22:23:07 +00:00
Devang Patel bc47498973 Fix debug info for __block variable referenced outside of block.
llvm-svn: 123199
2011-01-11 00:30:27 +00:00
John McCall 8190451ddc Introduce an AttributedType, but don't actually use it anywhere yet.
The initial TreeTransform is a cop-out, but it's more-or-less equivalent
to what we were doing before, or rather what we're doing now and might
eventually stop doing in favor of using this type.
I am simultaneously intrigued by the possibilities of rebuilding a
dependent Attri

llvm-svn: 122942
2011-01-06 01:58:22 +00:00
Abramo Bagnara 924a8f3573 Added ParenType type node.
llvm-svn: 121488
2010-12-10 16:29:40 +00:00
John McCall 717d9b0e2f It's kindof silly that ExtQuals has an ASTContext&, and we can use that
space better.  Remove this reference.  To make that work, change some APIs
(most importantly, getDesugaredType()) to take an ASTContext& if they
need to return a QualType.  Simultaneously, diminish the need to return a
QualType by introducing some useful APIs on SplitQualType, which is
just a std::pair<const Type *, Qualifiers>.

llvm-svn: 121478
2010-12-10 11:01:00 +00:00
Devang Patel 8c44529c85 Remove unused parameter. getContextDescriptor() and getOrCreateNameSpace().
llvm-svn: 121333
2010-12-09 00:33:05 +00:00
Devang Patel 4591f7736a Remove unused parameter.
llvm-svn: 121326
2010-12-09 00:25:29 +00:00
Devang Patel 00afcbe366 Start using DIBuilder. It provides cleaner interface.
llvm-svn: 121302
2010-12-08 22:42:58 +00:00
Douglas Gregor 2f53a0bbf2 Harden CGDebugInfo::CreateType() a bit for cases where we couldn't generate type info for its component types
llvm-svn: 120401
2010-11-30 06:38:09 +00:00
Michael J. Spencer 8aaf49959c Merge System into Support.
llvm-svn: 120297
2010-11-29 18:12:39 +00:00
Anders Carlsson 7f95cd1817 Rename RecordLayout::getPrimaryBaseWasVirtual to isPrimaryBaseVirtual.
llvm-svn: 120133
2010-11-24 23:12:57 +00:00
Argyrios Kyrtzidis d004064864 Refactoring of Diagnostic class.
-Move the stuff of Diagnostic related to creating/querying diagnostic IDs into a new DiagnosticIDs class.
-DiagnosticIDs can be shared among multiple Diagnostics for multiple translation units.
-The rest of the state in Diagnostic object is considered related and tied to one translation unit.
-Have Diagnostic point to the SourceManager that is related with. Diagnostic can now accept just a
   SourceLocation instead of a FullSourceLoc.
-Reflect the changes to various interfaces.

llvm-svn: 119730
2010-11-18 20:06:41 +00:00
Douglas Gregor ad3832e213 Teach debug-info generation that SourceManager::getPresumedLoc() can
produce an invalid location even when given a valid location, if the
file system has changed underneath us. Recovery more gracefully.

llvm-svn: 118834
2010-11-11 20:45:16 +00:00
Douglas Gregor 1ccc8416a0 Remove broken support for variadic templates, along with the various
abstractions (e.g., TemplateArgumentListBuilder) that were designed to
support variadic templates. Only a few remnants of variadic templates
remain, in the parser (parsing template type parameter packs), AST
(template type parameter pack bits and TemplateArgument::Pack), and
Sema; these are expected to be used in a future implementation of
variadic templates.

But don't get too excited about that happening now.

llvm-svn: 118385
2010-11-07 23:05:16 +00:00
Devang Patel 86f30f5a1d Simplify. Builtin types' context is always implied.
llvm-svn: 117928
2010-11-01 16:52:40 +00:00
Anders Carlsson fd88a6160d Rename getBaseClassOffset to getBaseClassOffsetInBits and introduce a getBaseClassOffset which returns the offset in CharUnits. Do the same thing for getVBaseClassOffset.
llvm-svn: 117881
2010-10-31 23:22:37 +00:00
Devang Patel 31d1e2153f After processing named unions do not fall through to handle anonymous unions.
This is tested by funcargs.exp in gdb testsuite.

llvm-svn: 117659
2010-10-29 16:21:19 +00:00
Devang Patel ed23f18d7e Basic types are language defined builtins. They are always defined at top most level.
llvm-svn: 117613
2010-10-28 22:03:20 +00:00
Devang Patel faadd7b72d Directly use NamespaceDecl->getLocation() to find the source file.
llvm-svn: 117576
2010-10-28 19:12:46 +00:00
Devang Patel 8e0073008a Stay within 80 columns.
llvm-svn: 117561
2010-10-28 17:27:32 +00:00
Devang Patel 1bee63f325 Fix context info for enums.
Radar 8595129

llvm-svn: 117507
2010-10-27 23:23:58 +00:00
Devang Patel db3910000a Revert unintentional check-in.
llvm-svn: 117120
2010-10-22 18:31:12 +00:00
Devang Patel f79199d140 Tidy up MIPS_linkage name. Provide it only if it does not match regular name, otherwise it confuses debugger.
This is tested by local.C in llvmgcc testsuite.

llvm-svn: 117107
2010-10-22 17:11:50 +00:00
Fariborz Jahanian f34011e4ca patch fixes class names missing from method names in debug information for
synthesized property. // rdar: //8498026

llvm-svn: 116717
2010-10-18 17:51:06 +00:00
Devang Patel 0f58561907 Use root non-virtual primary base class, not just immediate primary base class, for AT_containing_type.
This is tested by virtfunc.exp in gdb testsuite.

llvm-svn: 116535
2010-10-14 22:59:23 +00:00
Devang Patel 67f70aaf5a Fix debug info for anon union.
This is tested by anon-union.exp.

llvm-svn: 116372
2010-10-12 23:24:54 +00:00
Fariborz Jahanian 77890879dd Fixes a typo which caused byte offset in debug info
for ivars to be 0. Fixes pr8353.

llvm-svn: 116273
2010-10-11 23:55:47 +00:00
Devang Patel 33ddf69fb3 Fix debug info for functions whose context is a namespace.
This is tested by namespace.exp in gdb testsuite.

llvm-svn: 116248
2010-10-11 21:58:41 +00:00
John McCall a2fabff4f6 Permit constant evaluation of const floating-point variables with
constant initializers.

llvm-svn: 116138
2010-10-09 01:34:31 +00:00
Devang Patel 251f859b23 Identify functions with prototype appropriately in debug info.
This is tested by callfuncs.exp in gdb testsuite.

llvm-svn: 115989
2010-10-07 22:03:49 +00:00
Devang Patel 284fa417ec Mark FunctionNoProtoType's argument as unspecified parameters.
llvm-svn: 115834
2010-10-06 20:51:45 +00:00
Devang Patel c0601d1e99 Do not emit subrange for incomplete array type.
This is tested by ptype.exp in gdb testsuite.

llvm-svn: 115805
2010-10-06 18:30:00 +00:00
Devang Patel 5b389f495b Remove unused argument.
llvm-svn: 115789
2010-10-06 15:58:57 +00:00
Devang Patel d18c5aa20a Mark explict methods as explict in debug info.
llvm-svn: 115379
2010-10-01 23:32:17 +00:00
Fariborz Jahanian 885e9dff93 Output debug info. for ivars declared in class
extension and implementation.
Fixes rdar://8493239.

llvm-svn: 115248
2010-10-01 00:01:53 +00:00
Devang Patel 91bbb5547d Introduce -flimit-debug-info.
In this experimental mode try avoiding debug info emission for classes as much as possible. The goal is to reduce size of produced debuginfo without reducing quality of debug info in general. This is a work in progress.

llvm-svn: 115188
2010-09-30 19:05:55 +00:00
Devang Patel 7c086227e6 Attach aritifical attribute with implicit parameters.
Radar 8493141.

llvm-svn: 115104
2010-09-29 23:09:21 +00:00
Devang Patel 330b65e350 Emit method access specifier.
Radar 8490416.

llvm-svn: 115090
2010-09-29 21:46:16 +00:00
Devang Patel db2732ac42 Update to reflect DIFactory::CreateSubprogram() interface change from r115084.
llvm-svn: 115085
2010-09-29 21:05:52 +00:00
Devang Patel 984cdeef37 Remove dead code.
llvm-svn: 115079
2010-09-29 20:05:01 +00:00
Benjamin Kramer 3e0c527dcc Adjust for debug info API change.
llvm-svn: 114438
2010-09-21 15:59:59 +00:00
Gabor Greif bf98608a3d do not rely on the implicit-dereference semantics of dyn_cast_or_null
llvm-svn: 114281
2010-09-18 13:00:17 +00:00
Devang Patel 28b5286bda While handling change of file, check if _current_ file is already seen or not. If current file is seen then it indicates that end of previous file's lexical scope.
This fixes radar 8396182.

llvm-svn: 114018
2010-09-15 20:50:40 +00:00
David Chisnall cf60744cd7 Tidy up last commit, as per Devang's comments.
llvm-svn: 112840
2010-09-02 18:01:51 +00:00
David Chisnall 6bf98ff491 Use the unmangled name for the display name in Objective-C debug info. This should have no effect with the Mac runtime where clang (unlike GCC) uses the display name symbol name.
llvm-svn: 112833
2010-09-02 17:16:32 +00:00
Devang Patel 96b7f55a03 Debug info for friends!
Patch originally by Alexander Herz.

llvm-svn: 112275
2010-08-27 17:47:47 +00:00
Devang Patel 22e99c2bad Fix enum size and align. Tested by setvar.exp in gdb testsuite.
llvm-svn: 111936
2010-08-24 18:14:06 +00:00
Daniel Dunbar 64c222a6bc Debug Info: Put full Clang version into the debug info, to make it easier to
identify what version of the compiler was used to build something.

llvm-svn: 111927
2010-08-24 17:41:09 +00:00
Devang Patel 41c2097058 Emit debug info for enum constants.
llvm-svn: 111852
2010-08-23 22:07:25 +00:00
Dan Gohman 66427b1fcf Reinstate the code for emitting an initial debug type for a struct,
to handle the case where the struct is only forward-declared. In
this case, a temporary MDNode is not needed and not desired.

llvm-svn: 111842
2010-08-23 21:15:56 +00:00
Eli Friedman 04831926ec Detabify.
llvm-svn: 111768
2010-08-22 01:00:03 +00:00
Dan Gohman 25f9aaedc6 Delete an obsolete comment.
llvm-svn: 111711
2010-08-21 02:41:29 +00:00
Dan Gohman b1aac3362c CreateTemporaryType doesn't needs its Context argument.
llvm-svn: 111688
2010-08-20 22:39:57 +00:00
Dan Gohman 196f71006e 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: 111682
2010-08-20 22:02:57 +00:00
Devang Patel caa23f0708 Emit debug info for static const class member.
llvm-svn: 110885
2010-08-12 00:02:44 +00:00
Devang Patel 8166571a25 Simplify
llvm-svn: 110716
2010-08-10 20:16:57 +00:00
Devang Patel 76e3b53541 Do not use DIGlobalVariable to emit debugging information for enums.
llvm-svn: 110697
2010-08-10 18:27:15 +00:00
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 c7f16ab3e3 Override selected builtin names (e.g. "long int" instead of "long") to match names used by gcc in debug info. This makes gdb testsuite happy.
llvm-svn: 109694
2010-07-28 23:23:29 +00:00
Devang Patel a652fab052 construct debug info for "id" by hand.
Tested by mi1-var-obj.exp in gdb testsuite.

llvm-svn: 109571
2010-07-28 01:33:15 +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 cb9fe9ec16 Revert r109263.
llvm-svn: 109284
2010-07-23 23:04:28 +00:00
Devang Patel 28f167699a There is no need to use separate dir name for AT_comp_dir attribute. Using absolute path for filename allows clients to query complete file location info from gdb breakpoints. Save constructed full file name.
llvm-svn: 109263
2010-07-23 20:38:37 +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 222f4be834 ObjCId is special "struct objc_object". Make this explicit in debug info.
This is tested by objc-rbreak.exp in gdb testsuite.

llvm-svn: 109050
2010-07-21 22:41:25 +00:00
Devang Patel 0043977f09 Remove unintended code that was checked in as part of r108916.
llvm-svn: 108951
2010-07-20 22:32:37 +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
Stuart Hastings 7d7bc561bf Correct line info for declarations/definitions. Radar 8063111.
llvm-svn: 108785
2010-07-19 23:56:31 +00:00
Devang Patel 8fd6499a97 Set "optimization is ON" and supply other optional parameters. This helps codegenerator preserve info in case the symbol is deleted.
llvm-svn: 108471
2010-07-15 23:09:46 +00:00
Devang Patel b3026df9fa Mark implementation generated methods as artificial.
Tested by namespace.exp and virtfunc.exp from gdb testsuite.

llvm-svn: 108468
2010-07-15 22:57:00 +00:00
Devang Patel 99c372134d Revert 108220 and subsequent patch.
This is not required (I am not 100% sure why) but method.exp from gdb testsuite flagged regression due to this patch.

llvm-svn: 108434
2010-07-15 18:16:09 +00:00
Devang Patel 01c8c100c2 Add volatile qualifiers for "this".
llvm-svn: 108245
2010-07-13 16:23:13 +00:00
Devang Patel 0a34e31d81 const qualify debug info for "this" for const methods.
llvm-svn: 108220
2010-07-13 00:24:30 +00:00
Devang Patel 0aabb1200f While collecting members for a class, always create delcaration entry for methods. Debug info for method definition will be generated while generating code for method body.
Tested by classes.exp in gdb testsuite.

llvm-svn: 108205
2010-07-12 22:54:41 +00:00
Devang Patel 8f3f76f991 Handle forward declarations properly in debug info.
Patch by Alexander Kabaev.
PR 7595.

llvm-svn: 107900
2010-07-08 19:56:29 +00:00
Anders Carlsson ea836bc41c Switch over to the new caching version of getMangledName.
llvm-svn: 106549
2010-06-22 16:16:50 +00:00
Chandler Carruth 8509824cdb Move CodeGenOptions.h *back* into Frontend. This should have been done when the
dependency edge was reversed such that CodeGen depends on Frontend.

llvm-svn: 106065
2010-06-15 23:19:56 +00:00
Devang Patel 6ccba0fb6e Preserve type info for local variables in optimized builds.
llvm-gcc enabled this couple of weeks ago.

llvm-svn: 105516
2010-06-05 01:14:40 +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 ec2a9abd4a Fix thinko in yesterday's fix.
Providing linkage name for function static variable confuses gdb, so don't do that.

llvm-svn: 103779
2010-05-14 16:55:25 +00:00
Devang Patel 98f217118f Fix context in class static variable's debugging information entry.
This fixes bunch of failures in gdb testsuite.

llvm-svn: 103745
2010-05-13 23:52: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
Abramo Bagnara 6150c884df Merged Elaborated and QualifiedName types.
llvm-svn: 103517
2010-05-11 21:36:43 +00:00
Devang Patel 82bbfb58e3 Initialize Column.
llvm-svn: 103448
2010-05-10 23:48:38 +00:00
Devang Patel b319adec49 If variable location is invalid then use current location.
This fixes radar 7959934.

llvm-svn: 103408
2010-05-10 17:24:58 +00:00
Devang Patel 67eba80672 If there is not any debug info for type then do not emit debug info for this variable.
A recent change to tightly verify debug info prepared by FE caught this.
This fixes unittest build.

llvm-svn: 103320
2010-05-07 23:05:55 +00:00
Devang Patel ba4ad7f2fd Avoid use of DIDescriptor::getNode(). Use overloaded operators instead.
llvm-svn: 103273
2010-05-07 18:12:35 +00:00
Douglas Gregor c8be95274d When instantiating a function that was declared via a typedef, e.g.,
typedef int functype(int, int);
    functype func;

also instantiate the synthesized function parameters for the resulting
function declaration. 

With this change, Boost.Wave builds and passes all of its regression
tests.

llvm-svn: 103025
2010-05-04 18:18:31 +00:00
Devang Patel dfcd0661a1 Use clang::VarDecl name instead of llvm::GlobalVariable name.
llvm::GLobalVariable name may not match user visibile name for function static variables.

llvm-svn: 102644
2010-04-29 17:48:37 +00:00
John McCall 2408e32096 Make the InjectedClassNameType the canonical type of the current instantiation
of a class template or class template partial specialization.  That is to
say, in
  template <class T> class A { ... };
or
  template <class T> class B<const T*> { ... };
make 'A<T>' and 'B<const T*>' sugar for the corresponding InjectedClassNameType
when written inside the appropriate context.  This allows us to track the
current instantiation appropriately even inside AST routines.  It also allows
us to compute a DeclContext for a type much more efficiently, at some extra
cost every time we write a template specialization (which can be optimized,
but I've left it simple in this patch).

llvm-svn: 102407
2010-04-27 00:57:59 +00:00
Devang Patel 42fb6f8b9a Enable debug info for local variables at -O1+.
llvm-svn: 102398
2010-04-26 23:28:46 +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