aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseObjc.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-08-22 17:59:19 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-08-22 17:59:19 +0000
commit9735c5e60027b26a809df19677ff16a4d13f1321 (patch)
tree0696384b97e6af066ef682983312fbc9214d3414 /lib/Parse/ParseObjc.cpp
parent9a1ecf0522ccb7a45577f856150c15af0ee1df2a (diff)
objc - Simplify switing objc decl context by using
a context switching object. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138248 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseObjc.cpp')
-rw-r--r--lib/Parse/ParseObjc.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp
index f5471e5a6f..7512bbc5ff 100644
--- a/lib/Parse/ParseObjc.cpp
+++ b/lib/Parse/ParseObjc.cpp
@@ -776,9 +776,8 @@ ParsedType Parser::ParseObjCTypeName(ObjCDeclSpec &DS,
SourceLocation LParenLoc = ConsumeParen();
SourceLocation TypeStartLoc = Tok.getLocation();
- Decl *DC = getObjCDeclContext();
- if (DC)
- Actions.ActOnObjCContainerFinishDefinition(DC);
+ ObjCDeclContextSwitch ObjCDC(*this);
+
// Parse type qualifiers, in, inout, etc.
ParseObjCTypeQualifierList(DS, Context);
@@ -801,8 +800,6 @@ ParsedType Parser::ParseObjCTypeName(ObjCDeclSpec &DS,
// place. Emit an error then return what we have as the type.
MatchRHSPunctuation(tok::r_paren, LParenLoc);
}
- if (DC)
- Actions.ActOnObjCContainerStartDefinition(DC);
return Ty;
}