#include "ASTTableGen.h"
#include "TableGenBackends.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Twine.h"
#include "llvm/TableGen/Error.h"
#include "llvm/TableGen/Record.h"
#include "llvm/TableGen/TableGenBackend.h"
#include <cctype>
#include <map>
#include <optional>
#include <set>
#include <string>
usingnamespacellvm;
usingnamespaceclang;
usingnamespaceclang::tblgen;
static StringRef getReaderResultType(TypeNode _) { … }
namespace {
struct ReaderWriterInfo { … };
struct NodeInfo { … };
struct CasedTypeInfo { … };
class ASTPropsEmitter { … };
}
void ASTPropsEmitter::Validator::validate() { … }
void ASTPropsEmitter::Validator::validateNode(HasProperties derivedNode,
const NodeInfo &derivedNodeInfo) { … }
void ASTPropsEmitter::Validator::validateType(PropertyType type,
WrappedRecord context) { … }
template <class NodeClass>
void ASTPropsEmitter::emitNodeReaderWriterClass(const ReaderWriterInfo &info) { … }
template <class NodeClass>
void ASTPropsEmitter::emitNodeReaderWriterMethod(NodeClass node,
const ReaderWriterInfo &info) { … }
void ASTPropsEmitter::emitPropertiedReaderWriterBody(HasProperties node,
const ReaderWriterInfo &info) { … }
static void emitBasicReaderWriterMethodSuffix(raw_ostream &out,
PropertyType type,
bool isForRead) { … }
void ASTPropsEmitter::emitReadOfProperty(StringRef readerName,
Property property) { … }
void ASTPropsEmitter::emitReadOfProperty(StringRef readerName,
StringRef name,
PropertyType type,
StringRef condition) { … }
void ASTPropsEmitter::emitWriteOfProperty(StringRef writerName,
Property property) { … }
void ASTPropsEmitter::emitWriteOfProperty(StringRef writerName,
StringRef name,
PropertyType type,
StringRef readCode,
StringRef condition) { … }
template <class NodeClass>
static void emitASTReader(const RecordKeeper &records, raw_ostream &out,
StringRef description) { … }
void clang::EmitClangTypeReader(const RecordKeeper &records, raw_ostream &out) { … }
template <class NodeClass>
static void emitASTWriter(const RecordKeeper &records, raw_ostream &out,
StringRef description) { … }
void clang::EmitClangTypeWriter(const RecordKeeper &records, raw_ostream &out) { … }
void
ASTPropsEmitter::emitDispatcherTemplate(const ReaderWriterInfo &info) { … }
void
ASTPropsEmitter::emitPackUnpackOptionalTemplate(const ReaderWriterInfo &info) { … }
void
ASTPropsEmitter::emitBasicReaderWriterTemplate(const ReaderWriterInfo &info) { … }
void ASTPropsEmitter::emitCasedReaderWriterMethodBody(PropertyType type,
const CasedTypeInfo &typeCases,
const ReaderWriterInfo &info) { … }
void ASTPropsEmitter::emitBasicReaderWriterFile(const ReaderWriterInfo &info) { … }
void clang::EmitClangBasicReader(const RecordKeeper &records,
raw_ostream &out) { … }
void clang::EmitClangBasicWriter(const RecordKeeper &records,
raw_ostream &out) { … }