summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2013-01-09 23:25:37 +0000
committerNico Weber <nicolasweber@gmx.de>2013-01-09 23:25:37 +0000
commit2ce0ac5a8c6773dbb36d20f93f78f481812e1a34 (patch)
tree79b08184e49ed93a44d91d8cb7c32b57f09e2f1a /clang/lib
parenteb994f4064175f39c44badf6b41419bc4890455e (diff)
downloadbcm5719-llvm-2ce0ac5a8c6773dbb36d20f93f78f481812e1a34.tar.gz
bcm5719-llvm-2ce0ac5a8c6773dbb36d20f93f78f481812e1a34.zip
Formatter: Add support for @implementation.
Just reuse the @interface code for this. It accepts slightly more than necessary (@implementation cannot have protocol lists), but that's ok. llvm-svn: 172019
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Format/UnwrappedLineParser.cpp5
-rw-r--r--clang/lib/Format/UnwrappedLineParser.h2
2 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp
index 1d0cb30af84..c049ac607d3 100644
--- a/clang/lib/Format/UnwrappedLineParser.cpp
+++ b/clang/lib/Format/UnwrappedLineParser.cpp
@@ -209,7 +209,8 @@ void UnwrappedLineParser::parseStructuralElement() {
case tok::objc_private:
return parseAccessSpecifier();
case tok::objc_interface:
- return parseObjCInterface();
+ case tok::objc_implementation:
+ return parseObjCInterfaceOrImplementation();
case tok::objc_protocol:
return parseObjCProtocol();
case tok::objc_end:
@@ -519,7 +520,7 @@ void UnwrappedLineParser::parseObjCUntilAtEnd() {
} while (!eof());
}
-void UnwrappedLineParser::parseObjCInterface() {
+void UnwrappedLineParser::parseObjCInterfaceOrImplementation() {
nextToken();
nextToken(); // interface name
diff --git a/clang/lib/Format/UnwrappedLineParser.h b/clang/lib/Format/UnwrappedLineParser.h
index 303afc2d98d..16ad37eec63 100644
--- a/clang/lib/Format/UnwrappedLineParser.h
+++ b/clang/lib/Format/UnwrappedLineParser.h
@@ -144,7 +144,7 @@ private:
void parseStructOrClass();
void parseObjCProtocolList();
void parseObjCUntilAtEnd();
- void parseObjCInterface();
+ void parseObjCInterfaceOrImplementation();
void parseObjCProtocol();
void addUnwrappedLine();
bool eof() const;
OpenPOWER on IntegriCloud