File indexing completed on 2026-05-10 08:43:23
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef LLVM_CGDATA_STABLEFUNCTIONMAPRECORD_H
0017 #define LLVM_CGDATA_STABLEFUNCTIONMAPRECORD_H
0018
0019 #include "llvm/CGData/StableFunctionMap.h"
0020 #include "llvm/ObjectYAML/YAML.h"
0021 #include "llvm/Support/raw_ostream.h"
0022
0023 namespace llvm {
0024
0025 struct StableFunctionMapRecord {
0026 std::unique_ptr<StableFunctionMap> FunctionMap;
0027
0028 StableFunctionMapRecord() {
0029 FunctionMap = std::make_unique<StableFunctionMap>();
0030 }
0031
0032 StableFunctionMapRecord(std::unique_ptr<StableFunctionMap> FunctionMap)
0033 : FunctionMap(std::move(FunctionMap)) {}
0034
0035
0036
0037 static void serialize(raw_ostream &OS, const StableFunctionMap *FunctionMap);
0038
0039
0040 void serialize(raw_ostream &OS) const;
0041
0042
0043 void deserialize(const unsigned char *&Ptr);
0044
0045
0046 void serializeYAML(yaml::Output &YOS) const;
0047
0048
0049 void deserializeYAML(yaml::Input &YIS);
0050
0051
0052 void finalize(bool SkipTrim = false) { FunctionMap->finalize(SkipTrim); }
0053
0054
0055 void merge(const StableFunctionMapRecord &Other) {
0056 FunctionMap->merge(*Other.FunctionMap);
0057 }
0058
0059
0060 bool empty() const { return FunctionMap->empty(); }
0061
0062
0063 void print(raw_ostream &OS = llvm::errs()) const {
0064 yaml::Output YOS(OS);
0065 serializeYAML(YOS);
0066 }
0067 };
0068
0069 }
0070
0071 #endif