#include "llvm/ProfileData/PGOCtxProfWriter.h"
#include "llvm/Bitstream/BitCodeEnums.h"
#include "llvm/ProfileData/CtxInstrContextNode.h"
#include "llvm/Support/JSON.h"
usingnamespacellvm;
usingnamespacellvm::ctx_profile;
PGOCtxProfileWriter::PGOCtxProfileWriter(
raw_ostream &Out, std::optional<unsigned> VersionOverride)
: … { … }
void PGOCtxProfileWriter::writeCounters(const ContextNode &Node) { … }
void PGOCtxProfileWriter::writeImpl(std::optional<uint32_t> CallerIndex,
const ContextNode &Node) { … }
void PGOCtxProfileWriter::write(const ContextNode &RootNode) { … }
namespace {
struct DeserializableCtx { … };
ctx_profile::ContextNode *
createNode(std::vector<std::unique_ptr<char[]>> &Nodes,
const std::vector<DeserializableCtx> &DCList);
ctx_profile::ContextNode *
createNode(std::vector<std::unique_ptr<char[]>> &Nodes,
const DeserializableCtx &DC,
ctx_profile::ContextNode *Next = nullptr) { … }
ctx_profile::ContextNode *
createNode(std::vector<std::unique_ptr<char[]>> &Nodes,
const std::vector<DeserializableCtx> &DCList) { … }
}
namespace llvm {
namespace json {
bool fromJSON(const Value &E, DeserializableCtx &R, Path P) { … }
}
}
Error llvm::createCtxProfFromJSON(StringRef Profile, raw_ostream &Out) { … }