Commit Graph

9 Commits

Author SHA1 Message Date
John Wiegley 1c0675e155 Parsing/AST support for Structured Exception Handling
Patch authored by Sohail Somani.

Provide parsing and AST support for Windows structured exception handling.

llvm-svn: 130366
2011-04-28 01:08:34 +00:00
Douglas Gregor e9bba4f1a4 Implement bracket insertion for Objective-C instance message sends as
part of parser recovery. For example, given:

  a method1:arg];

we detect after parsing the expression "a" that we have the start of a
message send expression. We pretend we've seen a '[' prior to the a,
then parse the remainder as a message send. We'll then give a
diagnostic+fix-it such as:

fixit-objc-message.m:17:3: error: missing '[' at start of message
      send expression
  a method1:arg];
  ^
  [

The algorithm here is very simple, and always assumes that the open
bracket goes at the beginning of the message send. It also only works
for non-super instance message sends at this time.

llvm-svn: 113968
2010-09-15 14:51:05 +00:00
Argyrios Kyrtzidis 355094ef06 Make sure parens/braces/brackets are correctly balanced.
In a line like:

(;

the semicolon leaves Parser:ParenCount unbalanced (it's 1 even though we stopped looking for a right paren).
This may affect later parsing and result in bad recovery for parsing errors.

llvm-svn: 106213
2010-06-17 10:52:18 +00:00
Benjamin Kramer e9ff5fe2e6 Privatize class members.
llvm-svn: 91067
2009-12-10 21:50:21 +00:00
Chris Lattner 3c674cf804 If we enter parens, colons can become un-sacred, allowing us to emit
a better diagnostic in the second example.

llvm-svn: 91040
2009-12-10 02:08:07 +00:00
Chris Lattner 5701386620 move GreaterThanIsOperatorScope into RAIIObjectsForParser. Add some more
TODOs for other classes that could be moved out of Parser.h.  I don't plan
to do these in the near term though.

llvm-svn: 91023
2009-12-10 00:44:03 +00:00
Chris Lattner 125c0ee5c7 fix PR5740: a colon is sacred when parsing case statement expressions!
llvm-svn: 91016
2009-12-10 00:38:54 +00:00
Chris Lattner d5c1c9d0ae refactor the 'ColonIsSacred' argument to ParseOptionalCXXScopeSpecifier
to be a bool in Parser that is twiddled by the ColonProtectionRAIIObject
class.  No functionality change.

llvm-svn: 91014
2009-12-10 00:32:41 +00:00
Chris Lattner 8a9a97a660 rename ExtensionRAIIObject.h -> RAIIObjectsForParser.h
llvm-svn: 91008
2009-12-10 00:21:05 +00:00