llvm-project/clang/lib/Parse
Douglas Gregor 5253768ada Introduce a representation for types that we referred to via a
qualified name, e.g., 

  foo::x

so that we retain the nested-name-specifier as written in the source
code and can reproduce that qualified name when printing the types
back (e.g., in diagnostics). This is PR3493, which won't be complete
until finished the other tasks mentioned near the end of this commit.

The parser's representation of nested-name-specifiers, CXXScopeSpec,
is now a bit fatter, because it needs to contain the scopes that
precede each '::' and keep track of whether the global scoping
operator '::' was at the beginning. For example, we need to keep track
of the leading '::', 'foo', and 'bar' in
 
  ::foo::bar::x

The Action's CXXScopeTy * is no longer a DeclContext *. It's now the
opaque version of the new NestedNameSpecifier, which contains a single
component of a nested-name-specifier (either a DeclContext * or a Type
*, bitmangled). 

The new sugar type QualifiedNameType composes a sequence of
NestedNameSpecifiers with a representation of the type we're actually
referring to. At present, we only build QualifiedNameType nodes within
Sema::getTypeName. This will be extended to other type-constructing
actions (e.g., ActOnClassTemplateId).

Also on the way: QualifiedDeclRefExprs will also store a sequence of
NestedNameSpecifiers, so that we can print out the property
nested-name-specifier. I expect to also use this for handling
dependent names like Fibonacci<I - 1>::value.

llvm-svn: 67265
2009-03-19 00:18:19 +00:00
..
AstGuard.h Add a switch that allows disabling the smart pointers. 2009-01-22 17:31:11 +00:00
AttributeList.cpp Add Parse/Sema support for weak_import attribute. 2009-03-06 06:39:57 +00:00
CMakeLists.txt Build system changes to use TableGen to generate the various 2009-03-16 23:06:59 +00:00
DeclSpec.cpp Introduce a representation for types that we referred to via a 2009-03-19 00:18:19 +00:00
ExtensionRAIIObject.h move library-specific diagnostic headers into library private dirs. Reduce 2009-01-29 05:15:15 +00:00
Makefile Build system changes to use TableGen to generate the various 2009-03-16 23:06:59 +00:00
MinimalAction.cpp Convert a bunch of actions to smart pointers, and also bring PrintParserCallbacks a bit more in line with reality. 2009-03-15 17:47:39 +00:00
ParseCXXInlineMethods.cpp Convert a bunch of actions to smart pointers, and also bring PrintParserCallbacks a bit more in line with reality. 2009-03-15 17:47:39 +00:00
ParseDecl.cpp Introduce a representation for types that we referred to via a 2009-03-19 00:18:19 +00:00
ParseDeclCXX.cpp Handle static_asserts when instantiating structs. 2009-03-15 18:44:04 +00:00
ParseExpr.cpp Convert a bunch of actions to smart pointers, and also bring PrintParserCallbacks a bit more in line with reality. 2009-03-15 17:47:39 +00:00
ParseExprCXX.cpp Introduce a representation for types that we referred to via a 2009-03-19 00:18:19 +00:00
ParseInit.cpp Put the invalid flag of OwningResult into the Action pointer. 2009-02-05 15:02:23 +00:00
ParseObjc.cpp objc: Implemented variables declared in class interface 2009-03-18 22:33:24 +00:00
ParsePragma.cpp move library-specific diagnostic headers into library private dirs. Reduce 2009-01-29 05:15:15 +00:00
ParsePragma.h Add Parser support for #pragma pack 2008-10-04 19:21:03 +00:00
ParseStmt.cpp rename PrettyStackTraceDecl -> PrettyStackTraceActionsDecl. 2009-03-05 08:00:35 +00:00
ParseTemplate.cpp Clean up and document code modification hints. 2009-02-27 17:53:17 +00:00
ParseTentative.cpp Add parser support for static_assert. 2009-03-11 16:27:10 +00:00
Parser.cpp Introduce a representation for types that we referred to via a 2009-03-19 00:18:19 +00:00