Commit Graph

256 Commits

Author SHA1 Message Date
Steve Naroff 0d7c6dbae8 Cleanup ObjCSuperRefExpr (remove last usage and AST node:-).
llvm-svn: 54617
2008-08-10 19:10:41 +00:00
Anders Carlsson d361a7df78 Remove the old evaluator code.
llvm-svn: 54615
2008-08-10 17:03:01 +00:00
Chris Lattner 6307f19726 rename PreDefinedExpr -> PredefinedExpr
llvm-svn: 54605
2008-08-10 01:53:14 +00:00
Argyrios Kyrtzidis 8a23f55186 Add some C++ Decl statistics.
llvm-svn: 54604
2008-08-10 01:47:31 +00:00
Eli Friedman 5ce8cc7554 Remove the ICE pointer cast hack; the issue this was working around is
now fixed in an alternate way.

llvm-svn: 54598
2008-08-09 22:24:21 +00:00
Eli Friedman 5cf85cc977 Turn on the new constant expression evaluator; it isn't
anywhere near complete, but I don't know of any issues, and it can 
handle enough to allow removing the I-C-E pointer cast hack.

llvm-svn: 54597
2008-08-09 22:21:56 +00:00
Chris Lattner 572100b648 Fix PR2400 by more graceful handling of invalid decls. Don't try to layout
an invalid struct decl.  Thanks to Martin Doucha for the 
isIncompleteArrayType part of this patch.

llvm-svn: 54592
2008-08-09 21:35:13 +00:00
Argyrios Kyrtzidis cbad725bf4 Change 'Wchar' to 'WChar' casing, for consistency.
No functionality change.

llvm-svn: 54588
2008-08-09 17:20:01 +00:00
Argyrios Kyrtzidis d8f2f5f1b7 Handle WChar inside BuiltinType::getName().
llvm-svn: 54587
2008-08-09 17:11:33 +00:00
Argyrios Kyrtzidis 40e9e4828f Implement support for the 'wchar_t' C++ type.
llvm-svn: 54585
2008-08-09 16:51:54 +00:00
Argyrios Kyrtzidis 6bd44afc2f Destroy and delete the FieldDecl members of a RecordDecl.
llvm-svn: 54527
2008-08-08 14:08:55 +00:00
Argyrios Kyrtzidis faf0876cab Add CXXRecordType class.
llvm-svn: 54488
2008-08-07 20:55:28 +00:00
Ted Kremenek 8889bb3ff4 Cleanup some processing with DeclStmt, and gradually start using the internal BumpPtrAllocator to allocator more of CFG's data structures.
llvm-svn: 54433
2008-08-06 23:20:50 +00:00
Ted Kremenek e26ccf3553 Always construct the BumpPtrAllocator used by CFG as an instance variable.
llvm-svn: 54429
2008-08-06 22:22:32 +00:00
Ted Kremenek 66db7d66de Fix serialization of DeclStmt.
llvm-svn: 54428
2008-08-06 22:17:30 +00:00
Ted Kremenek 8d78a09a56 Reorder serialization methods.
When serializing DeclStmt, encode a bit indicating whether or not the DeclStmt owns the Decl.  This is an interim solution.

llvm-svn: 54410
2008-08-06 15:50:59 +00:00
Nico Weber de565e3bc9 remove spaces at eol to test commit access
llvm-svn: 54381
2008-08-05 23:15:29 +00:00
Ted Kremenek 4f8792b616 Added decl_iterator to DeclStmt to provide an abstract interface to iterate over the ScopedDecls of a DeclStmt.
Updated a few clients of DeclStmt::getNextDeclarator() to use decl_iterator instead.  Will update other clients after additional testing.

llvm-svn: 54368
2008-08-05 20:46:55 +00:00
Ted Kremenek be9b33bf0f Nico Weber:
"the attached patch fixes some typos, 80 cols violations, etc. in comments."

llvm-svn: 54328
2008-08-04 22:51:42 +00:00
Chris Lattner 7adf076088 Finally fix PR2189. This makes a fairly invasive but important change to
move getAsArrayType into ASTContext instead of being a method on type.
This is required because getAsArrayType(const AT), where AT is a typedef
for "int[10]" needs to return ArrayType(const int, 10).

Fixing this greatly simplifies getArrayDecayedType, which is a good sign.

llvm-svn: 54317
2008-08-04 07:31:14 +00:00
Eli Friedman bd84059cdb Minor tweak plus a couple of FIXMEs.
llvm-svn: 54119
2008-07-27 05:46:18 +00:00
Ted Kremenek 192510920e Fix serialization for TypedefType by allowing TypedefType to access the internal CanonicalType stored in Type.
The test case Serialization/stmt_exprs.c now passes.

llvm-svn: 54117
2008-07-27 03:47:53 +00:00
Chris Lattner 872eb55f5e make "call foo.dump()" and "call foo->dump()" work in GDB,
with QualTypes and Types.

llvm-svn: 54116
2008-07-27 00:48:22 +00:00
Chris Lattner 401cc23c4d Comment out the last call to QualType::getCanonicalType. This *breaks*
Serialization/stmt_exprs.c, but I don't know the right solution.  Will fix
when I get a chance to talk to Ted about it.

llvm-svn: 54109
2008-07-26 22:40:28 +00:00
Chris Lattner 574dee6cac change more instances of QualType::getCanonicalType to call
ASTContext::getCanonicalType instead (PR2189)

llvm-svn: 54105
2008-07-26 22:17:49 +00:00
Chris Lattner 6731544be7 convert more code to use ASTContext to get canonical types instead
of doing it directly.  This is required for PR2189.

llvm-svn: 54102
2008-07-26 21:30:36 +00:00
Chris Lattner 944d306371 fix some problems handling stmtexprs with labels (PR2374), and
improve 'expression unused' diagnostics for stmtexprs.

llvm-svn: 54098
2008-07-26 19:51:01 +00:00
Chris Lattner 06afbebbdd fix an extraneous blank line in -ast-dump output.
llvm-svn: 54097
2008-07-26 19:24:43 +00:00
Chris Lattner a075e63bbc fix several problems with the protocol qualified id handling where id was implicit.
First, fix canonical type handling of these, since protocol qualified id's are always
canonical.  Next, enhance SemaType to actually make these when used (instead of int)
allowing them to actually be used when appropriate.  Finally remove a bunch of logic
relating to the mishandling of canonical types with protocol-qual id's.  This fixes
rdar://5986251

llvm-svn: 54083
2008-07-26 00:46:50 +00:00
Chris Lattner 2841fc0e7b fix 80 col violation.
llvm-svn: 54075
2008-07-25 23:30:42 +00:00
Chris Lattner 903eb518e6 Fix rdar://6095136, various crashes with incomplete enum types.
llvm-svn: 54074
2008-07-25 23:18:17 +00:00
Chris Lattner 6bf59d82c8 minor cleanup
llvm-svn: 54073
2008-07-25 23:07:18 +00:00
Daniel Dunbar c9809a9d68 Remove unused ASTConsumer::HandleTopLevelDeclaration
llvm-svn: 54071
2008-07-25 22:39:30 +00:00
Chris Lattner ec8996d771 Add support for __extension__ as an lvalue. rdar://6097308
llvm-svn: 54033
2008-07-25 18:07:19 +00:00
Ted Kremenek 77c51b2aa3 Move isObjCObjectPointerType() from Sema to ASTContext.
llvm-svn: 53998
2008-07-24 23:58:27 +00:00
Ted Kremenek 1692342e58 Added UnaryOperator::isPrefix().
llvm-svn: 53963
2008-07-23 22:18:43 +00:00
Ted Kremenek 73295fab89 When constructing an ObjCIvarDecl object in Sema, provide its visibility up front instead of setting it afterwards.
This change also fixes a subtle bug where the access control of an ivar would be initialized to garbage if we didn't have an explicit visibility specifier (e.g., @private).

llvm-svn: 53955
2008-07-23 18:04:17 +00:00
Chris Lattner 390d39ac7e move two more lists of protocols over to use ObjCList<ObjCProtocolDecl>,
simplifying code along the way and fixing a problem and memory leak or two.

llvm-svn: 53876
2008-07-21 21:32:27 +00:00
Chris Lattner d004505b74 introduce a new ObjCList templated class and start moving
various objc lists over to it.  First up, the protocol list 
on ObjCInterfaceDecl.

llvm-svn: 53856
2008-07-21 18:19:38 +00:00
Chris Lattner 65056c48a7 rename setReferencedProtocolList -> addReferencedProtocols to
be consistent with ObjCInterfaceDecl.

llvm-svn: 53852
2008-07-21 17:23:15 +00:00
Chris Lattner ca1e848588 Switch initialization of the protocol list for an interface decl to use
the standard "set these as the list of protocols" interface instead of a 
strange "set this as the size and then set each one to the value" interface.
The problem with the later is that it a) is completely different from 
everything else, b) is awkward, and c) doesn't handle the case when a
referenced protocol is invalid: it set it to null.

This meant that all clients downstream would have to handle null protocols
in the protocol list, and empirically they didn't.  Fix this by not setting
invalid protocols in the referenced protocol list, fixing the crash on 
test/Sema/objc-interface-1.m

While I'm at it, clean up some locations so that we produce:

t.m:1:25: error: cannot find interface declaration for 'NSObject', superclass of 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
~~~~~~~~~~~~~~~~~~~~~   ^

instead of:

t.m:1:1: error: cannot find interface declaration for 'NSObject', superclass of 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
^

llvm-svn: 53846
2008-07-21 07:06:49 +00:00
Chris Lattner 419f699b55 use iterators instead of direct access to protocol list.
llvm-svn: 53831
2008-07-21 05:19:23 +00:00
Steve Naroff de7d0f69ba Two fixes:
- Make sure ObjCIvarDecl propagates the bitfield width.
- RewriteObjC::SynthesizeIvarOffsetComputation(): Avoid using the __OFFSETOF__ mumbo jumbo for bitfields (since it isn't legal C). This fixes <rdar://problem/5986079> clang ObjC rewriter: bitfields and ivar access don't mix.

llvm-svn: 53694
2008-07-16 18:22:22 +00:00
Chris Lattner 477c4be1e9 expand casts to handle what isIntegerConstantExpr handles.
Casts from pointers remain a problem. :)

llvm-svn: 53501
2008-07-12 01:15:53 +00:00
Chris Lattner 7174bf3722 Add support for __builtin_type_compatible_p, enums, etc.
llvm-svn: 53500
2008-07-12 00:38:25 +00:00
Chris Lattner 9941570ce9 start remembering diagnostics for various cases, add some missing
code.  Switch to Eli's getIntWidth method.

llvm-svn: 53499
2008-07-12 00:14:42 +00:00
Chris Lattner cdf34e7668 Provide a structure for passing down 'is evaluated' and passing up
diagnosic+loc info for i-c-e evaluation.

llvm-svn: 53490
2008-07-11 22:52:41 +00:00
Chris Lattner f09ad16cfc simplify some code a bit.
llvm-svn: 53477
2008-07-11 22:15:16 +00:00
Chris Lattner f8d7f72956 share code between sizeof(expr) and sizeof(type)
llvm-svn: 53475
2008-07-11 21:24:13 +00:00
Chris Lattner b062dcc17b implement support for __extension__, make sure the result of a
comparison has the right width.

llvm-svn: 53469
2008-07-11 19:29:32 +00:00