コード例 #1
0
ファイル: lambda.c プロジェクト: nguyentu1602/gcc
tree
current_nonlambda_scope (void)
{
  tree scope = current_scope ();
  for (;;)
    {
      if (TREE_CODE (scope) == FUNCTION_DECL
	  && LAMBDA_FUNCTION_P (scope))
	{
	  scope = CP_TYPE_CONTEXT (DECL_CONTEXT (scope));
	  continue;
	}
      else if (LAMBDA_TYPE_P (scope))
	{
	  scope = CP_TYPE_CONTEXT (scope);
	  continue;
	}
      break;
    }
  return scope;
}
コード例 #2
0
ファイル: TypeTree.cpp プロジェクト: stephanfr/GCCPlugin
	const NamespaceTree			TypeTree::fullyQualifiedNamespace() const
	{
/*		std::list<tree>			namespaceNodes;

		//	For types, we have to start with the CP_TYPE_CONTEXT, and then move over to the CP_DECL_CONTEXT
		//		as we iterate over the nested contexts.  Also, namespaces can be aliased, make sure we have the original.

		tree&			startingScope = ORIGINAL_NAMESPACE( CP_TYPE_CONTEXT( m_tree ));

		//	If this is the global namespace, return the scope resolution operator

		if( startingScope == global_namespace )
		{
			namespaceNodes.push_back( global_namespace );
		}
		else
		{
			//	We have to build out the full namespace context by context

			for( tree& currentScope = startingScope; currentScope != global_namespace; currentScope = ORIGINAL_NAMESPACE( CP_DECL_CONTEXT( currentScope ) ))
			{
				//	We might be inside of a class or struct.  If so, that is the current scope level name.

				if( TREE_CODE( currentScope ) == RECORD_TYPE )
				{
					namespaceNodes.push_front( TYPE_NAME( currentScope ) );
				}
				else
				{
					namespaceNodes.push_front( currentScope );
				}

			}
		}

		//	Return the full scope

		return( namespaceNodes );
*/

		return( NamespaceTree( ORIGINAL_NAMESPACE( CP_TYPE_CONTEXT( m_tree )) ) );
	}