18#ifndef LLVM_CLANG_EXTRACTAPI_DECLARATION_FRAGMENTS_H
19#define LLVM_CLANG_EXTRACTAPI_DECLARATION_FRAGMENTS_H
30#include "llvm/ADT/SmallVector.h"
31#include "llvm/ADT/StringRef.h"
108 const std::vector<Fragment> &
getFragments()
const {
return Fragments; }
121 StringRef PreciseIdentifier =
"",
130 Fragments.insert(It, std::make_move_iterator(
Other.Fragments.begin()),
131 std::make_move_iterator(
Other.Fragments.end()));
132 Other.Fragments.clear();
141 StringRef PreciseIdentifier =
"",
147 Fragments.back().Spelling.append(Spelling.data(), Spelling.size());
149 Fragments.emplace_back(Spelling, Kind, PreciseIdentifier,
Declaration);
162 Fragments.insert(Fragments.end(),
163 std::make_move_iterator(
Other.Fragments.begin()),
164 std::make_move_iterator(
Other.Fragments.end()));
165 Other.Fragments.clear();
170 Fragments.pop_back();
175 Fragments.at(Position).Spelling = NewSpelling;
197 std::vector<Fragment> Fragments;
206 bool empty()
const {
return Access.empty(); }
232 Parameters.emplace_back(Name, Fragments);
243 return Parameters.empty() && ReturnType.
getFragments().empty();
247 std::vector<Parameter> Parameters;
260 template <
typename FunctionT>
273 llvm_unreachable(
"Unhandled access control");
421template <
typename FunctionT>
427 ReturnType = getFragmentsForType(
Function->getReturnType(),
430 dyn_cast<FunctionDecl>(
Function)->getDescribedFunctionTemplate() &&
431 ReturnType.
begin()->Spelling.substr(0, 14).compare(
"type-parameter") ==
433 std::string ProperArgName =
435 ->getDescribedFunctionTemplate()
436 ->getTemplateParameters()
438 ReturnType.
begin()->Spelling);
439 ReturnType.
begin()->Spelling.swap(ProperArgName);
441 ReturnType.
append(std::move(After));
444 for (
const auto *Param :
Function->parameters())
445 Signature.
addParameter(Param->getName(), getFragmentsForParam(Param));
Defines the clang::ASTContext interface.
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the C++ template declaration subclasses.
Defines the clang::Expr interface and subclasses for C++ expressions.
Defines the clang::MacroInfo and clang::MacroDirective classes.
Defines various enumerations that describe declaration and type specifiers.
Defines the clang::TypeLoc interface and its subclasses.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Represents a C++ conversion function within a class.
Represents a static or instance method of a struct/union/class.
Represents a C++ struct/union/class.
Represents a class template specialization, which refers to a class template with a given set of temp...
Declaration of a C++20 concept.
Decl - This represents one declaration (or definition), e.g.
AccessSpecifier getAccess() const
An instance of this object exists for each enum constant that is defined.
Represents a member of a struct/union/class.
Represents a function declaration or definition.
Declaration of a template function.
Wrapper for source info for functions.
Encapsulates changes to the "macros namespace" (the location where the macro name became active,...
This represents a decl that may have a name.
Represent a C++ namespace.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
ObjCCategoryDecl - Represents a category declaration.
Represents an ObjC class declaration.
ObjCMethodDecl - Represents an instance or class method declaration.
Represents one property declaration in an Objective-C interface.
Represents an Objective-C protocol declaration.
Represents a parameter to a function.
A (possibly-)qualified type.
The collection of all-type qualifiers we support.
Represents a struct/union/class.
Declaration of a redeclarable template.
The base class of the type hierarchy.
Base class for declarations which introduce a typedef-name.
Represents a variable declaration or definition.
Represents a variable template specialization, which refers to a variable template with a given set o...
@ Other
Other implicit parameter.
ExceptionSpecificationType
The various types of exception specifications that exist in C++11.