diff options
| author | Nico Weber <nicolasweber@gmx.de> | 2015-01-13 22:32:50 +0000 |
|---|---|---|
| committer | Nico Weber <nicolasweber@gmx.de> | 2015-01-13 22:32:50 +0000 |
| commit | ed50166b6b552a3419f75142776296c20cb75992 (patch) | |
| tree | 5984eb28d9b6271bc040f0095fb8c1527087f41c /clang/lib | |
| parent | e5dbcb7fd0aaf48ddc3bed416eec42257b8d48b6 (diff) | |
| download | bcm5719-llvm-ed50166b6b552a3419f75142776296c20cb75992.tar.gz bcm5719-llvm-ed50166b6b552a3419f75142776296c20cb75992.zip | |
clang-format: [Java] Detect `native` keyword.
Before:
public native<X> Foo foo();
After:
public native <X> Foo foo();
llvm-svn: 225839
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Format/FormatToken.h | 2 | ||||
| -rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Format/FormatToken.h b/clang/lib/Format/FormatToken.h index 7ffbfbd4eba..4811e02dd22 100644 --- a/clang/lib/Format/FormatToken.h +++ b/clang/lib/Format/FormatToken.h @@ -551,6 +551,7 @@ struct AdditionalKeywords { kw_implements = &IdentTable.get("implements"); kw_instanceof = &IdentTable.get("instanceof"); kw_interface = &IdentTable.get("interface"); + kw_native = &IdentTable.get("native"); kw_package = &IdentTable.get("package"); kw_synchronized = &IdentTable.get("synchronized"); kw_throws = &IdentTable.get("throws"); @@ -581,6 +582,7 @@ struct AdditionalKeywords { IdentifierInfo *kw_implements; IdentifierInfo *kw_instanceof; IdentifierInfo *kw_interface; + IdentifierInfo *kw_native; IdentifierInfo *kw_package; IdentifierInfo *kw_synchronized; IdentifierInfo *kw_throws; diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index 6ad1ad2cc7f..b4eb3656bdf 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -1749,7 +1749,8 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line, return Style.SpaceBeforeParens != FormatStyle::SBPO_Never; if ((Left.isOneOf(tok::kw_static, tok::kw_public, tok::kw_private, tok::kw_protected) || - Left.isOneOf(Keywords.kw_final, Keywords.kw_abstract)) && + Left.isOneOf(Keywords.kw_final, Keywords.kw_abstract, + Keywords.kw_native)) && Right.is(TT_TemplateOpener)) return true; } |

