File indexing completed on 2026-05-10 08:43:51
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef LLVM_EXECUTIONENGINE_ORC_SHARED_VTUNESHAREDSTRUCTS_H
0014 #define LLVM_EXECUTIONENGINE_ORC_SHARED_VTUNESHAREDSTRUCTS_H
0015
0016 #include "ExecutorAddress.h"
0017 #include <utility>
0018 #include <vector>
0019
0020 namespace llvm {
0021 namespace orc {
0022
0023 using VTuneLineTable = std::vector<std::pair<unsigned, unsigned>>;
0024
0025
0026
0027
0028
0029
0030
0031 struct VTuneMethodInfo {
0032 VTuneLineTable LineTable;
0033 ExecutorAddr LoadAddr;
0034 uint64_t LoadSize;
0035 uint64_t MethodID;
0036 uint32_t NameSI;
0037 uint32_t ClassFileSI;
0038 uint32_t SourceFileSI;
0039 uint32_t ParentMI;
0040 };
0041
0042 using VTuneMethodTable = std::vector<VTuneMethodInfo>;
0043 using VTuneStringTable = std::vector<std::string>;
0044
0045 struct VTuneMethodBatch {
0046 VTuneMethodTable Methods;
0047 VTuneStringTable Strings;
0048 };
0049
0050 using VTuneUnloadedMethodIDs = SmallVector<std::pair<uint64_t, uint64_t>>;
0051
0052 namespace shared {
0053
0054 using SPSVTuneLineTable = SPSSequence<SPSTuple<uint32_t, uint32_t>>;
0055 using SPSVTuneMethodInfo =
0056 SPSTuple<SPSVTuneLineTable, SPSExecutorAddr, uint64_t, uint64_t, uint32_t,
0057 uint32_t, uint32_t, uint32_t>;
0058 using SPSVTuneMethodTable = SPSSequence<SPSVTuneMethodInfo>;
0059 using SPSVTuneStringTable = SPSSequence<SPSString>;
0060 using SPSVTuneMethodBatch = SPSTuple<SPSVTuneMethodTable, SPSVTuneStringTable>;
0061 using SPSVTuneUnloadedMethodIDs = SPSSequence<SPSTuple<uint64_t, uint64_t>>;
0062
0063 template <> class SPSSerializationTraits<SPSVTuneMethodInfo, VTuneMethodInfo> {
0064 public:
0065 static size_t size(const VTuneMethodInfo &MI) {
0066 return SPSVTuneMethodInfo::AsArgList::size(
0067 MI.LineTable, MI.LoadAddr, MI.LoadSize, MI.MethodID, MI.NameSI,
0068 MI.ClassFileSI, MI.SourceFileSI, MI.ParentMI);
0069 }
0070
0071 static bool deserialize(SPSInputBuffer &IB, VTuneMethodInfo &MI) {
0072 return SPSVTuneMethodInfo::AsArgList::deserialize(
0073 IB, MI.LineTable, MI.LoadAddr, MI.LoadSize, MI.MethodID, MI.NameSI,
0074 MI.ClassFileSI, MI.SourceFileSI, MI.ParentMI);
0075 }
0076
0077 static bool serialize(SPSOutputBuffer &OB, const VTuneMethodInfo &MI) {
0078 return SPSVTuneMethodInfo::AsArgList::serialize(
0079 OB, MI.LineTable, MI.LoadAddr, MI.LoadSize, MI.MethodID, MI.NameSI,
0080 MI.ClassFileSI, MI.SourceFileSI, MI.ParentMI);
0081 }
0082 };
0083
0084 template <>
0085 class SPSSerializationTraits<SPSVTuneMethodBatch, VTuneMethodBatch> {
0086 public:
0087 static size_t size(const VTuneMethodBatch &MB) {
0088 return SPSVTuneMethodBatch::AsArgList::size(MB.Methods, MB.Strings);
0089 }
0090
0091 static bool deserialize(SPSInputBuffer &IB, VTuneMethodBatch &MB) {
0092 return SPSVTuneMethodBatch::AsArgList::deserialize(IB, MB.Methods,
0093 MB.Strings);
0094 }
0095
0096 static bool serialize(SPSOutputBuffer &OB, const VTuneMethodBatch &MB) {
0097 return SPSVTuneMethodBatch::AsArgList::serialize(OB, MB.Methods,
0098 MB.Strings);
0099 }
0100 };
0101
0102 }
0103 }
0104 }
0105
0106 #endif