Commit Graph

6731 Commits

Author SHA1 Message Date
Chris Lattner e3f863a388 fix misleading comment.
llvm-svn: 57396
2008-10-12 01:34:51 +00:00
Chris Lattner 7c2e9809b1 Simplify raw mode lexing by treating an unterminate /**/ comment the
same we we do an unterminated string or character literal.  This makes
it so we can guarantee that the lexer never calls into the 
preprocessor (which would be suicide for a raw lexer).

llvm-svn: 57395
2008-10-12 01:31:51 +00:00
Chris Lattner 6b0c5ad096 add a comment.
llvm-svn: 57394
2008-10-12 01:23:27 +00:00
Chris Lattner 50c9050037 Change how raw lexers are handled: instead of creating them and then
using LexRawToken, create one and use LexFromRawLexer.  This avoids
twiddling the RawLexer flag around and simplifies some code (even 
speeding raw lexing up a tiny bit).

This change also improves the token paster to use a Lexer on the stack
instead of new/deleting it. 

llvm-svn: 57393
2008-10-12 01:15:46 +00:00
Chris Lattner 5d3e26a4f6 silence release-assert warnings.
llvm-svn: 57392
2008-10-12 00:31:50 +00:00
Chris Lattner 79ef843533 silence some release-assert warnings.
llvm-svn: 57391
2008-10-12 00:28:42 +00:00
Chris Lattner e05f534628 silence a bunch of warnings in a release-assert build.
llvm-svn: 57390
2008-10-12 00:26:57 +00:00
Chris Lattner 87e97ea7b8 improve a comment.
llvm-svn: 57389
2008-10-12 00:23:07 +00:00
Steve Naroff b2b5540c40 Add DeclGroup.cpp.
llvm-svn: 57354
2008-10-10 16:41:38 +00:00
Steve Naroff 8022c30aaa Fix/simplify RewriteBlocks::RewriteBlockPointerFunctionArgs().
This completes the fix for <rdar://problem/6272905> clang block rewriter: parameter to function not imported into block?.

llvm-svn: 57350
2008-10-10 15:33:34 +00:00
Seo Sanghyeon c9e7c272da Tests for return statement checks
llvm-svn: 57341
2008-10-10 07:20:06 +00:00
Steve Naroff 1d95e5a531 Final phase of converting BlockDecls over to DeclContext. This is unfortunately a largish/complex diff, however it was necessry to pass all the current block tests.
llvm-svn: 57337
2008-10-10 01:28:17 +00:00
Daniel Dunbar eca513d945 Lift EmitTargetBuiltinExpr out of EmitBuiltinExpr.
llvm-svn: 57335
2008-10-10 00:24:54 +00:00
Daniel Dunbar faa4f50b71 Disable blocks support in C++ mode.
llvm-svn: 57334
2008-10-10 00:20:52 +00:00
Ted Kremenek 63cfae34fd Add missing newline.
llvm-svn: 57333
2008-10-10 00:17:08 +00:00
Dale Johannesen c48814bc98 Adjust calls to APFloat conversion for new interface.
llvm-svn: 57332
2008-10-09 23:02:32 +00:00
Zhongxing Xu cc06b463f5 Check some cases for previous patch. Make the code more robust.
llvm-svn: 57317
2008-10-09 03:19:06 +00:00
Argyrios Kyrtzidis 1207d31952 Fix a bug that crashed clang when parsing this:
class C {
  static const int number = 50;
  static int arr[number];
};

Here's how it worked:
-GetTypeForDeclarator was called from both Sema::ActOnCXXMemberDeclarator and Sema::ActOnDeclarator.
-VariableArrayTypes are not uniqued so two VariableArrayTypes were created with the same DeclRefExpr.
-On exit they both tried to destroy that one DeclRefExpr.

The fix is not to use GetTypeForDeclarator from the Sema::ActOnCXXMemberDeclarator.

llvm-svn: 57313
2008-10-08 22:20:31 +00:00
Steve Naroff 44078b95ee Instantiate the BlockDecl in ActOnBlockStart() so we can use it as a DeclContext.
This required changes to attach the compound statement later on (like we do for functions).

llvm-svn: 57304
2008-10-08 18:44:00 +00:00
Ted Kremenek 944375abae Update checker build.
llvm-svn: 57303
2008-10-08 18:32:06 +00:00
Steve Naroff 35530480c2 Touchup the rewriter to handle the new BlockExpr->BlockDecl dance.
llvm-svn: 57299
2008-10-08 17:31:13 +00:00
Steve Naroff 415d3d570a - Add BlockDecl AST node.
- Modify BlockExpr to reference the BlockDecl.

This is "cleanup" necessary to improve our lookup semantics for blocks (to fix <rdar://problem/6272905> clang block rewriter: parameter to function not imported into block?).

Still some follow-up work to finish this (forthcoming).

llvm-svn: 57298
2008-10-08 17:01:13 +00:00
Zhongxing Xu d9959aee34 This is the first step to implement a field-sensitive store model. Other things are simplified: no heap shape assumption, no parameter alias assumption, etc.
llvm-svn: 57285
2008-10-08 02:50:44 +00:00
Ted Kremenek 587a44fe3d A little more tweaking with StmtIterator and SizeOfAlignofExpr. A recent commit actually introduced a regression, not fixed a bug.
llvm-svn: 57282
2008-10-07 23:35:42 +00:00
Ted Kremenek 9bb286ff43 Migrate DeclStmt over to using a DeclGroup instead of a pointer to a ScopedDecl*.
This also removes the ugly hack needed in CFG.cpp for subclassing DeclStmt to create a DeclStmt with one Decl*.

llvm-svn: 57275
2008-10-07 23:09:49 +00:00
Ted Kremenek 5ee6292e32 Add #include (introduced by dependence on DeclGroup)
llvm-svn: 57274
2008-10-07 23:08:39 +00:00
Ted Kremenek 4faf673d7f Fixed a masked bug when iterating over the child expressions of SizeOfAlignOfTypeExpr. This bug was unmasked by recent changes to StmtIterator.
llvm-svn: 57273
2008-10-07 23:07:10 +00:00
Ted Kremenek 12183e25aa Add const_iterator to DeclGroup.
Serialization for OwningDeclGroupRefs now works.

llvm-svn: 57272
2008-10-07 23:06:01 +00:00
Ted Kremenek f9638bac59 Add StmtIterator support for DeclGroups.
llvm-svn: 57271
2008-10-07 23:04:14 +00:00
Argyrios Kyrtzidis 8ae3684aa9 In ParseParenDeclarator match "D.setGroupingParens(true);" with another setGroupingParens call after the ')' is parsed.
Fixes this bug:
  int (x)(0); // error, expected function declarator where the '(0)' initializer is

llvm-svn: 57241
2008-10-07 10:21:57 +00:00
Zhongxing Xu de7509f01a Added a function call case that generates sink nodes.
llvm-svn: 57240
2008-10-07 10:06:03 +00:00
Zhongxing Xu f5e7c90c46 Migrate MemRegionManager from StateManager to StoreManager.
llvm-svn: 57225
2008-10-07 01:31:04 +00:00
Ted Kremenek 6553748599 Added prototype serialization code for DeclGroup.
llvm-svn: 57222
2008-10-06 23:49:24 +00:00
Argyrios Kyrtzidis 7b41f721b4 Use getCustomDiagID() instead of specifying the diagnostic in the 'DiagnosticKinds.def' file.
llvm-svn: 57220
2008-10-06 23:16:35 +00:00
Argyrios Kyrtzidis 997d00dd13 Simplify handling of direct initializers by letting Sema::AddInitializerToDecl handle conversions, instead of using Sema::ActOnCXXTypeConstructExpr.
Additional benefit is that diagnostics are the same for both direct-initialization and copy-initialization.

In the case of "int x( expression );":
-The Init expression of VarDecl 'x' will be the expression inside the parentheses.
-VarDecl::hasCXXDirectInitializer for VarDecl 'x' will return true to let clients distinguish from "int x = expression ;".

llvm-svn: 57219
2008-10-06 23:08:37 +00:00
Ted Kremenek 21cc560188 Remove DeclStmt::getDecl(). Now clients of DeclStmt must explicitly reason about a DeclStmt referring to a collection of Decls.
llvm-svn: 57217
2008-10-06 22:51:42 +00:00
Ted Kremenek db7f2a74db Explicitly access the first Decl* referenced by a DeclStmt instead of using "getDecl()." Added a FIXME indicating that the call to RewriteObjCQualifiedInterfaceTypes() is meant to modifying the type-specifier; hopefully this will be a little more clean once DeclGroups contain type specifiers.
llvm-svn: 57216
2008-10-06 22:45:07 +00:00
Ted Kremenek 5b6f8ee7b9 Use "DeclStmt::getSolitaryDecl()" when accessing the DeclStmt of an @catch.
llvm-svn: 57215
2008-10-06 22:39:38 +00:00
Ted Kremenek 6d60a4ec19 Modified DeclGroupRef to always load/store the internal pointer value as Decl*. This hopefully will obviate any concerns with violating strict type-aliasing issues.
llvm-svn: 57213
2008-10-06 22:17:16 +00:00
Ted Kremenek 292b3842a0 Use DeclStmt::getSolitaryDecl() instead of DeclStmt::getDecl() when rewriting Objective-c foreach statements.
llvm-svn: 57212
2008-10-06 22:16:13 +00:00
Ted Kremenek 3fef35736e Use DeclStmt::getSolitaryDecl() instead of DeclStmt::getDecl() when processing the Decl of an Objective-C foreach statement.
llvm-svn: 57209
2008-10-06 20:59:48 +00:00
Ted Kremenek a7297be859 Use DeclStmt::getSolitaryDecl() instead of DeclStmt::getDecl() when processing the Decl of a @catch statement.
llvm-svn: 57208
2008-10-06 20:58:56 +00:00
Ted Kremenek 11b004216c When processing Objective-C foreach statements, first check to see if the statement has a DeclStmt with a single Decl. Afterwards, use DeclStmt::getSolitaryDecl() to access that Decl (thus avoiding an assertion being triggered). These changes remove an unneeded use of ScopedDecl::getNextDeclarator() and DeclStmt::getDecl().
llvm-svn: 57207
2008-10-06 20:58:11 +00:00
Ted Kremenek ef52c641e7 Use DeclStmt::decl_iterator to walk a group of Decl*'s instead of using the ScopedDecl chain.
llvm-svn: 57206
2008-10-06 20:56:19 +00:00
Ted Kremenek a86db10563 Don't use DeclStmt::getDecl() to serialize out DeclStmt; use TheDecl directly.
This patch precedes removing getDecl() DeclStmt::entirely.

llvm-svn: 57205
2008-10-06 20:55:44 +00:00
Ted Kremenek acf920dd39 Add DeclStmt::hasSolitaryDecl() and DeclStmt::getSolitaryDecl()
llvm-svn: 57204
2008-10-06 20:54:44 +00:00
Ted Kremenek 7c2d69f007 Use "unsigned" instead of "int" for i to remove a "comparison between unsigned and signed" warning (potential integer overflow).
llvm-svn: 57201
2008-10-06 20:35:04 +00:00
Anders Carlsson 5f7ee680f8 Add 'x' constraint character.
llvm-svn: 57198
2008-10-06 19:17:39 +00:00
Ted Kremenek dcd6632463 Use the DeclStmt::decl_iterator to get the first decl in a DeclStmt instead of using DeclStmt::getDecl().
llvm-svn: 57196
2008-10-06 18:48:35 +00:00
Ted Kremenek 53532c1fda In RewriteFunctionBody, using DeclStmt::decl_iterator to rewrite the Decls in a DeclStmt instead of using getDecl() to fetch the first Decl.
Steve: Please review this patch.  'make test' passes, and my cursory scan of the rewriter leads me to believe this doesn't break anything, but I'm not sure.
llvm-svn: 57195
2008-10-06 18:47:09 +00:00