diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2018-02-27 23:49:28 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2018-02-27 23:49:28 +0000 |
commit | 48a533d005d1de74e680896be8124b950b12f6fc (patch) | |
tree | 053ce283663b8a67be29dd21b880ff14105fd992 /clang/lib/Parse/ParseDecl.cpp | |
parent | 64393cfca022da671ea086b6fc497084cd062306 (diff) | |
download | llvm-48a533d005d1de74e680896be8124b950b12f6fc.zip llvm-48a533d005d1de74e680896be8124b950b12f6fc.tar.gz llvm-48a533d005d1de74e680896be8124b950b12f6fc.tar.bz2 |
Improve the way attribute argument printing happens for omitted optional arguments when pretty printing.
Patch by Joel Denny.
llvm-svn: 326266
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 491ad31..3a3096f 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -1258,7 +1258,9 @@ void Parser::ParseObjCBridgeRelatedAttribute(IdentifierInfo &ObjCBridgeRelated, return; } - // Parse optional class method name. + // Parse class method name. It's non-optional in the sense that a trailing + // comma is required, but it can be the empty string, and then we record a + // nullptr. IdentifierLoc *ClassMethod = nullptr; if (Tok.is(tok::identifier)) { ClassMethod = ParseIdentifierLoc(); @@ -1277,7 +1279,8 @@ void Parser::ParseObjCBridgeRelatedAttribute(IdentifierInfo &ObjCBridgeRelated, return; } - // Parse optional instance method name. + // Parse instance method name. Also non-optional but empty string is + // permitted. IdentifierLoc *InstanceMethod = nullptr; if (Tok.is(tok::identifier)) InstanceMethod = ParseIdentifierLoc(); |