diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-07-02 17:43:08 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-07-02 17:43:08 +0000 |
commit | 23c94dbb6631fecdb55ba401aa93722803d980c6 (patch) | |
tree | 19240dbaae509d69e403e4962fd5a14b9c8d5c53 /lib/Parse/ParseInit.cpp | |
parent | fe2dd6ceeeb31a7c681b2873a8459c5de5d1a3e9 (diff) |
Move the "current scope" state from the Parser into Action. This
allows Sema some limited access to the current scope, which we only
use in one way: when Sema is performing some kind of declaration that
is not directly driven by the parser (e.g., due to template
instantiatio or lazy declaration of a member), we can find the Scope
associated with a DeclContext, if that DeclContext is still in the
process of being parsed.
Use this to make the implicit declaration of special member functions
in a C++ class more "scope-less", rather than using the NULL Scope hack.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107491 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseInit.cpp')
-rw-r--r-- | lib/Parse/ParseInit.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Parse/ParseInit.cpp b/lib/Parse/ParseInit.cpp index a382a9ae3c..8451aebc04 100644 --- a/lib/Parse/ParseInit.cpp +++ b/lib/Parse/ParseInit.cpp @@ -146,7 +146,7 @@ Parser::OwningExprResult Parser::ParseInitializerWithPotentialDesignator() { if (getLang().ObjC1 && getLang().CPlusPlus) { // Send to 'super'. if (Tok.is(tok::identifier) && Tok.getIdentifierInfo() == Ident_super && - NextToken().isNot(tok::period) && CurScope->isInObjcMethodScope()) { + NextToken().isNot(tok::period) && getCurScope()->isInObjcMethodScope()) { CheckArrayDesignatorSyntax(*this, StartLoc, Desig); return ParseAssignmentExprWithObjCMessageExprStart(StartLoc, ConsumeToken(), 0, @@ -184,7 +184,7 @@ Parser::OwningExprResult Parser::ParseInitializerWithPotentialDesignator() { // This is a message send to super: [super foo] // This is a message sent to an expr: [super.bar foo] switch (Action::ObjCMessageKind Kind - = Actions.getObjCMessageKind(CurScope, II, IILoc, + = Actions.getObjCMessageKind(getCurScope(), II, IILoc, II == Ident_super, NextToken().is(tok::period), ReceiverType)) { |