Commit Graph

115 Commits

Author SHA1 Message Date
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
Anders Carlsson 81df7b89de Add a DecltypeType type.
llvm-svn: 74099
2009-06-24 19:06:50 +00:00
Steve Naroff fb4330f255 First step toward fixing <rdar://problem/6613046> refactor clang objc type representation.
Add a type (ObjCObjectPointerType) and remove a type (ObjCQualifiedIdType).

This large/tedious patch is just a first step. Next step is to remove ObjCQualifiedInterfaceType. After that, I will remove the magic TypedefType for 'id' (installed by Sema). This work will enable various simplifications throughout clang (when dealing with ObjC types). 

No functionality change.

llvm-svn: 73649
2009-06-17 22:40:22 +00:00
Devang Patel 9fc4341eec It is possible that main input file does not have any symbol with debug info. To handle this edge case, always create main compile unit first.
This fixes PR 4228.

llvm-svn: 73520
2009-06-16 18:02:02 +00:00
Douglas Gregor 7de5966d76 Create a new PrintingPolicy class, which we pass down through the AST
printing logic to help customize the output. For now, we use this
rather than a special flag to suppress the "struct" when printing
"struct X" and to print the Boolean type as "bool" in C++ but "_Bool"
in C.

llvm-svn: 72590
2009-05-29 20:38:28 +00:00
Daniel Dunbar bee70bd1e7 Use .data() instead of &...[0].
- Just SmallVectors this time.

llvm-svn: 72432
2009-05-26 19:40:20 +00:00
Jay Foad 7d0479f2c2 Use v.data() instead of &v[0] when SmallVector v might be empty.
llvm-svn: 72210
2009-05-21 09:52:38 +00:00
Daniel Dunbar c61d0bd8f1 Debug info: Initialize runtime language field correctly for Objective-C
interface types.

llvm-svn: 72036
2009-05-18 20:51:58 +00:00
Mike Stump 31f099c8c2 Enhance debug information for block literals. Radar 6867696
llvm-svn: 71763
2009-05-14 02:03:51 +00:00
Daniel Dunbar 7911002bf9 We need to specify the "linkage name" to the subprogram now that we
emit the correct "display name". I suspect we need more work here, see
FIXME for example.

llvm-svn: 71761
2009-05-14 01:45:24 +00:00
Daniel Dunbar 0beb7894c4 Make sure not to include the LLVM asm prefix in function names for
debug info.

llvm-svn: 71736
2009-05-13 23:08:57 +00:00
Chris Lattner 448a228521 fix some more cases where we'd emit a file with a line of 0 for implicit
types.  In this case, it was objc_selector and objc_class.  This fixes
rdar://6852754 - clang sometimes generates incorrect/unknown file/line info for DW_TAG__structure_type dies

llvm-svn: 70969
2009-05-05 05:16:17 +00:00
Chris Lattner f216fd96fe Do not generate bogus location info for DW_TAG_inheritance
DIEs.  We were generating a loc with line of 0 and a file.
These tags do not need locations at all, just remove it.
this fixes rdar://6852792 - Clang generates incorrect (and unnecessary) file and line info for DW_TAG_inheritance dies

llvm-svn: 70966
2009-05-05 05:05:36 +00:00
Chris Lattner 362d8ae328 Fix generated debug info for decls with no location (which include self/_cmd
in ObjC) to not emit file/line location information.  Previously
we would output a file with bogus line information.  This fixes:
rdar://6852814 - Clang generates incorrect file & line info for automatic/understood formal parameters for objc-programs

llvm-svn: 70965
2009-05-05 04:57:08 +00:00
Eli Friedman 2ad7e17096 PR4143: don't crash generating debug info for incomplete enum types.
llvm-svn: 70825
2009-05-04 04:39:55 +00:00
Chris Lattner c6ad258a6b When creating a dwarf record type for an objc interface, make sure to propagate
the runtime version number onto it, so that the debugger knows it's an objc
interface, not a C struct.  rdar://6848435

llvm-svn: 70618
2009-05-02 01:13:16 +00:00
Chris Lattner 44f3ea7339 capture whether optimizations are enabled or not in debug info
llvm-svn: 70617
2009-05-02 01:04:13 +00:00
Chris Lattner 5912de15d0 encode the version of the objc runtime into the dwarf compile unit. rdar://6848435,
several other fixes coming.

llvm-svn: 70616
2009-05-02 01:00:04 +00:00
Devang Patel df348f10b6 While generating debug info ignore unnamed fields.
llvm-svn: 70266
2009-04-27 22:40:36 +00:00
Eli Friedman 1c4a175aef Remove getIntegerConstantExprValue in favor of using EvaluateAsInt.
llvm-svn: 70145
2009-04-26 19:19:15 +00:00
Devang Patel a6acb390e7 Handle corner case where clang-cc is invoked directly to compile preprocessed source file without -main-file-name. In this case, CDDebugInfo is not able identify correct main source file becase SM.isFromMainFile() returns true for locations from header files as well as locations from main source file.
This patch takes conservative approach by not emitting more then one compile unit with isMain bit set.

llvm-svn: 69902
2009-04-23 18:09:16 +00:00
Chris Lattner 7b0344f656 implement debug info for _Complex.
llvm-svn: 69873
2009-04-23 06:13:01 +00:00
Chris Lattner 43e6f8c08b implement debug info support for id<proto> and interface<proto>
llvm-svn: 69784
2009-04-22 06:58:56 +00:00
Chris Lattner ad8f750f71 ObjCQualifiedClass is dead, remove it.
llvm-svn: 69783
2009-04-22 06:50:37 +00:00
Chris Lattner 96adcd5e74 silence a warning, I need to talk to Devang about this code.
llvm-svn: 69517
2009-04-19 06:50:29 +00:00
Devang Patel 12f0dea922 Use PresumedLoc to record line number in debug info entries.
llvm-svn: 69389
2009-04-17 21:35:15 +00:00
Devang Patel 75009454e3 Appropriately set file name and directory name in debug info compile units.
llvm-svn: 69387
2009-04-17 21:06:59 +00:00
Douglas Gregor bcced4ec31 Propagate the ASTContext to various AST traversal and lookup functions.
No functionality change (really).

llvm-svn: 68726
2009-04-09 21:40:53 +00:00
Devang Patel 2ac33a08d5 Use presumed location to get line number info.
llvm-svn: 68630
2009-04-08 19:47:04 +00:00
Daniel Dunbar 3b358a3d83 Make debug info work when using -save-temps.
- This is pretty ugly, but the most obvious solution. Chime in if you
   have a nicer one.

 - The problem is that with -save-temps, clang-cc has no idea what the
   name of the original input file is. However, the user expects to be
   able to set breakpoints based on the input file name.

 - We support this by providing a new option -main-file-name (similar
   to -dumpbase used by gcc) which allows the driver to pass in the
   original file name.

 - <rdar://problem/6753383> building with clang using --save-temps
   gets the compile unit name from the .i file...

llvm-svn: 68595
2009-04-08 05:11:16 +00:00