Devang Patel
7294d74627
Emit proper selector name in debug info.
...
llvm-svn: 129626
2011-04-16 00:37:51 +00:00
Devang Patel
9d6c857862
Emit debug info for Objective-C properties.
...
llvm-svn: 129625
2011-04-16 00:12:55 +00:00
Nick Lewycky
d85ae78c48
Apply explicit braces to avoid ambiguous 'else' [-Wparentheses]
...
llvm-svn: 129176
2011-04-09 00:25:15 +00:00
Devang Patel
0b37e79891
Do not use zero as an upper bound for unbounded array because upper bound zero also indicates one element array.
...
llvm-svn: 129157
2011-04-08 21:56:52 +00:00
Ken Dyck
bb4e977218
[Reapply r128776, modified so that it does not break debug info.]
...
Change the return type of CodeGenVTables::getVirtualBaseOffsetOffset() to
CharUnits. No change in functionality intended.
llvm-svn: 129072
2011-04-07 12:37:09 +00:00
Devang Patel
78019ec14d
Simplify.
...
llvm-svn: 128957
2011-04-05 23:26:36 +00:00
Devang Patel
b87c428055
Emit debug info for function template parameters.
...
llvm-svn: 128948
2011-04-05 22:54:11 +00:00
Devang Patel
e1dd424380
Remove unintentional check-in.
...
llvm-svn: 128928
2011-04-05 21:05:56 +00:00
Devang Patel
095421b4a8
Fix typo.
...
llvm-svn: 128921
2011-04-05 20:28:21 +00:00
Devang Patel
98d26c91da
Use TemplateParameterList to extract template parameter name.
...
llvm-svn: 128915
2011-04-05 20:15:06 +00:00
Devang Patel
7522abd3ce
Refactor.
...
llvm-svn: 128893
2011-04-05 17:30:54 +00:00
Devang Patel
44927690c3
Eliminate conservative check that is covered by isIncompleteType() check.
...
llvm-svn: 128857
2011-04-04 23:23:39 +00:00
Devang Patel
a540f1462c
Incomplete type does not have any size.
...
llvm-svn: 128855
2011-04-04 23:18:38 +00:00
Devang Patel
84852bbb42
Revert r128770, r128771, r128773 and r128776 for now. It breaks debug info.
...
llvm-svn: 128842
2011-04-04 20:36:06 +00:00
Ken Dyck
1473c9a7c4
Change the return type of CodeGenVTables::getVirtualBaseOffsetOffset() to
...
CharUnits. No change in functionality intended.
llvm-svn: 128776
2011-04-02 17:52:22 +00:00
Devang Patel
1ffe23464a
Do not try calculate the size of forward-declared template type array.
...
llvm-svn: 128725
2011-04-01 19:02:33 +00:00
Devang Patel
945b8aed2a
Update type cache when a type is completed.
...
Radar 9168773
llvm-svn: 128150
2011-03-23 16:29:39 +00:00
Peter Collingbourne
599cb8e430
Add support for language-specific address spaces. On top of that,
...
add support for the OpenCL __private, __local, __constant and
__global address spaces, as well as the __read_only, _read_write and
__write_only image access specifiers. Patch originally by ARM;
language-specific address space support by myself.
llvm-svn: 127915
2011-03-18 22:38:29 +00:00
Anders Carlsson
829c4134b8
Correctly unwrap 'auto' types. Fixes PR9414.
...
llvm-svn: 127121
2011-03-06 16:43:04 +00:00
John McCall
4223a9ee7a
Make AttributedTypes for GC-qualified types and fix some miscellaneous
...
bugs with such types. Not sure this is quite how I want the desugaring
and a.k.a. logic to go, but it suffices.
llvm-svn: 126986
2011-03-04 04:00:19 +00:00
Devang Patel
68a1525290
Encode argument numbering in debug info so that code generator can emit them in order.
...
This fixes few blocks.exp regressions.
llvm-svn: 126960
2011-03-03 20:13:15 +00:00
Devang Patel
bd6f7f9770
revert r126858.
...
llvm-svn: 126874
2011-03-02 20:31:22 +00:00
Devang Patel
31e5fb52d1
Encode argument numbering in debug info so that code generator can emit them in order.
...
This fixes few blocks.exp regressions.
Reapply r126795 with a fix (one character change) for gdb testsuite regressions.
llvm-svn: 126858
2011-03-02 19:11:22 +00:00
Devang Patel
a54696de8a
Revert r126794.
...
llvm-svn: 126848
2011-03-02 17:54:58 +00:00
John McCall
81a325e038
Hack in something so that we emit better debug information about
...
captured __block variables in the block-literal type.
llvm-svn: 126834
2011-03-02 06:57:14 +00:00
Devang Patel
3bc2dedb40
Encode argument numbering in debug info so that code generator can emit them in order.
...
This fixes few blocks.exp regressions.
llvm-svn: 126795
2011-03-01 22:59:40 +00:00
Devang Patel
bbe4ff99e0
Use single code path to handle c++ structs and classes while generating debug info.
...
llvm-svn: 126691
2011-02-28 22:32:45 +00:00
John McCall
147d021b75
Emit the structure layout of the block literal parameter to a block
...
invocation function into the debug info. Rather than faking up a class,
which is tricky because of the custom layout we do, we just emit a struct
directly from the layout information we've already got.
Also, don't emit an unnecessarily parameter alloca for this "variable".
llvm-svn: 126255
2011-02-22 22:38:33 +00:00
Devang Patel
d7185b755d
Use LLVM coding standard.
...
llvm-svn: 126232
2011-02-22 18:56:36 +00:00
Richard Smith
30482bc786
Implement the C++0x deduced 'auto' feature.
...
This fixes PR 8738, 9060 and 9132.
llvm-svn: 126069
2011-02-20 03:19:35 +00:00
Devang Patel
2d6390d47b
Start using enums from DIBuilder.
...
llvm-svn: 125990
2011-02-18 23:29:22 +00:00
Devang Patel
1728c232d5
If preprocessed token introduced empty filename then use main translation unit's filename for debug info entries.
...
llvm-svn: 125672
2011-02-16 18:40:36 +00:00
Devang Patel
25468059e5
Simplify test to check an aggregate argument that has non trivial constructor or destructor.
...
This patch rewrites r125142.
llvm-svn: 125632
2011-02-16 01:11:51 +00:00
Devang Patel
49e3348e56
Only c++ class arguments with non trivial constructor or destructor needs a reference.
...
C struct arguments do not need this adjustment.
This fixes 7 failures in callfuncs.exp from gdb testsuite.
llvm-svn: 125615
2011-02-15 23:36:28 +00:00
Devang Patel
425909dd41
If an aggregate is returned as 'sret' argument then let debugger know about this.
...
llvm-svn: 125249
2011-02-10 00:40:52 +00:00
Devang Patel
84d40a431f
Do not emit AT_MIPS_linkage_name for Objective-C method static variable i.
...
llvm-svn: 125210
2011-02-09 19:16:38 +00:00
Devang Patel
19ba2b4d6e
Emit debug info for objc_selector.
...
llvm-svn: 125163
2011-02-09 03:15:05 +00:00
Devang Patel
14524e0f24
If an aggregate argument is passed indirectly because it has non trivial
...
destructor or copy constructor than let debug info know about it.
Radar 8945514.
llvm-svn: 125142
2011-02-09 00:37:30 +00:00
John McCall
ad7c5c1657
Reorganize CodeGen{Function,Module} to eliminate the unfortunate
...
Block{Function,Module} base class. Minor other refactorings.
Fixed a few address-space bugs while I was there.
llvm-svn: 125085
2011-02-08 08:22:06 +00:00
John McCall
351762cda2
A few more tweaks to the blocks AST representation:
...
- BlockDeclRefExprs always store VarDecls
- BDREs no longer store copy expressions
- BlockDecls now store a list of captured variables, information about
how they're captured, and a copy expression if necessary
With that in hand, change IR generation to use the captures data in
blocks instead of walking the block independently.
Additionally, optimize block layout by emitting fields in descending
alignment order, with a heuristic for filling in words when alignment
of the end of the block header is insufficient for the most aligned
field.
llvm-svn: 125005
2011-02-07 10:33:21 +00:00
Devang Patel
84ffdd9ba3
Emit debug info for template value parameters.
...
llvm-svn: 124756
2011-02-02 22:36:18 +00:00
Devang Patel
e3773c2f51
Emit debug info for template type parameters.
...
llvm-svn: 124753
2011-02-02 21:38:49 +00:00
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
Devang Patel
8471593892
Revert accidental check-in.
...
llvm-svn: 102226
2010-04-24 00:49:16 +00:00
Devang Patel
f8b55d478c
Revert r102215. This causes clang crash while compiling a test case from gdb testsuite.
...
llvm-svn: 102224
2010-04-24 00:40:35 +00:00
Devang Patel
b9ab309650
Encode field accessibility.
...
llvm-svn: 102033
2010-04-21 23:12:37 +00:00
Anders Carlsson
11e5140db9
Vtable -> VTable renames across the board.
...
llvm-svn: 101666
2010-04-17 20:15:18 +00:00
Devang Patel
a2c048eaf8
Emit debug info for objc getters and setters.
...
llvm-svn: 100462
2010-04-05 21:09:15 +00:00
Chris Lattner
18a584b56c
NewDebugLoc got renamed to DebugLoc.
...
llvm-svn: 100219
2010-04-02 20:21:43 +00:00
Chris Lattner
e675d0f924
adjust to IRBuilder change and use faster DebugLoc apis.
...
llvm-svn: 100093
2010-04-01 06:31:43 +00:00
Chris Lattner
be49c03ff4
use the new optimized debug info metadata accessors. In
...
addition to the inherent win, this eliminates the pointless
cost of going through the name -> mdkind stringmap that we
were paying.
llvm-svn: 99983
2010-03-31 03:36:01 +00:00
Benjamin Kramer
9e649c3cfe
Replace some constant-sized SmallVectors.
...
llvm-svn: 99884
2010-03-30 11:36:44 +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
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
Anders Carlsson
a864caff8c
Rename CGVtableInfo to CodeGenVTables in preparation of adding another VTableInfo class.
...
llvm-svn: 99250
2010-03-23 04:11:45 +00:00
Douglas Gregor
65f7a3f801
Comment the reasons for the strange little dance we do with the main file name for debug information
...
llvm-svn: 99215
2010-03-22 21:28:29 +00:00
John McCall
7ec5043c2c
Change CodeGenModule to rely on the Module's symbol table instead of
...
shadowing it in the GlobalDeclMap. Eliminates the string-uniquing
requirement for mangled names, which should help C++ codegen times a little.
Forces us to do string lookups instead of pointer lookups, which might hurt
codegen times a little across the board. We'll see how it plays out.
Removing the string-uniquing requirement implicitly fixes any bugs like
PR6635 which arose from the fact that we had multiple uniquing tables for
different kinds of identifiers.
llvm-svn: 99012
2010-03-19 23:29:14 +00:00
Douglas Gregor
fc7a4813ab
Try to improve computation of the main file name for debug
...
information, to address recent gdb failures.
llvm-svn: 98959
2010-03-19 14:49:09 +00:00
Douglas Gregor
c6b5a3df1e
For debug information, get the main file name from the source manager
...
rather than from the -main-file-name flag, since the source manager
has proper path information. Fixes <rdar://problem/7769538>.
llvm-svn: 98898
2010-03-18 23:46:43 +00:00
Benjamin Kramer
69b3c43391
Use raw_ostream instead of sprintf.
...
llvm-svn: 98438
2010-03-13 12:06:51 +00:00
Devang Patel
a42d3ea60e
If main file name is empty then use "<unknown>".
...
llvm-svn: 98385
2010-03-12 21:04:27 +00:00
Devang Patel
01bb5ce932
Keep track of Record context to ensure that record elements are properly nested in debug info.
...
llvm-svn: 98283
2010-03-11 20:01:48 +00:00
Anders Carlsson
4cbe83cccb
Rename getVirtualBaseOffsetIndex to getVirtualBaseOffsetOffset to reflect what it actually does.
...
llvm-svn: 98248
2010-03-11 07:15:17 +00:00
John McCall
e78aac41de
Create a new InjectedClassNameType to represent bare-word references to the
...
injected class name of a class template or class template partial specialization.
This is a non-canonical type; the canonical type is still a template
specialization type. This becomes the TypeForDecl of the pattern declaration,
which cleans up some amount of code (and complicates some other parts, but
whatever).
Fixes PR6326 and probably a few others, primarily by re-establishing a few
invariants about TypeLoc sizes.
llvm-svn: 98134
2010-03-10 03:28:59 +00:00
Devang Patel
05c37d2800
Use SmallString instead of alloca.
...
llvm-svn: 98112
2010-03-10 00:19:43 +00:00
Devang Patel
93f274c161
Fix file reference for derived and composite types. Now, dwarf writer uses strict verifier that ignores debug info for such types if their file info is unknown.
...
llvm-svn: 98096
2010-03-09 22:49:11 +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
f2aa707895
Use getLast() instead of getBasename().
...
llvm-svn: 98072
2010-03-09 19:14:07 +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
d3cbaa1ddf
Avoid using DIDescriptor.isNull().
...
llvm-svn: 97976
2010-03-08 20:53:17 +00:00
Devang Patel
9cf2705a5d
Revert r97949.
...
llvm-svn: 97964
2010-03-08 19:20:58 +00:00
Devang Patel
4ce8ebb087
Avoid DIDescriptor.isNull() checks.
...
llvm-svn: 97949
2010-03-08 18:26:57 +00:00
Sanjiv Gupta
9ac3092d34
Targets (like pic16) may have mangled the name of global variables,
...
so get the name from Var rather than the original decl.
llvm-svn: 97114
2010-02-25 05:20:44 +00:00
Devang Patel
b407338fe2
Emit debug info for VectorType.
...
llvm-svn: 96999
2010-02-23 22:59:39 +00:00
Devang Patel
7585580ccc
Distinguish two lexical blocks at the same level.
...
llvm-svn: 96397
2010-02-16 21:41:20 +00:00
Devang Patel
f4df65cf60
Do not ignore anonymous records.
...
llvm-svn: 95953
2010-02-12 01:31:06 +00:00
Devang Patel
e003dd1721
Cache new compile unit.
...
llvm-svn: 95952
2010-02-12 01:30:31 +00:00
Douglas Gregor
0a5a2216e2
Eliminate the ASTContext parameter from RecordDecl::getDefinition()
...
and CXXRecordDecl::getDefinition(); it's totally unnecessary. No
functionality change.
llvm-svn: 95836
2010-02-11 01:04:33 +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
1b5330afe9
Use current location as the location of compiler generated arguments, e.g. self, _cmd etc.
...
llvm-svn: 95743
2010-02-10 01:09:50 +00:00
Devang Patel
0ae70d16b8
Fix virtual bases' debug info.
...
llvm-svn: 95678
2010-02-09 19:09:28 +00:00
Devang Patel
cce7e85165
Mark implicit "this" argument as an artificial argument.
...
llvm-svn: 95673
2010-02-09 17:57:50 +00:00
Devang Patel
ab793231c1
Fix FIXME and surrounding comment.
...
llvm-svn: 95023
2010-02-01 22:51:29 +00:00
Devang Patel
e8fb4b7fd6
Use appropriate context descriptor in RecordDecl's debug info.
...
llvm-svn: 95016
2010-02-01 22:40:08 +00:00
Devang Patel
3efd1470c9
Do not use clang type name to name a local variable, e.g. Decl.
...
llvm-svn: 95010
2010-02-01 21:52:22 +00:00
Devang Patel
1c0954cca7
Do not use clang type name to name a local variable, e.g. Decl.
...
llvm-svn: 95009
2010-02-01 21:39:52 +00:00
Devang Patel
7b7f46f5a6
Use DeclContext as getContextDescriptor() argument.
...
llvm-svn: 95008
2010-02-01 21:34:11 +00:00
Devang Patel
973f2eb0cd
Emit debug info for namespaces.
...
llvm-svn: 94991
2010-02-01 19:16:32 +00:00
Devang Patel
bb4820dc8e
Use appropriate context for typedefs.
...
llvm-svn: 94849
2010-01-29 22:29:31 +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
128aa9d176
Fix indentation.
...
llvm-svn: 94758
2010-01-28 21:54:15 +00:00
Devang Patel
4c3e7e99ca
Static methods do not need "this" pointer argument.
...
llvm-svn: 94756
2010-01-28 21:43:50 +00:00
Devang Patel
946edc1aa6
Emit base classes info first, as expected by the debugger.
...
llvm-svn: 94755
2010-01-28 21:41:35 +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
abb4413728
While emitting debugging infor for a C++ class, identify the holder of class's vtable, if any.
...
llvm-svn: 94712
2010-01-28 00:54:21 +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
Ken Dyck
160146eba2
Change the return type of ASTContext::getDeclAlignInBytes() to CharUnits and,
...
now that the "InBytes" part of the name is implied by the return type, rename
it to getDeclAlign().
llvm-svn: 94681
2010-01-27 17:10:57 +00:00
Anders Carlsson
0b5f1ddf0a
Fix another debug info crash with virtual bases.
...
llvm-svn: 94520
2010-01-26 05:26:39 +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
Anders Carlsson
c1821155bf
Simplify CGDebugInfo::CollectCXXMemberFunctions a little. More to come.
...
llvm-svn: 94511
2010-01-26 04:40:11 +00:00
Devang Patel
c54353d935
First cut at emitting inheritance info.
...
llvm-svn: 94473
2010-01-25 23:32:18 +00:00
Devang Patel
7af03fb4f0
Emit debug info for virtual functions.
...
llvm-svn: 94467
2010-01-25 23:17:15 +00:00
Chris Lattner
83b0dd16c3
fix rdar://7556129 a crash in blocks debug info codegen.
...
llvm-svn: 94402
2010-01-25 03:34:56 +00:00
Chris Lattner
bf78478d35
simplify code.
...
llvm-svn: 94401
2010-01-25 03:29:35 +00:00
Benjamin Kramer
8f8f405c71
No need to terminate this buffer.
...
llvm-svn: 94313
2010-01-23 18:16:07 +00:00
Devang Patel
3f4a77e082
A Decl->getName() is not unique. However, the debug info descriptors
...
are uniqued. The debug info descriptor describing record's context is
necessary to keep two Decl's descriptor unique if their name match.
There is more work to do to create descriptors for DeclContext.
As a temp. step use type's name in FwdDecl.
llvm-svn: 94050
2010-01-20 23:56:40 +00:00
Devang Patel
5e1a83c196
Emit human readable names for operators.
...
llvm-svn: 93837
2010-01-19 02:02:11 +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
757daca99c
Use llvm::Function name as the linkage name, but strip off leading '01' from display name.
...
llvm-svn: 93822
2010-01-19 00:25:12 +00:00
Devang Patel
889ce76f41
Refactor.
...
llvm-svn: 93814
2010-01-19 00:00:59 +00:00
Devang Patel
ddf6a57f3e
llvm::Function name is the linkage name. If it has a '01' as a prefix then probably there is a reason.
...
llvm-svn: 93808
2010-01-18 23:27:28 +00:00
Eli Friedman
8fdc2cb46a
Fix crash generating debug info for constructor for anonymous struct.
...
llvm-svn: 93601
2010-01-16 00:43:13 +00:00
Devang Patel
2d63010a9c
Emit linkage name even if it matches regular name. The code generator uses linkage name to find subprogram entry for the current function.
...
llvm-svn: 93461
2010-01-14 21:46:57 +00:00
Devang Patel
ea84f59f5c
Add comment.
...
llvm-svn: 93434
2010-01-14 18:06:13 +00:00
Devang Patel
4274a326be
Because CurLoc is the current source location as far as CGDebugInfo is concerned. It is expected that this is set (usually left bracket location of function body compound statement) before EmitfunctionStart() is used.
...
llvm-svn: 93389
2010-01-14 00:48:09 +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
Ken Dyck
40775003e6
Roll out ASTContext::getTypeSizeInChars(), replacing instances of
...
"ASTContext::getTypeSize() / 8". Replace [u]int64_t variables with CharUnits
ones as appropriate.
Also rename RawType, fromRaw(), and getRaw() in CharUnits to QuantityType,
fromQuantity(), and getQuantity() for clarity.
llvm-svn: 93153
2010-01-11 17:06:35 +00:00
Anders Carlsson
88ea2455f8
Get rid of FixedWidthIntType, as suggested by Chris and Eli.
...
llvm-svn: 92246
2009-12-29 07:07:36 +00:00
Chris Lattner
9f021fd05d
adjust for llvm api changes.
...
llvm-svn: 92236
2009-12-28 23:41:39 +00:00
Chris Lattner
5e124bf913
this form of SetDebugLocation is about to go away, add some #includes that
...
are about to not come in implicitly.
llvm-svn: 92228
2009-12-28 21:44:41 +00:00
Douglas Gregor
0f139a1df1
Improve on my previous fix for debug information. Rather than
...
recursing in CGDebugInfo::CreateTypeNode, teach
CanonicalizeTypeForDebugInfo---now called UnwrapTypeForDebugInfo---to
keep unwrapping the type until we hit something that can be
represented by debug information. Thanks to Anders for pointing this out!
llvm-svn: 91840
2009-12-21 20:18:30 +00:00
Douglas Gregor
0915b43ac2
Teach debug info generation to handle TemplateSpecializationType,
...
ElaboratedType, QualifiedNameType, and SubstTemplateTypeParmType type
nodes. Also, produce an "unsupported" diagnostic for C++0x type nodes
and "typeof" nodes, rather than asserting nondescriptly.
llvm-svn: 91837
2009-12-21 19:57:21 +00:00
Daniel Dunbar
24c7f5efc5
Add -dwarf-debug-flags, which provides a way to embed the cc1 level options used
...
to compile a translation unit into the debug info for that file.
- Used by parts of Darwin build process to check compiler flags, etc.
- <rdar://problem/7256886> clang does not emit AT_APPLE_flags
llvm-svn: 91661
2009-12-18 02:43:17 +00:00
Benjamin Kramer
ba8451b243
Use StringRef in CGDebugInfo::EmitFunctionStart.
...
llvm-svn: 90856
2009-12-08 14:04:35 +00:00
Benjamin Kramer
1d20564b8d
Use Path.makeAbsolute() and make a constant std::string a const char*.
...
llvm-svn: 90851
2009-12-08 11:02:29 +00:00
Jeffrey Yasskin
567ae47b4a
Remove several .c_str() to be forward-compatible with StringRef.
...
llvm-svn: 90822
2009-12-08 01:46:24 +00:00
Anders Carlsson
3efc6e6f46
Add rudimentary support for member pointers to CGDebugInfo.
...
llvm-svn: 90711
2009-12-06 18:00:51 +00:00
Daniel Dunbar
9eac065e67
Move MainFileName option variable into CodeGenOptions instead of LangOptions.
...
llvm-svn: 90051
2009-11-29 02:38:34 +00:00
Devang Patel
58bf6e1885
Use StringRef (again) in DebugInfo interface.
...
llvm-svn: 89867
2009-11-25 17:37:31 +00:00
Douglas Gregor
1b8fe5b716
First part of changes to eliminate problems with cv-qualifiers and
...
sugared types. The basic problem is that our qualifier accessors
(getQualifiers, getCVRQualifiers, isConstQualified, etc.) only look at
the current QualType and not at any qualifiers that come from sugared
types, meaning that we won't see these qualifiers through, e.g.,
typedefs:
typedef const int CInt;
typedef CInt Self;
Self.isConstQualified() currently returns false!
Various bugs (e.g., PR5383) have cropped up all over the front end due
to such problems. I'm addressing this problem by splitting each
qualifier accessor into two versions:
- the "local" version only returns qualifiers on this particular
QualType instance
- the "normal" version that will eventually combine qualifiers from this
QualType instance with the qualifiers on the canonical type to
produce the full set of qualifiers.
This commit adds the local versions and switches a few callers from
the "normal" version (e.g., isConstQualified) over to the "local"
version (e.g., isLocalConstQualified) when that is the right thing to
do, e.g., because we're printing or serializing the qualifiers. Also,
switch a bunch of
Context.getCanonicalType(T1).getUnqualifiedType() == Context.getCanonicalType(T2).getQualifiedType()
expressions over to
Context.hasSameUnqualifiedType(T1, T2)
llvm-svn: 88969
2009-11-16 21:35:15 +00:00
Devang Patel
37b4b8b1da
revert r88963.
...
llvm-svn: 88965
2009-11-16 21:17:07 +00:00
Devang Patel
b71c28db22
Use TrackingVH to hold forward decl. This one is for RecordType.
...
llvm-svn: 88963
2009-11-16 21:06:35 +00:00
Eli Friedman
00dbf4c3c6
Parallel fix to r88951: use TrackingVH to hold forward decl.
...
llvm-svn: 88962
2009-11-16 21:04:30 +00:00
Eli Friedman
b05d0824c6
Fix valgrind uninitialized error.
...
llvm-svn: 88952
2009-11-16 20:33:31 +00:00
Devang Patel
10909d5faf
Use TrackingVH to hold forward decl.
...
llvm-svn: 88951
2009-11-16 20:09:38 +00:00
Anders Carlsson
0acee6e0d7
Canonicalize the type before trying to create a debug type.
...
llvm-svn: 88808
2009-11-14 21:08:12 +00:00
Anders Carlsson
6037e78149
Have CGDebugInfo::getOrCreateType cache the QualType instead of having every ConvertType overload do it.
...
llvm-svn: 88807
2009-11-14 20:52:05 +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
Devang Patel
94f798c079
"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 locations and types.
...
llvm-svn: 87007
2009-11-12 18:21:39 +00:00
Devang Patel
6e98d7af22
Use getNameAsCString() instead of getName().data()
...
llvm-svn: 87001
2009-11-12 17:49:47 +00:00
Chandler Carruth
bc55fe26c6
Move CompileOptions -> CodeGenOptions, and sink it into the CodeGen library.
...
This resolves the layering violation where CodeGen depended on Frontend.
llvm-svn: 86998
2009-11-12 17:24:48 +00:00
Devang Patel
7bdf096f8d
Do not use StringRef while using DebugInfo interface.
...
llvm-svn: 86915
2009-11-12 00:51:46 +00:00
Devang Patel
5348515193
Do not eagerly set stop point for arguments. This misleads the debugger in identifying beginning of function body. Instead, create new location to attach with llvm.dbg.declare. This location is only used to find the context of the variable by the code generator, and it is not used to emit line number info.
...
llvm-svn: 86862
2009-11-11 19:10:19 +00:00
Devang Patel
af993bf5cc
Attach location info with llvm.dbg.declare.
...
llvm-svn: 86750
2009-11-10 23:07:24 +00:00
Anders Carlsson
3d888e4548
Revert r86315 and add Type::FixedWidthInt to the FIXME cases.
...
llvm-svn: 86320
2009-11-07 01:19:37 +00:00
Devang Patel
5b39e2382f
Do not assert if debug info for certain type is not generated.
...
llvm-svn: 86315
2009-11-07 00:29:05 +00:00
Devang Patel
eef461c230
Do not emit linkage name for global variables. It confuses gdb, because it picks up AT_MIPS_linkage_name and ignores AT_name.
...
llvm-svn: 86308
2009-11-07 00:10:18 +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
Anders Carlsson
8a6512961f
Handle QualifiedNameType and SubstTemplateTypeParmType types in CGDebugInfo::CreateTypeNode.
...
llvm-svn: 86274
2009-11-06 18:45:16 +00:00
Anders Carlsson
25ed5c2f42
Don't assert when trying to generate debug info for vector types. This needs to be fixed eventually...
...
llvm-svn: 86268
2009-11-06 18:24:04 +00:00
Anders Carlsson
eb9bc2ba82
Instead of returning a null DIType for unhandled types, assert.
...
llvm-svn: 86254
2009-11-06 17:01:39 +00:00
Devang Patel
ba3c6681f0
Enable debug info for global variables at -O1+
...
llvm-svn: 86156
2009-11-05 19:13:29 +00:00
Mike Stump
ae2559a221
Fixup the return type of functions.
...
llvm-svn: 84922
2009-10-23 01:52:13 +00:00
Devang Patel
e21912d1ae
Do not eagerly cache DITypes because it allows real struct type to be shadowed by forward declared struct type.
...
llvm-svn: 84659
2009-10-20 19:55:01 +00:00
Devang Patel
e4f2b2a8ac
Encode global variable name in debug info.
...
llvm-svn: 84653
2009-10-20 18:26:30 +00:00
John McCall
c5b8225285
Remove the ConstantArrayType subtypes. This information is preserved in the
...
TypeLoc records for declarations; it should not be necessary to represent it
directly in the type system.
Please complain if you were using these classes and feel you can't replicate
previous functionality using the TypeLoc API.
llvm-svn: 84222
2009-10-16 00:14:28 +00:00
Sanjiv Gupta
84a0287497
Few targets like PIC16 mangle the names of global variables, so retrieve the name
...
from Var itself rather than the decl for DebugInfo metadata.
llvm-svn: 84102
2009-10-14 15:08:34 +00:00
Devang Patel
551e112e99
Encode long double.
...
llvm-svn: 83912
2009-10-12 22:28:31 +00:00
Mike Stump
fc8ff639cb
Allow customization for the producer information in the debug output.
...
llvm-svn: 83659
2009-10-09 18:38:12 +00:00
Devang Patel
542ab5f551
InsertSubprogramStart if ATTACH_DEBUG_INFO_TO_AN_INSN is not defined.
...
llvm-svn: 83419
2009-10-06 21:53:41 +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
581b9ad124
More magic pixie dust.
...
llvm-svn: 83232
2009-10-02 02:30:50 +00:00
Mike Stump
440af3d903
Fix up debug information for block pointers a bit more.
...
llvm-svn: 83231
2009-10-02 02:23:37 +00:00
Mike Stump
017460ab6c
Implement a FIXME. This improves codegen just a tad.
...
llvm-svn: 83221
2009-10-01 22:29:41 +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
John McCall
8ccfcb51ee
Refactor the representation of qualifiers to bring ExtQualType out of the
...
Type hierarchy. Demote 'volatile' to extended-qualifier status. Audit our
use of qualifiers and fix a few places that weren't dealing with qualifiers
quite right; many more remain.
llvm-svn: 82705
2009-09-24 19:53:00 +00:00
Mike Stump
207c680ff3
Fix some typos. WIP. Large alignments don't work yet.
...
llvm-svn: 82512
2009-09-22 02:44:17 +00:00
Mike Stump
2114d7c299
Improve debug info generation for __block variables.
...
llvm-svn: 82508
2009-09-22 02:12:52 +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
c3844bea75
Be sure to use the correct version instead of inventing the wrong one.
...
llvm-svn: 81924
2009-09-15 21:48:34 +00:00
Mike Stump
11289f4280
Remove tabs, and whitespace cleanups.
...
llvm-svn: 81346
2009-09-09 15:08:12 +00:00
John McCall
fcc33b074b
Basic support for representing elaborated type specifiers
...
directly in the AST. The current thinking is to create these
only in C++ mode for efficiency. But for now, they're not being
created at all; patch to follow.
This will let us do things like verify that tags match during
template instantation, as well as signal that an elaborated type
specifier was used for clients that actually care.
Optimally, the TypeLoc hierarchy should be adjusted to carry tag
location information as well.
llvm-svn: 81057
2009-09-05 00:15:47 +00:00
Devang Patel
124095bb18
Rename DIBlock as DILexicalBlock.
...
llvm-svn: 80634
2009-08-31 22:00:32 +00:00
Argyrios Kyrtzidis
e918926d31
Introduce LocInfoType which is a Sema-specific implementation detail.
...
This is a Type subclass that can hold a DeclaratorInfo* when we have type source info coming
out of a declarator that we want to preserve. This is used only at the "border" of Parser/Sema for
passing/getting QualTypes, it does not participate in the type system semantics in any way.
llvm-svn: 79394
2009-08-19 01:28:17 +00:00
Devang Patel
d4bbb08946
Do now overflow while calulating upper bound for zero sized array.
...
llvm-svn: 79043
2009-08-14 20:57:45 +00:00
Devang Patel
6a3b3fe98a
Use DICompositeType->replaceAllUsesWith()
...
llvm-svn: 77228
2009-07-27 18:42:03 +00:00
Devang Patel
06cceef545
Use DICompositeType->replaceAllUsesWith().
...
This requires llvm rev. 76769 or higher.
llvm-svn: 76770
2009-07-22 18:57:00 +00:00
Anders Carlsson
15b73deeea
Revert r75641.
...
llvm-svn: 76327
2009-07-18 19:43:29 +00:00
Steve Naroff
c277ad10f0
Remove ObjCQualifiedInterfaceType:-)
...
llvm-svn: 76321
2009-07-18 15:33:26 +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
Chris Lattner
ff1ee0d7c9
[llvm up] adjust to match mainline.
...
llvm-svn: 75647
2009-07-14 18:18:16 +00:00
Anders Carlsson
466fd0a16d
Rename RecordLayout.h to ASTRecordLayout.h
...
llvm-svn: 75641
2009-07-14 17:29:11 +00:00
Daniel Dunbar
88719a1dd6
Revert r75614 which depend on r75610 (for LLVM), which was reverted.
...
--- Reverse-merging r75614 into '.':
U lib/CodeGen/CGDebugInfo.cpp
llvm-svn: 75639
2009-07-14 16:40:28 +00:00
Chris Lattner
74d3c61532
use new name for method.
...
llvm-svn: 75614
2009-07-14 06:16:43 +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
Devang Patel
9c3a0188cd
Update debug info type cache after fwd decl is replaced by real decl.
...
llvm-svn: 75473
2009-07-13 17:03:14 +00:00
Devang Patel
290b052d43
Fix comment.
...
llvm-svn: 75471
2009-07-13 16:15:54 +00:00
Steve Naroff
7cae42b07a
This patch includes a conceptually simple, but very intrusive/pervasive change.
...
The idea is to segregate Objective-C "object" pointers from general C pointers (utilizing the recently added ObjCObjectPointerType). The fun starts in Sema::GetTypeForDeclarator(), where "SomeInterface *" is now represented by a single AST node (rather than a PointerType whose Pointee is an ObjCInterfaceType). Since a significant amount of code assumed ObjC object pointers where based on C pointers/structs, this patch is very tedious. It should also explain why it is hard to accomplish this in smaller, self-contained patches.
This patch does most of the "heavy lifting" related to moving from PointerType->ObjCObjectPointerType. It doesn't include all potential "cleanups". The good news is additional cleanups can be done later (some are noted in the code). This patch is so large that I didn't want to include any changes that are purely aesthetic.
By making the ObjC types truly built-in, they are much easier to work with (and require fewer "hacks"). For example, there is no need for ASTContext::isObjCIdStructType() or ASTContext::isObjCClassStructType()! We believe this change (and the follow-up cleanups) will pay dividends over time.
Given the amount of code change, I do expect some fallout from this change (though it does pass all of the clang tests). If you notice any problems, please let us know asap! Thanks.
llvm-svn: 75314
2009-07-10 23:34:53 +00:00
Anders Carlsson
ea1cfb415b
Fix a problem that Eli noticed, and that Doug helped me fix.
...
llvm-svn: 75265
2009-07-10 19:20:26 +00:00
Douglas Gregor
04318256b7
Keep track of the Expr used to describe the size of an array type,
...
from Enea Zaffanella!
llvm-svn: 74831
2009-07-06 15:59:29 +00:00
Argyrios Kyrtzidis
cfbfe78e9e
De-ASTContext-ify DeclContext.
...
Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating".
Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit.
llvm-svn: 74506
2009-06-30 02:36:12 +00:00
Chris Lattner
c61089a6c2
Key decisions about 'bool' vs '_Bool' to be based on a new flag in langoptions.
...
This is simple enough, but then I thought it would be nice to make PrintingPolicy
get a LangOptions so that various things can key off "bool" and "C++" independently.
This spiraled out of control. There are many fixme's, but I think things are slightly
better than they were before.
One thing that can be improved: CFG should probably have an ASTContext pointer in it,
which would simplify its clients.
llvm-svn: 74493
2009-06-30 01:26:17 +00:00
Devang Patel
0d425350b2
Revrt PR4228 fix for now.
...
llvm-svn: 74304
2009-06-26 18:32:22 +00:00