17 #ifndef LLVM_CLANG_EXTRACTAPI_SERIALIZATION_SYMBOLGRAPHSERIALIZER_H
18 #define LLVM_CLANG_EXTRACTAPI_SERIALIZATION_SYMBOLGRAPHSERIALIZER_H
24 #include "llvm/ADT/DenseMap.h"
25 #include "llvm/ADT/SmallString.h"
26 #include "llvm/ADT/SmallVector.h"
27 #include "llvm/ADT/StringMap.h"
28 #include "llvm/ADT/StringRef.h"
29 #include "llvm/ADT/StringSet.h"
30 #include "llvm/ADT/Twine.h"
31 #include "llvm/Support/JSON.h"
32 #include "llvm/Support/VersionTuple.h"
33 #include "llvm/Support/raw_ostream.h"
37 namespace extractapi {
45 bool EmitSymbolLabelsForTesting =
false;
59 Object *addSymbol(Object &&Symbol);
61 void addRelationship(Object &&Relationship);
85 llvm::StringMap<ExtendedModule> ExtendedModules;
88 static const VersionTuple FormatVersion;
92 bool ForceEmitToMainModule;
103 const bool EmitSymbolLabelsForTesting =
false;
105 const bool SkipSymbolsInCategoriesToExternalTypes =
false;
108 Object *CurrentSymbol =
nullptr;
115 serializeMainSymbolGraph(raw_ostream &OS,
const APISet &API,
119 static void serializeWithExtensionGraphs(
120 raw_ostream &MainOutput,
const APISet &API,
123 std::unique_ptr<llvm::raw_pwrite_stream>(llvm::Twine BaseFileName)>
132 static std::optional<Object> serializeSingleSymbolSGF(StringRef USR,
137 enum RelationshipKind {
159 static StringRef getRelationshipString(RelationshipKind
Kind);
161 void serializeRelationship(RelationshipKind
Kind,
166 enum ConstraintKind { Conformance, ConditionalConformance };
168 static StringRef getConstraintString(ConstraintKind
Kind);
178 void serializeGraphToStream(raw_ostream &OS,
186 Object serializeMetadata()
const;
194 Object serializeModuleObject(StringRef ModuleName)
const;
238 bool visitClassTemplatePartialSpecializationRecord(
252 bool visitGlobalVariableTemplatePartialSpecializationRecord(
275 bool EmitSymbolLabelsForTesting =
false,
276 bool ForceEmitToMainModule =
false,
277 bool SkipSymbolsInCategoriesToExternalTypes =
false)
278 :
Base(API), ForceEmitToMainModule(ForceEmitToMainModule),
279 IgnoresList(IgnoresList),
280 EmitSymbolLabelsForTesting(EmitSymbolLabelsForTesting),
281 SkipSymbolsInCategoriesToExternalTypes(
282 SkipSymbolsInCategoriesToExternalTypes) {}
This file defines the ExtractAPI APISetVisitor interface.
This file defines the APIRecord-based structs and the APISet class.
llvm::MachO::Target Target
llvm::MachO::Record Record
Defines the clang::Module class, which describes a module in the source code.
The JSON file list parser is used to communicate input to InstallAPI.