Commit Graph

20 Commits

Author SHA1 Message Date
Sebastian Redl d9f7b1c230 Modify the move emulation according to the excellent design of Howard 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
2008-12-10 00:02:53 +00:00
Sebastian Redl c13f26873f Kick out the proof-of-concept ASTOwner and replace it with ASTOwningResult
llvm-svn: 60791
2008-12-09 20:22:58 +00:00
Sebastian Redl 17f2c7d251 Consistently use smart pointers for stmt and expr nodes in parser local variables.
llvm-svn: 60761
2008-12-09 13:15:23 +00:00
Sebastian Redl 511ed55524 Use RAII objects to ensure proper destruction of expression and statement AST nodes in the parser in most cases, even on error.
llvm-svn: 60057
2008-11-25 22:21:31 +00:00
Steve Naroff 9e4ac111f0 Fix <rdar://problem/6150376> [sema] crash on invalid message send.
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
2008-11-19 15:54:23 +00:00
Chris Lattner 8cc7be369c Fix PR3001: if we have an error parsing an initializer, make sure to remove
the designator corresponding to it, otherwise Sema and later parsing will
get confused.

llvm-svn: 58603
2008-11-03 09:28:22 +00:00
Chris Lattner 248388e313 pass designators into sema. This completes parser-level designator
support as far as I know.

llvm-svn: 58217
2008-10-26 23:35:51 +00:00
Chris Lattner 9a53fdc23e implement some more FIXMEs, by rejecting more bogus stuff in
objc mode.

llvm-svn: 58216
2008-10-26 23:29:41 +00:00
Chris Lattner 46dcba6d2d add some simple designator testcases. Reject things like this:
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
2008-10-26 23:22:23 +00:00
Chris Lattner 8aafd35c79 improve comments, build array and array range designator nodes,
fix an obscure memory leak.

llvm-svn: 58213
2008-10-26 23:06:54 +00:00
Chris Lattner 7243245a58 improve comments, build a Designation for field designators and
improve diagnostic for a malformed field designator.

llvm-svn: 58212
2008-10-26 22:59:19 +00:00
Chris Lattner e2b5e87f58 restructure ParseInitializerWithPotentialDesignator to make it
easier to understand and hack on, no functionality change.

llvm-svn: 58210
2008-10-26 22:49:49 +00:00
Chris Lattner dde6543731 improve MayBeDesignationStart to do the entire determination
about whether a leading identifier is a designator.

llvm-svn: 58207
2008-10-26 22:41:58 +00:00
Chris Lattner 3fa9239f41 inline the decision logic that chooses between an assign expr and brace
initializer, avoiding an extra level of calls for silly things like
'int x = 4'.

llvm-svn: 58206
2008-10-26 22:38:55 +00:00
Chris Lattner f3e58e2ebc This patch continues parser-level implementation of designators:
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
2008-10-26 22:36:07 +00:00
Chris Lattner 0c02460038 minor cleanups
llvm-svn: 58203
2008-10-26 21:46:13 +00:00
Argyrios Kyrtzidis 832e898803 Simplify the parser a bit by looking at the next token without consuming it (by Preprocessor::LookNext):
-Remove ParseExpressionWithLeadingIdentifier and ParseAssignmentExprWithLeadingIdentifier.
-Separate ParseLabeledStatement from ParseIdentifierStatement.

llvm-svn: 53376
2008-07-09 22:53:07 +00:00
Chris Lattner fd2fe8270e handle the full assignment-expression grammar when using an
objc message send in an initializer expression.

llvm-svn: 51882
2008-06-02 21:31:07 +00:00
Chris Lattner 14cd1ee95f Two improvements to initializer parsing:
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
2008-04-20 19:07:56 +00:00
Chris Lattner 7a51313d8a Make a major restructuring of the clang tree: introduce a top-level
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
2008-03-15 23:59:48 +00:00