summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseInit.cpp
Commit message (Collapse)AuthorAgeFilesLines
* PR5218: Replace IdentifierInfo::getName with StringRef version, now that clientsDaniel Dunbar2009-10-181-1/+1
| | | | | | are updated. llvm-svn: 84447
* Avoid std::string concatenation.Daniel Dunbar2009-10-171-4/+5
| | | | llvm-svn: 84378
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-20/+20
| | | | llvm-svn: 81346
* Merge the ASTVector and ASTOwningVector templates, since they offeredDouglas Gregor2009-05-211-1/+0
| | | | | | | | redundant functionality. The result (ASTOwningVector) lives in clang/Parse/Ownership.h and is used by both the parser and semantic analysis. No intended functionality change. llvm-svn: 72214
* Introduce a "-fixit" mode to clang-cc that applies code-modification hints.Douglas Gregor2009-04-021-1/+1
| | | | llvm-svn: 68268
* Make our diagnostics about the obsolete GNU designated-initializerDouglas Gregor2009-03-281-4/+13
| | | | | | | syntax into extension warnings, and provide code-modification hints showing how to fix the problem. llvm-svn: 67885
* Fix <rdar://problem/6724396>, where we were silently droppingDouglas Gregor2009-03-271-1/+2
| | | | | | GNU-style array designators, causing us to emit broken initializers. llvm-svn: 67878
* InitListDesignations hasn't been used (ever). Eliminate it, andDouglas Gregor2009-03-201-60/+32
| | | | | | | simplify the parsing and action interface for designated initializers. llvm-svn: 67415
* Put the invalid flag of OwningResult into the Action pointer.Sebastian Redl2009-02-051-1/+1
| | | | | | | | This shrinks OwningResult by one pointer. Since it is no longer larger than OwningPtr, merge the two. This leads to simpler client code and speeds up my benchmark by 2.7%. For some reason, this exposes a previously hidden bug, causing a regression in SemaCXX/condition.cpp. llvm-svn: 63867
* Implement and test aggregate initialization in C++. Major changes:Douglas Gregor2009-01-301-3/+3
| | | | | | | | | | | | | | | | - Support initialization of reference members; complain if any reference members are left uninitialized. - Use C++ copy-initialization for initializing each element (falls back to constraint checking in C) - Make sure we diagnose when one tries to provide an initializer list for a non-aggregate. - Don't complain about empty initializers in C++ (they are permitted) - Unrelated but necessary: don't bother trying to convert the decl-specifier-seq to a type when we're dealing with a C++ constructor, destructor, or conversion operator; it results in spurious warnings. llvm-svn: 63431
* move library-specific diagnostic headers into library private dirs. ReduceChris Lattner2009-01-291-1/+1
| | | | | | redundant #includes. Patch by Anders Johnsen! llvm-svn: 63271
* Split the single monolithic DiagnosticKinds.def file into oneChris Lattner2009-01-271-1/+1
| | | | | | | | | .def file for each library. This means that adding a diagnostic to sema doesn't require all the other libraries to be rebuilt. Patch by Anders Johnsen! llvm-svn: 63111
* Initial implementation of semantic analysis and ASTs for C99Douglas Gregor2009-01-221-14/+22
| | | | | | | | | | | | | | | | | | designated initializers. This implementation should cover all of the constraints in C99 6.7.8, including long, complex designations and computing the size of incomplete array types initialized with a designated initializer. Please see the new test-case and holler if you find cases where this doesn't work. There are still some wrinkles with GNU's anonymous structs and anonymous unions (it isn't clear how these should work; we'll just follow GCC's lead) and with designated initializers for the members of a union. I'll tackle those very soon. CodeGen is still nonexistent, and there's some leftover code in the parser's representation of designators that I'll also need to clean up. llvm-svn: 62737
* Convert more expression actions to smart pointers.Sebastian Redl2009-01-191-5/+4
| | | | llvm-svn: 62537
* Rename move_convert to move_arg and move_res. The new names are less ↵Sebastian Redl2009-01-181-1/+1
| | | | | | misleading (and shorter). llvm-svn: 62466
* Convert remaining expression parsers to smart pointers. Now on to the Action ↵Sebastian Redl2008-12-131-7/+7
| | | | | | connection. llvm-svn: 60982
* Convert a big bunch of expression parsers to use smart pointers.Sebastian Redl2008-12-111-27/+28
| | | | llvm-svn: 60906
* Convert selected expression parsers to use smart pointers.Sebastian Redl2008-12-111-3/+3
| | | | llvm-svn: 60900
* Modify the move emulation according to the excellent design of Howard ↵Sebastian Redl2008-12-101-6/+7
| | | | | | Hinnant. Makes for much nicer syntax when smart pointers are used consistently. Also, start converting internal argument passing of Parser to smart pointers. llvm-svn: 60809
* Kick out the proof-of-concept ASTOwner and replace it with ASTOwningResultSebastian Redl2008-12-091-3/+3
| | | | llvm-svn: 60791
* Consistently use smart pointers for stmt and expr nodes in parser local ↵Sebastian Redl2008-12-091-16/+15
| | | | | | variables. llvm-svn: 60761
* Use RAII objects to ensure proper destruction of expression and statement ↵Sebastian Redl2008-11-251-8/+8
| | | | | | AST nodes in the parser in most cases, even on error. llvm-svn: 60057
* Fix <rdar://problem/6150376> [sema] crash on invalid message send.Steve Naroff2008-11-191-3/+6
| | | | | | The core fix in Sema::ActOnClassMessage(). All the other changes have to do with passing down the SourceLocation for the receiver (to properly position the cursor when producing an error diagnostic). llvm-svn: 59639
* Fix PR3001: if we have an error parsing an initializer, make sure to removeChris Lattner2008-11-031-2/+10
| | | | | | | the designator corresponding to it, otherwise Sema and later parsing will get confused. llvm-svn: 58603
* pass designators into sema. This completes parser-level designatorChris Lattner2008-10-261-10/+11
| | | | | | support as far as I know. llvm-svn: 58217
* implement some more FIXMEs, by rejecting more bogus stuff inChris Lattner2008-10-261-4/+25
| | | | | | objc mode. llvm-svn: 58216
* add some simple designator testcases. Reject things like this:Chris Lattner2008-10-261-6/+10
| | | | | | | | | | | struct foo Y[10] = { [4] .arr [2] 4 // expected-error {{expected '=' or another designator}} }; because the "missing equals" extension only is valid if there is exactly one array designator. llvm-svn: 58215
* improve comments, build array and array range designator nodes, Chris Lattner2008-10-261-7/+23
| | | | | | fix an obscure memory leak. llvm-svn: 58213
* improve comments, build a Designation for field designators andChris Lattner2008-10-261-9/+26
| | | | | | improve diagnostic for a malformed field designator. llvm-svn: 58212
* restructure ParseInitializerWithPotentialDesignator to make itChris Lattner2008-10-261-76/+75
| | | | | | easier to understand and hack on, no functionality change. llvm-svn: 58210
* improve MayBeDesignationStart to do the entire determination Chris Lattner2008-10-261-17/+12
| | | | | | about whether a leading identifier is a designator. llvm-svn: 58207
* inline the decision logic that chooses between an assign expr and braceChris Lattner2008-10-261-8/+4
| | | | | | | initializer, avoiding an extra level of calls for silly things like 'int x = 4'. llvm-svn: 58206
* This patch continues parser-level implementation of designators:Chris Lattner2008-10-261-23/+41
| | | | | | | | | | | 1. It introduces new parser level abstractions for designators that are used to communicate between parser and sema. 2. This fixes a FIXME where "identifier ':'" was considered to be a designator even if it wasn't the first in a designator list. 3. In the "identifier ':'" case, it actually builds the designator representation. llvm-svn: 58205
* minor cleanupsChris Lattner2008-10-261-3/+5
| | | | llvm-svn: 58203
* Simplify the parser a bit by looking at the next token without consuming it ↵Argyrios Kyrtzidis2008-07-091-7/+6
| | | | | | | | | (by Preprocessor::LookNext): -Remove ParseExpressionWithLeadingIdentifier and ParseAssignmentExprWithLeadingIdentifier. -Separate ParseLabeledStatement from ParseIdentifierStatement. llvm-svn: 53376
* handle the full assignment-expression grammar when using an Chris Lattner2008-06-021-5/+4
| | | | | | objc message send in an initializer expression. llvm-svn: 51882
* Two improvements to initializer parsing:Chris Lattner2008-04-201-5/+19
| | | | | | | | 1. If we hit a semantic error, try harder to recover to emit diagnostics for later initializer errors (PR2241). 2. Don't leak parsed initializers on an error. llvm-svn: 49998
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+227
lib dir and move all the libraries into it. This follows the main llvm tree, and allows the libraries to be built in parallel. The top level now enforces that all the libs are built before Driver, but we don't care what order the libs are built in. This speeds up parallel builds, particularly incremental ones. llvm-svn: 48402
OpenPOWER on IntegriCloud