llvm-project/clang/lib/Parse
Argyrios Kyrtzidis 9a1191c047 Implement support for C++ direct initializers in declarations, e.g. "int x(1);".
This is how this kind of initializers appear in the AST:
-The Init expression of the VarDecl is a functional type construction (of the VarDecl's type).
-The new VarDecl::hasCXXDirectInitializer() returns true.

e.g, for "int x(1);":
-VarDecl 'x' has Init with expression "int(1)" (CXXFunctionalCastExpr).
-hasCXXDirectInitializer() of VarDecl 'x' returns true.

A major benefit is that clients that don't particularly care about which exactly form was the initializer can handle both cases without special case code.
Note that codegening works now for "int x(1);" without any changes to CodeGen.

llvm-svn: 57178
2008-10-06 17:10:33 +00:00
..
AttributeList.cpp Add parsing of the sentinel attribute. Still need to create the attribute. 2008-10-05 18:05:59 +00:00
DeclSpec.cpp More #include cleaning 2008-08-11 06:23:49 +00:00
Makefile Make a major restructuring of the clang tree: introduce a top-level 2008-03-15 23:59:48 +00:00
MinimalAction.cpp Move AsmLabel into Declarator instead of just a parameter to 2008-08-05 16:28:08 +00:00
ParseCXXInlineMethods.cpp The only caller of this knows that the current token is l_brace, so this can be an assert; suggestion by Chris. 2008-06-24 22:31:41 +00:00
ParseDecl.cpp Implement support for C++ direct initializers in declarations, e.g. "int x(1);". 2008-10-06 17:10:33 +00:00
ParseDeclCXX.cpp Passing right brace location to ActOnFinishCXXClassDef is redundant, since it gets passed to ActOnFinishCXXMemberSpecification too. 2008-08-09 00:39:29 +00:00
ParseExpr.cpp Handle ambiguities between expressions and type-ids that occur inside parentheses, e.g.: 2008-10-05 19:56:22 +00:00
ParseExprCXX.cpp Disambiguate between a declaration or expression for the 'condition' part of a if/switch/while/for statement. 2008-10-05 15:03:47 +00:00
ParseInit.cpp Simplify the parser a bit by looking at the next token without consuming it (by Preprocessor::LookNext): 2008-07-09 22:53:07 +00:00
ParseObjc.cpp Pass postfix attributes to ActOnFields. 2008-10-03 02:03:53 +00:00
ParsePragma.cpp Add Parser support for #pragma pack 2008-10-04 19:21:03 +00:00
ParsePragma.h Add Parser support for #pragma pack 2008-10-04 19:21:03 +00:00
ParseStmt.cpp Disambiguate between a declaration or an expression, in the 'for-init-statement' part of a 'for' statement. 2008-10-05 15:50:46 +00:00
ParseTentative.cpp A tiny optimization; use isCXXFunctionDeclarator only when it's appropriate. 2008-10-05 23:15:41 +00:00
Parser.cpp Implement support for C++ direct initializers in declarations, e.g. "int x(1);". 2008-10-06 17:10:33 +00:00