token. The first token might be something that ends up triggering code
completion, which in turn requires a valid Scope. Test case forthcoming.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112066
91177308-0d34-0410-b5e6-
96231b3b80d8
/// ActOnTranslationUnitScope - This callback is called once, immediately
/// after creating the translation unit scope (in Parser::Initialize).
- virtual void ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) {}
+ virtual void ActOnTranslationUnitScope(Scope *S) {}
/// ParsedFreeStandingDeclSpec - This method is invoked when a declspec with
/// no declarator (e.g. "struct foo;") is parsed.
/// Scope actions.
virtual void ActOnPopScope(SourceLocation Loc, Scope *S);
- virtual void ActOnTranslationUnitScope(SourceLocation Loc, Scope *S);
+ virtual void ActOnTranslationUnitScope(Scope *S);
/// ParsedFreeStandingDeclSpec - This method is invoked when a declspec with
/// no declarator (e.g. "struct foo;") is parsed.
/// Initialize - Warm up the parser.
///
void Parser::Initialize() {
- // Prime the lexer look-ahead.
- ConsumeToken();
-
// Create the translation unit scope. Install it as the current scope.
assert(getCurScope() == 0 && "A scope is already active?");
EnterScope(Scope::DeclScope);
- Actions.ActOnTranslationUnitScope(Tok.getLocation(), getCurScope());
+ Actions.ActOnTranslationUnitScope(getCurScope());
+
+ // Prime the lexer look-ahead.
+ ConsumeToken();
if (Tok.is(tok::eof) &&
!getLang().CPlusPlus) // Empty source file is an extension in C
BlockScopeInfo::~BlockScopeInfo() { }
-void Sema::ActOnTranslationUnitScope(SourceLocation Loc, Scope *S) {
+void Sema::ActOnTranslationUnitScope(Scope *S) {
TUScope = S;
PushDeclContext(S, Context.getTranslationUnitDecl());