Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 1 | //=- tools/dsymutil/DebugMap.h - Generic debug map representation -*- C++ -*-=// |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 2 | // |
Jonas Devlieghere | 928fea2 | 2018-06-27 16:13:40 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 9 | // |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 10 | /// \file |
| 11 | /// |
| 12 | /// This file contains the class declaration of the DebugMap |
| 13 | /// entity. A DebugMap lists all the object files linked together to |
| 14 | /// produce an executable along with the linked address of all the |
| 15 | /// atoms used in these object files. |
| 16 | /// The DebugMap is an input to the DwarfLinker class that will |
| 17 | /// extract the Dwarf debug information from the referenced object |
| 18 | /// files and link their usefull debug info together. |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 19 | // |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 20 | //===----------------------------------------------------------------------===// |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 21 | |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 22 | #ifndef LLVM_TOOLS_DSYMUTIL_DEBUGMAP_H |
| 23 | #define LLVM_TOOLS_DSYMUTIL_DEBUGMAP_H |
| 24 | |
Frederic Riss | e9483b8 | 2015-02-13 23:18:16 +0000 | [diff] [blame] | 25 | #include "llvm/ADT/DenseMap.h" |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 26 | #include "llvm/ADT/Optional.h" |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 27 | #include "llvm/ADT/StringMap.h" |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 28 | #include "llvm/ADT/StringRef.h" |
Frederic Riss | 8732027 | 2015-01-19 23:33:14 +0000 | [diff] [blame] | 29 | #include "llvm/ADT/Triple.h" |
Chandler Carruth | 1b27914 | 2015-01-14 11:23:27 +0000 | [diff] [blame] | 30 | #include "llvm/ADT/iterator_range.h" |
Jonas Devlieghere | 6169346 | 2018-02-08 10:48:54 +0000 | [diff] [blame] | 31 | #include "llvm/Object/MachO.h" |
Pavel Labath | 73ce0c0 | 2016-11-09 11:43:52 +0000 | [diff] [blame] | 32 | #include "llvm/Support/Chrono.h" |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 33 | #include "llvm/Support/ErrorOr.h" |
Frederic Riss | 786b471 | 2015-06-01 21:12:45 +0000 | [diff] [blame] | 34 | #include "llvm/Support/YAMLTraits.h" |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 35 | #include <chrono> |
| 36 | #include <cstddef> |
| 37 | #include <cstdint> |
| 38 | #include <memory> |
| 39 | #include <string> |
| 40 | #include <utility> |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 41 | #include <vector> |
| 42 | |
| 43 | namespace llvm { |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 44 | |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 45 | class raw_ostream; |
| 46 | |
| 47 | namespace dsymutil { |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 48 | |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 49 | class DebugMapObject; |
| 50 | |
Jonas Devlieghere | 92a76c5 | 2018-02-22 11:43:43 +0000 | [diff] [blame] | 51 | /// The DebugMap object stores the list of object files to query for debug |
| 52 | /// information along with the mapping between the symbols' addresses in the |
| 53 | /// object file to their linked address in the linked binary. |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 54 | /// |
| 55 | /// A DebugMap producer could look like this: |
| 56 | /// DebugMap *DM = new DebugMap(); |
| 57 | /// for (const auto &Obj: LinkedObjects) { |
| 58 | /// DebugMapObject &DMO = DM->addDebugMapObject(Obj.getPath()); |
| 59 | /// for (const auto &Sym: Obj.getLinkedSymbols()) |
| 60 | /// DMO.addSymbol(Sym.getName(), Sym.getObjectFileAddress(), |
| 61 | /// Sym.getBinaryAddress()); |
| 62 | /// } |
| 63 | /// |
| 64 | /// A DebugMap consumer can then use the map to link the debug |
| 65 | /// information. For example something along the lines of: |
| 66 | /// for (const auto &DMO: DM->objects()) { |
| 67 | /// auto Obj = createBinary(DMO.getObjectFilename()); |
| 68 | /// for (auto &DIE: Obj.getDwarfDIEs()) { |
| 69 | /// if (SymbolMapping *Sym = DMO.lookup(DIE.getName())) |
| 70 | /// DIE.relocate(Sym->ObjectAddress, Sym->BinaryAddress); |
| 71 | /// else |
| 72 | /// DIE.discardSubtree(); |
| 73 | /// } |
| 74 | /// } |
| 75 | class DebugMap { |
Frederic Riss | 8732027 | 2015-01-19 23:33:14 +0000 | [diff] [blame] | 76 | Triple BinaryTriple; |
Frederic Riss | 65ce0b1 | 2015-08-26 05:09:59 +0000 | [diff] [blame] | 77 | std::string BinaryPath; |
Jonas Devlieghere | 20767d1 | 2019-01-07 23:27:25 +0000 | [diff] [blame] | 78 | std::vector<uint8_t> BinaryUUID; |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 79 | using ObjectContainer = std::vector<std::unique_ptr<DebugMapObject>>; |
| 80 | |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 81 | ObjectContainer Objects; |
| 82 | |
Frederic Riss | 786b471 | 2015-06-01 21:12:45 +0000 | [diff] [blame] | 83 | /// For YAML IO support. |
| 84 | ///@{ |
Frederic Riss | 696c93c | 2015-06-03 20:29:24 +0000 | [diff] [blame] | 85 | friend yaml::MappingTraits<std::unique_ptr<DebugMap>>; |
Frederic Riss | 786b471 | 2015-06-01 21:12:45 +0000 | [diff] [blame] | 86 | friend yaml::MappingTraits<DebugMap>; |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 87 | |
Frederic Riss | 786b471 | 2015-06-01 21:12:45 +0000 | [diff] [blame] | 88 | DebugMap() = default; |
| 89 | ///@} |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 90 | |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 91 | public: |
Jonas Devlieghere | 20767d1 | 2019-01-07 23:27:25 +0000 | [diff] [blame] | 92 | DebugMap(const Triple &BinaryTriple, StringRef BinaryPath, |
| 93 | ArrayRef<uint8_t> BinaryUUID = ArrayRef<uint8_t>()) |
| 94 | : BinaryTriple(BinaryTriple), BinaryPath(BinaryPath), |
| 95 | BinaryUUID(BinaryUUID.begin(), BinaryUUID.end()) {} |
Frederic Riss | 8732027 | 2015-01-19 23:33:14 +0000 | [diff] [blame] | 96 | |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 97 | using const_iterator = ObjectContainer::const_iterator; |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 98 | |
| 99 | iterator_range<const_iterator> objects() const { |
| 100 | return make_range(begin(), end()); |
| 101 | } |
| 102 | |
| 103 | const_iterator begin() const { return Objects.begin(); } |
| 104 | |
| 105 | const_iterator end() const { return Objects.end(); } |
| 106 | |
Jonas Devlieghere | a4c60c4 | 2018-03-13 10:52:49 +0000 | [diff] [blame] | 107 | unsigned getNumberOfObjects() const { return Objects.size(); } |
| 108 | |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 109 | /// This function adds an DebugMapObject to the list owned by this |
| 110 | /// debug map. |
Pavel Labath | 73ce0c0 | 2016-11-09 11:43:52 +0000 | [diff] [blame] | 111 | DebugMapObject & |
| 112 | addDebugMapObject(StringRef ObjectFilePath, |
Francis Ricci | 6f200df | 2017-10-06 14:49:20 +0000 | [diff] [blame] | 113 | sys::TimePoint<std::chrono::seconds> Timestamp, |
Jonas Devlieghere | 6169346 | 2018-02-08 10:48:54 +0000 | [diff] [blame] | 114 | uint8_t Type = llvm::MachO::N_OSO); |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 115 | |
Frederic Riss | a646d27 | 2015-02-28 00:28:56 +0000 | [diff] [blame] | 116 | const Triple &getTriple() const { return BinaryTriple; } |
Frederic Riss | 8732027 | 2015-01-19 23:33:14 +0000 | [diff] [blame] | 117 | |
Jonas Devlieghere | 20767d1 | 2019-01-07 23:27:25 +0000 | [diff] [blame] | 118 | const ArrayRef<uint8_t> getUUID() const { |
| 119 | return ArrayRef<uint8_t>(BinaryUUID); |
| 120 | } |
| 121 | |
Frederic Riss | 65ce0b1 | 2015-08-26 05:09:59 +0000 | [diff] [blame] | 122 | StringRef getBinaryPath() const { return BinaryPath; } |
| 123 | |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 124 | void print(raw_ostream &OS) const; |
| 125 | |
| 126 | #ifndef NDEBUG |
| 127 | void dump() const; |
| 128 | #endif |
Frederic Riss | 527bb61 | 2015-06-05 20:27:04 +0000 | [diff] [blame] | 129 | |
| 130 | /// Read a debug map for \a InputFile. |
Frederic Riss | 7a42578 | 2015-08-05 18:27:44 +0000 | [diff] [blame] | 131 | static ErrorOr<std::vector<std::unique_ptr<DebugMap>>> |
Frederic Riss | 527bb61 | 2015-06-05 20:27:04 +0000 | [diff] [blame] | 132 | parseYAMLDebugMap(StringRef InputFile, StringRef PrependPath, bool Verbose); |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 133 | }; |
| 134 | |
Jonas Devlieghere | 92a76c5 | 2018-02-22 11:43:43 +0000 | [diff] [blame] | 135 | /// The DebugMapObject represents one object file described by the DebugMap. It |
| 136 | /// contains a list of mappings between addresses in the object file and in the |
| 137 | /// linked binary for all the linked atoms in this object file. |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 138 | class DebugMapObject { |
| 139 | public: |
| 140 | struct SymbolMapping { |
Frederic Riss | c5413fc | 2016-01-31 04:29:22 +0000 | [diff] [blame] | 141 | Optional<yaml::Hex64> ObjectAddress; |
Frederic Riss | 786b471 | 2015-06-01 21:12:45 +0000 | [diff] [blame] | 142 | yaml::Hex64 BinaryAddress; |
| 143 | yaml::Hex32 Size; |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 144 | |
Frederic Riss | c5413fc | 2016-01-31 04:29:22 +0000 | [diff] [blame] | 145 | SymbolMapping(Optional<uint64_t> ObjectAddr, uint64_t BinaryAddress, |
| 146 | uint32_t Size) |
| 147 | : BinaryAddress(BinaryAddress), Size(Size) { |
| 148 | if (ObjectAddr) |
| 149 | ObjectAddress = *ObjectAddr; |
| 150 | } |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 151 | |
Frederic Riss | 786b471 | 2015-06-01 21:12:45 +0000 | [diff] [blame] | 152 | /// For YAML IO support |
| 153 | SymbolMapping() = default; |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 154 | }; |
| 155 | |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 156 | using YAMLSymbolMapping = std::pair<std::string, SymbolMapping>; |
| 157 | using DebugMapEntry = StringMapEntry<SymbolMapping>; |
Frederic Riss | e9483b8 | 2015-02-13 23:18:16 +0000 | [diff] [blame] | 158 | |
Jonas Devlieghere | 92a76c5 | 2018-02-22 11:43:43 +0000 | [diff] [blame] | 159 | /// Adds a symbol mapping to this DebugMapObject. |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 160 | /// \returns false if the symbol was already registered. The request |
| 161 | /// is discarded in this case. |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 162 | bool addSymbol(StringRef SymName, Optional<uint64_t> ObjectAddress, |
Frederic Riss | e7a3564 | 2015-03-15 01:29:30 +0000 | [diff] [blame] | 163 | uint64_t LinkedAddress, uint32_t Size); |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 164 | |
Jonas Devlieghere | 92a76c5 | 2018-02-22 11:43:43 +0000 | [diff] [blame] | 165 | /// Lookup a symbol mapping. |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 166 | /// \returns null if the symbol isn't found. |
Frederic Riss | e9483b8 | 2015-02-13 23:18:16 +0000 | [diff] [blame] | 167 | const DebugMapEntry *lookupSymbol(StringRef SymbolName) const; |
| 168 | |
Jonas Devlieghere | 92a76c5 | 2018-02-22 11:43:43 +0000 | [diff] [blame] | 169 | /// Lookup an object file address. |
Frederic Riss | e9483b8 | 2015-02-13 23:18:16 +0000 | [diff] [blame] | 170 | /// \returns null if the address isn't found. |
| 171 | const DebugMapEntry *lookupObjectAddress(uint64_t Address) const; |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 172 | |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 173 | StringRef getObjectFilename() const { return Filename; } |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 174 | |
Pavel Labath | 73ce0c0 | 2016-11-09 11:43:52 +0000 | [diff] [blame] | 175 | sys::TimePoint<std::chrono::seconds> getTimestamp() const { |
| 176 | return Timestamp; |
| 177 | } |
Frederic Riss | 00d14dd | 2015-07-22 23:24:00 +0000 | [diff] [blame] | 178 | |
Francis Ricci | 6f200df | 2017-10-06 14:49:20 +0000 | [diff] [blame] | 179 | uint8_t getType() const { return Type; } |
| 180 | |
Frederic Riss | 469f438 | 2015-03-15 02:02:53 +0000 | [diff] [blame] | 181 | iterator_range<StringMap<SymbolMapping>::const_iterator> symbols() const { |
| 182 | return make_range(Symbols.begin(), Symbols.end()); |
| 183 | } |
| 184 | |
Jonas Devlieghere | 67eb8fd | 2018-04-02 10:40:43 +0000 | [diff] [blame] | 185 | bool empty() const { return Symbols.empty(); } |
| 186 | |
| 187 | void addWarning(StringRef Warning) { Warnings.push_back(Warning); } |
| 188 | const std::vector<std::string> &getWarnings() const { return Warnings; } |
| 189 | |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 190 | void print(raw_ostream &OS) const; |
| 191 | #ifndef NDEBUG |
| 192 | void dump() const; |
| 193 | #endif |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 194 | |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 195 | private: |
| 196 | friend class DebugMap; |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 197 | |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 198 | /// DebugMapObjects can only be constructed by the owning DebugMap. |
Pavel Labath | 73ce0c0 | 2016-11-09 11:43:52 +0000 | [diff] [blame] | 199 | DebugMapObject(StringRef ObjectFilename, |
Francis Ricci | 6f200df | 2017-10-06 14:49:20 +0000 | [diff] [blame] | 200 | sys::TimePoint<std::chrono::seconds> Timestamp, uint8_t Type); |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 201 | |
| 202 | std::string Filename; |
Pavel Labath | 73ce0c0 | 2016-11-09 11:43:52 +0000 | [diff] [blame] | 203 | sys::TimePoint<std::chrono::seconds> Timestamp; |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 204 | StringMap<SymbolMapping> Symbols; |
Frederic Riss | e9483b8 | 2015-02-13 23:18:16 +0000 | [diff] [blame] | 205 | DenseMap<uint64_t, DebugMapEntry *> AddressToMapping; |
Francis Ricci | 6f200df | 2017-10-06 14:49:20 +0000 | [diff] [blame] | 206 | uint8_t Type; |
Frederic Riss | 786b471 | 2015-06-01 21:12:45 +0000 | [diff] [blame] | 207 | |
Jonas Devlieghere | 67eb8fd | 2018-04-02 10:40:43 +0000 | [diff] [blame] | 208 | std::vector<std::string> Warnings; |
| 209 | |
Frederic Riss | 786b471 | 2015-06-01 21:12:45 +0000 | [diff] [blame] | 210 | /// For YAMLIO support. |
| 211 | ///@{ |
Frederic Riss | 786b471 | 2015-06-01 21:12:45 +0000 | [diff] [blame] | 212 | friend yaml::MappingTraits<dsymutil::DebugMapObject>; |
| 213 | friend yaml::SequenceTraits<std::vector<std::unique_ptr<DebugMapObject>>>; |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 214 | |
Frederic Riss | 786b471 | 2015-06-01 21:12:45 +0000 | [diff] [blame] | 215 | DebugMapObject() = default; |
Frederic Riss | 0f58c38 | 2015-06-05 20:27:07 +0000 | [diff] [blame] | 216 | |
| 217 | public: |
Benjamin Kramer | bf85e05 | 2016-10-27 15:23:44 +0000 | [diff] [blame] | 218 | DebugMapObject(DebugMapObject &&) = default; |
| 219 | DebugMapObject &operator=(DebugMapObject &&) = default; |
Frederic Riss | 786b471 | 2015-06-01 21:12:45 +0000 | [diff] [blame] | 220 | ///@} |
| 221 | }; |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 222 | |
| 223 | } // end namespace dsymutil |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 224 | } // end namespace llvm |
Frederic Riss | 786b471 | 2015-06-01 21:12:45 +0000 | [diff] [blame] | 225 | |
Frederic Riss | 1392cf2 | 2015-06-01 21:25:53 +0000 | [diff] [blame] | 226 | LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::dsymutil::DebugMapObject::YAMLSymbolMapping) |
Frederic Riss | 786b471 | 2015-06-01 21:12:45 +0000 | [diff] [blame] | 227 | |
| 228 | namespace llvm { |
| 229 | namespace yaml { |
| 230 | |
| 231 | using namespace llvm::dsymutil; |
| 232 | |
| 233 | template <> |
| 234 | struct MappingTraits<std::pair<std::string, DebugMapObject::SymbolMapping>> { |
Frederic Riss | 527bb61 | 2015-06-05 20:27:04 +0000 | [diff] [blame] | 235 | static void mapping(IO &io, |
| 236 | std::pair<std::string, DebugMapObject::SymbolMapping> &s); |
Frederic Riss | 786b471 | 2015-06-01 21:12:45 +0000 | [diff] [blame] | 237 | static const bool flow = true; |
| 238 | }; |
| 239 | |
| 240 | template <> struct MappingTraits<dsymutil::DebugMapObject> { |
Frederic Riss | 527bb61 | 2015-06-05 20:27:04 +0000 | [diff] [blame] | 241 | struct YamlDMO; |
| 242 | static void mapping(IO &io, dsymutil::DebugMapObject &DMO); |
Frederic Riss | 786b471 | 2015-06-01 21:12:45 +0000 | [diff] [blame] | 243 | }; |
| 244 | |
| 245 | template <> struct ScalarTraits<Triple> { |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 246 | static void output(const Triple &val, void *, raw_ostream &out); |
Frederic Riss | 527bb61 | 2015-06-05 20:27:04 +0000 | [diff] [blame] | 247 | static StringRef input(StringRef scalar, void *, Triple &value); |
Francis Visoiu Mistrih | 65ad22d | 2017-12-18 17:38:03 +0000 | [diff] [blame] | 248 | static QuotingType mustQuote(StringRef) { return QuotingType::Single; } |
Frederic Riss | 786b471 | 2015-06-01 21:12:45 +0000 | [diff] [blame] | 249 | }; |
| 250 | |
| 251 | template <> |
| 252 | struct SequenceTraits<std::vector<std::unique_ptr<dsymutil::DebugMapObject>>> { |
Frederic Riss | 786b471 | 2015-06-01 21:12:45 +0000 | [diff] [blame] | 253 | static size_t |
Frederic Riss | 527bb61 | 2015-06-05 20:27:04 +0000 | [diff] [blame] | 254 | size(IO &io, std::vector<std::unique_ptr<dsymutil::DebugMapObject>> &seq); |
Frederic Riss | 786b471 | 2015-06-01 21:12:45 +0000 | [diff] [blame] | 255 | static dsymutil::DebugMapObject & |
| 256 | element(IO &, std::vector<std::unique_ptr<dsymutil::DebugMapObject>> &seq, |
Frederic Riss | 527bb61 | 2015-06-05 20:27:04 +0000 | [diff] [blame] | 257 | size_t index); |
Frederic Riss | 786b471 | 2015-06-01 21:12:45 +0000 | [diff] [blame] | 258 | }; |
| 259 | |
| 260 | template <> struct MappingTraits<dsymutil::DebugMap> { |
Frederic Riss | 527bb61 | 2015-06-05 20:27:04 +0000 | [diff] [blame] | 261 | static void mapping(IO &io, dsymutil::DebugMap &DM); |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 262 | }; |
Frederic Riss | 696c93c | 2015-06-03 20:29:24 +0000 | [diff] [blame] | 263 | |
Frederic Riss | 527bb61 | 2015-06-05 20:27:04 +0000 | [diff] [blame] | 264 | template <> struct MappingTraits<std::unique_ptr<dsymutil::DebugMap>> { |
| 265 | static void mapping(IO &io, std::unique_ptr<dsymutil::DebugMap> &DM); |
Frederic Riss | 696c93c | 2015-06-03 20:29:24 +0000 | [diff] [blame] | 266 | }; |
Eugene Zelenko | 66f724e | 2017-11-01 21:16:06 +0000 | [diff] [blame] | 267 | |
| 268 | } // end namespace yaml |
| 269 | } // end namespace llvm |
Frederic Riss | 31e081e | 2014-12-12 17:31:24 +0000 | [diff] [blame] | 270 | |
| 271 | #endif // LLVM_TOOLS_DSYMUTIL_DEBUGMAP_H |