summaryrefslogtreecommitdiffstats
path: root/clang/Driver/RewriteBlocks.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move <root>/Driver into <root>/tools/clang-cc.Daniel Dunbar2009-03-241-1146/+0
| | | | | | Again, I tried to update cmake but it is untested. llvm-svn: 67605
* API fix: All "bodies" for functions, Objective-C methods, blocks, are assumed toTed Kremenek2009-03-121-2/+2
| | | | | | | | be CompoundStmts. I think this is a valid assumption, and felt that the API should reflect it. Others please validate this assumption to make sure I didn't break anything. llvm-svn: 66814
* Create a new TypeNodes.def file that enumerates all of the types,Douglas Gregor2009-02-261-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | giving them rough classifications (normal types, never-canonical types, always-dependent types, abstract type representations) and making it far easier to make sure that we've hit all of the cases when decoding types. Switched some switch() statements on the type class over to using this mechanism, and filtering out those things we don't care about. For example, CodeGen should never see always-dependent or non-canonical types, while debug info generation should never see always-dependent types. More switch() statements on the type class need to be moved over to using this approach, so that we'll get warnings when we add a new type then fail to account for it somewhere in the compiler. As part of this, some types have been renamed: TypeOfExpr -> TypeOfExprType FunctionTypeProto -> FunctionProtoType FunctionTypeNoProto -> FunctionNoProtoType There shouldn't be any functionality change... llvm-svn: 65591
* use simpler methodChris Lattner2009-01-251-1/+1
| | | | llvm-svn: 62974
* Remove ScopedDecl, collapsing all of its functionality into Decl, soDouglas Gregor2009-01-201-1/+1
| | | | | | | | | | | | | | | | that every declaration lives inside a DeclContext. Moved several things that don't have names but were ScopedDecls (and, therefore, NamedDecls) to inherit from Decl rather than NamedDecl, including ObjCImplementationDecl and LinkageSpecDecl. Now, we don't store empty DeclarationNames for these things, nor do we try to insert them into DeclContext's lookup structure. The serialization tests are temporarily disabled. We'll re-enable them once we've sorted out the remaining ownership/serialiazation issues between DeclContexts and TranslationUnion, DeclGroups, etc. llvm-svn: 62562
* this massive patch introduces a simple new abstraction: it makesChris Lattner2009-01-171-2/+2
| | | | | | | | | | | | | | | "FileID" a concept that is now enforced by the compiler's type checker instead of yet-another-random-unsigned floating around. This is an important distinction from the "FileID" currently tracked by SourceLocation. *That* FileID may refer to the start of a file or to a chunk within it. The new FileID *only* refers to the file (and its #include stack and eventually #line data), it cannot refer to a chunk. FileID is a completely opaque datatype to all clients, only SourceManager is allowed to poke and prod it. llvm-svn: 62407
* more SourceLocation lexicon change: instead of referring to theChris Lattner2009-01-161-1/+1
| | | | | | "logical" location, refer to the "instantiation" location. llvm-svn: 62316
* Actually distinguish between RecordDecl::field_iterator and ↵Douglas Gregor2008-12-111-1/+1
| | | | | | RecordDecl::field_const_iterator, propagating the constness down to the FieldDecls. llvm-svn: 60883
* Rename NamedDecl::getName() to getNameAsString(). Replace a bunch of Chris Lattner2008-11-241-18/+18
| | | | | | | | | | | uses of getName() with uses of getDeclName(). This upgrades a bunch of diags to take DeclNames instead of std::strings. This also tweaks a couple of diagnostics to be cleaner and changes CheckInitializerTypes/PerformInitializationByConstructor to pass around DeclarationNames instead of std::strings. llvm-svn: 59947
* Rename NamedDecl::getIdentifierName() to ::getNameAsCString() and make itChris Lattner2008-11-241-5/+5
| | | | | | | | | assert if the name is not an identifier. Update callers to do the right thing and avoid this method in unsafe cases. This also fixes an objc warning that was missing a space, and migrates a couple more to taking IdentifierInfo and QualTypes instead of std::strings. llvm-svn: 59936
* Rename Selector::getName() to Selector::getAsString(), and addChris Lattner2008-11-241-2/+2
| | | | | | | | | | | | | a new NamedDecl::getAsString() method. Change uses of Selector::getName() to just pass in a Selector where possible (e.g. to diagnostics) instead of going through an std::string. This also adds new formatters for objcinstance and objcclass as described in the dox. llvm-svn: 59933
* Introduction the DeclarationName class, as a single, general method ofDouglas Gregor2008-11-171-5/+6
| | | | | | | | 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
* Fix <rdar://problem/6336774> clang block rewriter: Assertion failed: ↵Steve Naroff2008-11-031-0/+3
| | | | | | 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
* Fix <rdar://problem/6312683> clang block rewriter:Steve Naroff2008-10-221-1/+0
| | | | llvm-svn: 58011
* Tighten up blocks rewriter to handle casts and some other interesting cases.Steve Naroff2008-10-151-23/+84
| | | | | | This fixes <rdar://problem/6289007> clang block rewriter: ^ in cast is not rewritten. llvm-svn: 57591
* Fix/simplify RewriteBlocks::RewriteBlockPointerFunctionArgs().Steve Naroff2008-10-101-45/+5
| | | | | | This completes the fix for <rdar://problem/6272905> clang block rewriter: parameter to function not imported into block?. llvm-svn: 57350
* Touchup the rewriter to handle the new BlockExpr->BlockDecl dance.Steve Naroff2008-10-081-9/+15
| | | | llvm-svn: 57299
* - Add BlockDecl AST node.Steve Naroff2008-10-081-5/+7
| | | | | | | | | | - 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
* In RewriteFunctionBody, using DeclStmt::decl_iterator to rewrite the Decls ↵Ted Kremenek2008-10-061-8/+12
| | | | | | | 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
* Remove old diag that alerted the user to a limitation we no longer have:-)Steve Naroff2008-10-051-3/+0
| | | | llvm-svn: 57086
* Create a function, eliminating some redundancy between ↵Steve Naroff2008-10-051-27/+10
| | | | | | SynthesizeBlockInitExpr() and SynthesizeBlockLiterals(). llvm-svn: 57083
* Finish implementing copy/dispose helpers for imported block decls.Steve Naroff2008-10-041-22/+50
| | | | llvm-svn: 57082
* Add indirection required for byref BlockDeclRefExpr's.Steve Naroff2008-10-041-0/+11
| | | | llvm-svn: 57063
* Handle bookkeeping for imported blocks (in SynthesizeBlockImpl).Steve Naroff2008-10-041-1/+8
| | | | | | This code was "lost" with my recent changes to SynthesizeBlockFunc. llvm-svn: 57056
* Cut/paste error...need to use the expression "name" for member references ↵Steve Naroff2008-10-041-1/+1
| | | | | | (or other complex expressions that can embed a block pointer type) llvm-svn: 57054
* Clear the map that associated the rewritten block with it's corresponding ↵Steve Naroff2008-10-041-0/+1
| | | | | | BlockExpr. llvm-svn: 57053
* Moved main control flow functions to bottom of file.Steve Naroff2008-10-041-165/+133
| | | | | | | | | 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
* Remove an old/vacuous if clause.Steve Naroff2008-10-031-6/+0
| | | | llvm-svn: 57036
* More fun & games with the block rewriter.Steve Naroff2008-10-031-21/+90
| | | | llvm-svn: 57028
* Rewrite global block expressions.Steve Naroff2008-10-031-6/+15
| | | | llvm-svn: 57004
* - Add a convenience constructor to Type.Steve Naroff2008-10-031-14/+47
| | | | | | - Many rewriter modifications. llvm-svn: 57003
* Rework SynthesizeBlockImpl() to include a constructor.Steve Naroff2008-10-031-12/+49
| | | | llvm-svn: 57001
* Get the right location to insert the synthesized block literals/functions.Steve Naroff2008-10-031-1/+1
| | | | llvm-svn: 56987
* Name changes and some cleanup of preamble.Steve Naroff2008-10-021-27/+35
| | | | llvm-svn: 56984
* Changed Sema::CheckForConstantInitializer to allow global block literals.Steve Naroff2008-10-021-15/+15
| | | | | | This commit also includes some name changes in the blocks rewriter (no functionality change). llvm-svn: 56955
* Fix a couple harmless warnings when compiling optimized with gcc (reported ↵Steve Naroff2008-09-241-2/+2
| | | | | | by mrs@apple.com). llvm-svn: 56591
* Fix some const-ness to keep the VisualStudio C++ compiler happy.Steve Naroff2008-09-241-4/+4
| | | | llvm-svn: 56560
* RewriteBlocks::RewriteBlockPointerDecl(): Handle TypedefDecl's and VarDecl's ↵Steve Naroff2008-09-231-35/+32
| | | | | | uniformly. llvm-svn: 56500
* Teach block rewriter to replace '^' with '*' in VarDecls.Steve Naroff2008-09-231-12/+64
| | | | | | | | 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
* Add driver support for invoking block rewriter.Steve Naroff2008-09-181-11/+20
| | | | | | Also tweaked the create function to take an explicit output file. llvm-svn: 56305
* Remove BlockStmtExpr. Steve Naroff2008-09-171-6/+6
| | | | | | | | Block literals are now represented by the concrete BlockExpr class. This is cleanup (removes a FIXME). No functionality change. llvm-svn: 56288
* Add support for rewriting blocks...Steve Naroff2008-09-171-0/+907
llvm-svn: 56266
OpenPOWER on IntegriCloud