Commit Graph

31 Commits

Author SHA1 Message Date
Douglas Gregor 77324f3854 Introduction the DeclarationName class, as a single, general method of
representing the names of declarations in the C family of
languages. DeclarationName is used in NamedDecl to store the name of
the declaration (naturally), and ObjCMethodDecl is now a NamedDecl.

llvm-svn: 59441
2008-11-17 14:58:09 +00:00
Steve Naroff 3e7ced125b Fix <rdar://problem/6336774> clang block rewriter: Assertion failed: Offset+NumBytes <= size() && "Invalid region to erase!", file c:\cygwin\home\Administrator\llvm\to ols\clang\include\clang/Rewrite/RewriteRope.h, line 219.
llvm-svn: 58607
2008-11-03 11:20:24 +00:00
Steve Naroff 9eca18e4ed Fix <rdar://problem/6312683> clang block rewriter:
llvm-svn: 58011
2008-10-22 23:42:04 +00:00
Steve Naroff e17f52fc23 Tighten up blocks rewriter to handle casts and some other interesting cases.
This fixes <rdar://problem/6289007> clang block rewriter: ^ in cast is not rewritten.

llvm-svn: 57591
2008-10-15 18:38:58 +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
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
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
Steve Naroff 8f9be42072 Remove old diag that alerted the user to a limitation we no longer have:-)
llvm-svn: 57086
2008-10-05 00:12:46 +00:00
Steve Naroff 02da7667d2 Create a function, eliminating some redundancy between SynthesizeBlockInitExpr() and SynthesizeBlockLiterals().
llvm-svn: 57083
2008-10-05 00:06:12 +00:00
Steve Naroff c7a80a5533 Finish implementing copy/dispose helpers for imported block decls.
llvm-svn: 57082
2008-10-04 23:47:37 +00:00
Steve Naroff 4017d15fed Add indirection required for byref BlockDeclRefExpr's.
llvm-svn: 57063
2008-10-04 18:52:47 +00:00
Steve Naroff 564e97a2de Handle bookkeeping for imported blocks (in SynthesizeBlockImpl).
This code was "lost" with my recent changes to SynthesizeBlockFunc.

llvm-svn: 57056
2008-10-04 18:00:11 +00:00
Steve Naroff 87b9d298b8 Cut/paste error...need to use the expression "name" for member references (or other complex expressions that can embed a block pointer type)
llvm-svn: 57054
2008-10-04 17:45:51 +00:00
Steve Naroff 756efbc7f7 Clear the map that associated the rewritten block with it's corresponding BlockExpr.
llvm-svn: 57053
2008-10-04 17:10:02 +00:00
Steve Naroff 5f96e4dffc Moved main control flow functions to bottom of file.
Reworked control flow to:
- rewrite the block expr body "in place".
- used Chris's new rewriter hook "getRewritenText" to "lift" the text for later use.
- finally, we do the block expr text replacement.

llvm-svn: 57052
2008-10-04 17:06:23 +00:00
Steve Naroff 3d5a11c622 Remove an old/vacuous if clause.
llvm-svn: 57036
2008-10-03 23:00:50 +00:00
Steve Naroff e3e45a8c43 More fun & games with the block rewriter.
llvm-svn: 57028
2008-10-03 20:28:15 +00:00
Steve Naroff a2d71df5b9 Rewrite global block expressions.
llvm-svn: 57004
2008-10-03 15:38:09 +00:00
Steve Naroff 239f6f9b24 - Add a convenience constructor to Type.
- Many rewriter modifications.

llvm-svn: 57003
2008-10-03 15:04:50 +00:00
Steve Naroff 7bf080c9cc Rework SynthesizeBlockImpl() to include a constructor.
llvm-svn: 57001
2008-10-03 12:09:49 +00:00
Steve Naroff 49428dbdd5 Get the right location to insert the synthesized block literals/functions.
llvm-svn: 56987
2008-10-03 00:12:09 +00:00
Steve Naroff ddb1492288 Name changes and some cleanup of preamble.
llvm-svn: 56984
2008-10-02 23:30:43 +00:00
Steve Naroff d40a39626c Changed Sema::CheckForConstantInitializer to allow global block literals.
This commit also includes some name changes in the blocks rewriter (no functionality change).

llvm-svn: 56955
2008-10-02 17:12:56 +00:00
Steve Naroff 4efed31acf Fix a couple harmless warnings when compiling optimized with gcc (reported by mrs@apple.com).
llvm-svn: 56591
2008-09-24 22:46:45 +00:00
Steve Naroff c792570eb1 Fix some const-ness to keep the VisualStudio C++ compiler happy.
llvm-svn: 56560
2008-09-24 17:22:34 +00:00
Steve Naroff 92559af851 RewriteBlocks::RewriteBlockPointerDecl(): Handle TypedefDecl's and VarDecl's uniformly.
llvm-svn: 56500
2008-09-23 21:15:53 +00:00
Steve Naroff 87930ca38f Teach block rewriter to replace '^' with '*' in VarDecls.
Since we don't have DeclGroup's and location information for types, there is some fancy footwork to do this fairly reliably.

O.K...it's a kludge. One day, we can use this as motivation to do this more gracefully:-)

llvm-svn: 56499
2008-09-23 19:24:41 +00:00
Steve Naroff 9779e92fa4 Add driver support for invoking block rewriter.
Also tweaked the create function to take an explicit output file.

llvm-svn: 56305
2008-09-18 14:10:13 +00:00
Steve Naroff 43bafa78b3 Remove BlockStmtExpr.
Block literals are now represented by the concrete BlockExpr class.
This is cleanup (removes a FIXME).
No functionality change.

llvm-svn: 56288
2008-09-17 18:37:59 +00:00
Steve Naroff 2da868e9c2 Add support for rewriting blocks...
llvm-svn: 56266
2008-09-17 00:13:27 +00:00