Commit Graph

15 Commits

Author SHA1 Message Date
Douglas Gregor ae2fbad373 Updated IdentifierResolver to deal with DeclarationNames. The names of
C++ constructors, destructors, and conversion functions now have a
FETokenInfo field that IdentifierResolver can access, so that these
special names are handled just like ordinary identifiers. A few other
Sema routines now use DeclarationNames instead of IdentifierInfo*'s.

To validate this design, this code also implements parsing and
semantic analysis for id-expressions that name conversion functions,
e.g.,

  return operator bool();

The new parser action ActOnConversionFunctionExpr takes the result of
parsing "operator type-id" and turning it into an expression, using
the IdentifierResolver with the DeclarationName of the conversion
function. ActOnDeclarator pushes those conversion function names into
scope so that the IdentifierResolver can find them, of course.

llvm-svn: 59462
2008-11-17 20:34:05 +00:00
Sebastian Redl c470476420 Implement C++ 'typeid' parsing and sema.
llvm-svn: 59042
2008-11-11 11:37:55 +00:00
Douglas Gregor 5251f1b283 Preliminary support for function overloading
llvm-svn: 57909
2008-10-21 16:13:35 +00:00
Argyrios Kyrtzidis 2bdac73591 Make IdentifierResolver::isDeclInScope regard declarations of a parent 'control' scope as part of the current scope.
The 'control' scope is the 'condition' scope of if/switch/while statements and the scope that contains the for-init-statement and 'condition' of a for statement.

e.g:
if (int x = 0 /*'control' scope*/) {
  // x will be regarded as part of this substatement scope.
} else {
  // and as part of this substatement scope too.
}

llvm-svn: 56020
2008-09-09 21:57:58 +00:00
Argyrios Kyrtzidis f4b92e6924 Add a LangOptions member to IdentifierResolver.
Make Sema pass the LangOptions to IdentifierResolver's constructor.

llvm-svn: 56015
2008-09-09 21:32:02 +00:00
Argyrios Kyrtzidis 4f11d78fcc IdentifierResolver cleanup. Make some methods out-of-line.
llvm-svn: 56002
2008-09-09 19:28:27 +00:00
Argyrios Kyrtzidis ef34aed1f9 Unify ctx_iterator/ctx_begin()/ctx_end() and iterator/begin()/end() so that a single iterator type is used for both traversing decls of the same declaration context *and* of the parent declaration contexts, depending on the value of the bool parameter 'LookInParentCtx' that is passed to IdentifierResolver::begin().
llvm-svn: 53724
2008-07-17 17:49:50 +00:00
Argyrios Kyrtzidis 212f91107a Comments fix.
llvm-svn: 51151
2008-05-15 17:26:35 +00:00
Argyrios Kyrtzidis fa8e15bfa5 -Implement proper name lookup for namespaces.
-identifierResolver exposes an iterator interface to get all decls through the scope chain.
-The semantic staff (checking IdentifierNamespace and Doug's checking for shadowed tags were moved out of IdentifierResolver and back into Sema. IdentifierResolver just gives an iterator for all reachable decls of an identifier.

llvm-svn: 50923
2008-05-09 23:39:43 +00:00
Douglas Gregor 2daae31e9a Argiris Kirtzidis's fix for handling empty IdDeclInfo's in IdentifierResolver::AddDecl
llvm-svn: 49631
2008-04-14 00:26:07 +00:00
Argyrios Kyrtzidis 25f54c72ac Move IdDeclInfoMap class in an anonymous namespace. Suggestion by Chris Lattner.
llvm-svn: 49628
2008-04-14 00:09:21 +00:00
Douglas Gregor 83a586ec19 Introduce support for finding class and enum names via ordinary name lookup in C++
llvm-svn: 49621
2008-04-13 21:07:44 +00:00
Argyrios Kyrtzidis 740525a6b7 Use std::list's push_back instead of resize to add an element.
llvm-svn: 49582
2008-04-12 12:38:58 +00:00
Argyrios Kyrtzidis dfd52220d7 Fixed comments.
Moved IdDeclInfo class to anonymous namespace.
Replaced array with a std::vector.

llvm-svn: 49570
2008-04-12 01:50:47 +00:00
Chris Lattner 9950c80c83 two new files for previous patch, by Argiris Kirtzidis
llvm-svn: 49521
2008-04-11 07:06:57 +00:00