9 #ifndef CLANG_AST_ABSTRACTBASICREADER_H 10 #define CLANG_AST_ABSTRACTBASICREADER_H 15 namespace serialization {
19 return (value ? *value : T());
24 return (value ? *value :
nullptr);
101 #include "clang/AST/AbstractBasicReader.inc" 122 template <
class Impl>
125 using BasicReaderBase<Impl>::asImpl;
129 using BasicReaderBase<Impl>::getASTContext;
133 Impl &
find(
const char *propertyName) {
139 return T(asImpl().readUInt32());
148 assert(buffer.empty());
150 uint32_t size = asImpl().readUInt32();
151 buffer.reserve(size);
153 for (uint32_t i = 0; i != size; ++i) {
154 buffer.push_back(ReadDispatcher<T>::read(asImpl()));
159 template <
class T,
class... Args>
161 return UnpackOptionalValue<T>::unpack(
162 ReadDispatcher<T>::read(asImpl(), std::forward<Args>(args)...));
166 bool isUnsigned = asImpl().readBool();
172 unsigned bitWidth = asImpl().readUInt32();
173 unsigned numWords = llvm::APInt::getNumWords(bitWidth);
175 for (uint32_t i = 0; i != numWords; ++i)
176 data.push_back(asImpl().readUInt64());
181 static_assert(
sizeof(
Qualifiers().getAsOpaqueValue()) <=
sizeof(uint32_t),
182 "update this if the value size changes");
183 uint32_t value = asImpl().readUInt32();
192 esi.
Exceptions = asImpl().template readArray<QualType>(buffer);
196 esi.
SourceDecl = asImpl().readFunctionDeclRef();
199 esi.
SourceDecl = asImpl().readFunctionDeclRef();
207 "opaque value doesn't fit into uint32_t");
208 uint32_t value = asImpl().readUInt32();
213 auto &ctx = getASTContext();
218 uint32_t depth = asImpl().readUInt32();
219 for (uint32_t i = 0; i != depth; ++i) {
220 auto kind = asImpl().readNestedNameSpecifierKind();
224 asImpl().readIdentifier());
229 asImpl().readNamespaceDeclRef());
234 asImpl().readNamespaceAliasDeclRef());
241 asImpl().readQualType().getTypePtr());
250 asImpl().readCXXRecordDeclRef());
253 llvm_unreachable(
"bad nested name specifier kind");
llvm::Optional< T > readOptional(Args &&...args)
Microsoft's '__super' specifier, stored as a CXXRecordDecl* of the class it appeared in...
FunctionProtoType::ExceptionSpecInfo readExceptionSpecInfo(llvm::SmallVectorImpl< QualType > &buffer)
Defines the C++ template declaration subclasses.
T makeNullableFromOptional(const Optional< T > &value)
An identifier, stored as an IdentifierInfo*.
static Qualifiers fromOpaqueValue(unsigned opaque)
static NestedNameSpecifier * Create(const ASTContext &Context, NestedNameSpecifier *Prefix, IdentifierInfo *II)
Builds a specifier combining a prefix and an identifier.
A namespace, stored as a NamespaceDecl*.
The collection of all-type qualifiers we support.
Qualifiers readQualifiers()
DataStreamBasicReader(ASTContext &ctx)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
llvm::ArrayRef< T > readArray(llvm::SmallVectorImpl< T > &buffer)
Impl & find(const char *propertyName)
Implement property-find by ignoring it.
FunctionDecl * SourceDecl
The function whose exception specification this is, for EST_Unevaluated and EST_Uninstantiated.
DataStreamBasicReader provides convenience implementations for many BasicReader methods based on the ...
static ExtParameterInfo getFromOpaqueValue(unsigned char data)
static NestedNameSpecifier * SuperSpecifier(const ASTContext &Context, CXXRecordDecl *RD)
Returns the nested name specifier representing the __super scope for the given CXXRecordDecl.
A namespace alias, stored as a NamespaceAliasDecl*.
A type, stored as a Type*.
bool isComputedNoexcept(ExceptionSpecificationType ESpecType)
ExceptionSpecificationType Type
The kind of exception specification this is.
NestedNameSpecifier * readNestedNameSpecifier()
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
T * makePointerFromOptional(Optional< T *> value)
Dataflow Directional Tag Classes.
not evaluated yet, for special member function
FunctionProtoType::ExtParameterInfo readExtParameterInfo()
Interesting information about a specific parameter that can't simply be reflected in parameter's type...
A type that was preceded by the 'template' keyword, stored as a Type*.
llvm::APSInt readAPSInt()
FunctionDecl * SourceTemplate
The function template whose exception specification this is instantiated from, for EST_Uninstantiated...
ExceptionSpecificationType
The various types of exception specifications that exist in C++11.
Holds information about the various types of exception specification.
ArrayRef< QualType > Exceptions
Explicitly-specified list of exception types.
Expr * NoexceptExpr
Noexcept expression, if this is a computed noexcept specification.
unsigned kind
All of the diagnostics that can be emitted by the frontend.
The global specifier '::'. There is no stored value.
static NestedNameSpecifier * GlobalSpecifier(const ASTContext &Context)
Returns the nested name specifier representing the global scope.