diff options
Diffstat (limited to 'clang/lib/ExtractAPI/DeclarationFragments.cpp')
-rw-r--r-- | clang/lib/ExtractAPI/DeclarationFragments.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/ExtractAPI/DeclarationFragments.cpp b/clang/lib/ExtractAPI/DeclarationFragments.cpp index 36b0d1f..f1fff6b 100644 --- a/clang/lib/ExtractAPI/DeclarationFragments.cpp +++ b/clang/lib/ExtractAPI/DeclarationFragments.cpp @@ -423,6 +423,16 @@ DeclarationFragments DeclarationFragmentsBuilder::getFragmentsForType( return QualsFragments.appendSpace().append(std::move(TypeFragments)); } +DeclarationFragments DeclarationFragmentsBuilder::getFragmentsForNamespace( + const NamespaceDecl *Decl) { + DeclarationFragments Fragments; + Fragments.append("namespace", DeclarationFragments::FragmentKind::Keyword); + if (!Decl->isAnonymousNamespace()) + Fragments.appendSpace().append( + Decl->getName(), DeclarationFragments::FragmentKind::Identifier); + return Fragments.append(";", DeclarationFragments::FragmentKind::Text); +} + DeclarationFragments DeclarationFragmentsBuilder::getFragmentsForVar(const VarDecl *Var) { DeclarationFragments Fragments; |