9 #ifndef CLANG_AST_ABSTRACTBASICWRITER_H 10 #define CLANG_AST_ABSTRACTBASICWRITER_H 15 namespace serialization {
19 return (value.isNull()
99 #include "clang/AST/AbstractBasicWriter.inc" 120 template <
class Impl>
123 using BasicWriterBase<Impl>::asImpl;
128 Impl &
find(
const char *propertyName) {
138 asImpl().writeUInt32(uint32_t(value));
143 asImpl().writeUInt32(array.size());
144 for (
const T &elt : array) {
145 WriteDispatcher<T>::write(asImpl(), elt);
151 WriteDispatcher<T>::write(asImpl(), PackOptionalValue<T>::pack(value));
155 asImpl().writeBool(value.isUnsigned());
156 asImpl().writeAPInt(value);
160 asImpl().writeUInt32(value.getBitWidth());
161 const uint64_t *words = value.getRawData();
162 for (
size_t i = 0, e = value.getNumWords(); i != e; ++i)
163 asImpl().writeUInt64(words[i]);
168 "update this if the value size changes");
174 asImpl().writeUInt32(uint32_t(esi.
Type));
189 "opaque value doesn't fit into uint32_t");
200 nestedNames.push_back(NNS);
204 asImpl().writeUInt32(nestedNames.size());
205 while (!nestedNames.empty()) {
206 NNS = nestedNames.pop_back_val();
208 asImpl().writeNestedNameSpecifierKind(kind);
235 llvm_unreachable(
"bad nested name specifier kind");
A (possibly-)qualified type.
Microsoft's '__super' specifier, stored as a CXXRecordDecl* of the class it appeared in...
NestedNameSpecifier * getPrefix() const
Return the prefix of this nested name specifier.
Defines the C++ template declaration subclasses.
void writeOptional(llvm::Optional< T > value)
An identifier, stored as an IdentifierInfo*.
llvm::Optional< T > makeOptionalFromNullable(const T &value)
A namespace, stored as a NamespaceDecl*.
SpecifierKind getKind() const
Determine what kind of nested name specifier is stored.
The collection of all-type qualifiers we support.
const Type * getAsType() const
Retrieve the type stored in this nested name specifier.
unsigned char getOpaqueValue() const
CXXRecordDecl * getAsRecordDecl() const
Retrieve the record declaration stored in this nested name specifier.
IdentifierInfo * getAsIdentifier() const
Retrieve the identifier stored in this nested name specifier.
NamespaceAliasDecl * getAsNamespaceAlias() const
Retrieve the namespace alias stored in this nested name specifier.
FunctionDecl * SourceDecl
The function whose exception specification this is, for EST_Unevaluated and EST_Uninstantiated.
void writeQualifiers(Qualifiers value)
void writeAPSInt(const llvm::APSInt &value)
NamespaceDecl * getAsNamespace() const
Retrieve the namespace stored in this nested name specifier.
unsigned getAsOpaqueValue() const
A namespace alias, stored as a NamespaceAliasDecl*.
A type, stored as a Type*.
void writeExtParameterInfo(FunctionProtoType::ExtParameterInfo epi)
SpecifierKind
The kind of specifier that completes this nested name specifier.
bool isComputedNoexcept(ExceptionSpecificationType ESpecType)
ExceptionSpecificationType Type
The kind of exception specification this is.
DataStreamBasicWriter provides convenience implementations for many BasicWriter methods based on the ...
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
void writeAPInt(const llvm::APInt &value)
Dataflow Directional Tag Classes.
not evaluated yet, for special member function
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::Optional< T * > makeOptionalFromPointer(T *value)
FunctionDecl * SourceTemplate
The function template whose exception specification this is instantiated from, for EST_Uninstantiated...
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.
Impl & find(const char *propertyName)
Implement property-find by ignoring it.
unsigned kind
All of the diagnostics that can be emitted by the frontend.
void writeExceptionSpecInfo(const FunctionProtoType::ExceptionSpecInfo &esi)
void writeNestedNameSpecifier(NestedNameSpecifier *NNS)
The global specifier '::'. There is no stored value.
void writeArray(llvm::ArrayRef< T > array)