//===- InlineInfo.h ---------------------------------------------*- C++ -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// #ifndef LLVM_DEBUGINFO_GSYM_INLINEINFO_H #define LLVM_DEBUGINFO_GSYM_INLINEINFO_H #include "llvm/DebugInfo/GSYM/ExtractRanges.h" #include "llvm/DebugInfo/GSYM/LineEntry.h" #include "llvm/DebugInfo/GSYM/LookupResult.h" #include "llvm/Support/Error.h" #include <stdint.h> #include <vector> namespace llvm { class raw_ostream; namespace gsym { class GsymReader; /// Inline information stores the name of the inline function along with /// an array of address ranges. It also stores the call file and call line /// that called this inline function. This allows us to unwind inline call /// stacks back to the inline or concrete function that called this /// function. Inlined functions contained in this function are stored in the /// "Children" variable. All address ranges must be sorted and all address /// ranges of all children must be contained in the ranges of this function. /// Any clients that encode information will need to ensure the ranges are /// all contined correctly or lookups could fail. Add ranges in these objects /// must be contained in the top level FunctionInfo address ranges as well. /// /// ENCODING /// /// When saved to disk, the inline info encodes all ranges to be relative to /// a parent address range. This will be the FunctionInfo's start address if /// the InlineInfo is directly contained in a FunctionInfo, or a the start /// address of the containing parent InlineInfo's first "Ranges" member. This /// allows address ranges to be efficiently encoded using ULEB128 encodings as /// we encode the offset and size of each range instead of full addresses. This /// also makes any encoded addresses easy to relocate as we just need to /// relocate the FunctionInfo's start address. /// /// - The AddressRanges member "Ranges" is encoded using an appropriate base /// address as described above. /// - UINT8 boolean value that specifies if the InlineInfo object has children. /// - UINT32 string table offset that points to the name of the inline /// function. /// - ULEB128 integer that specifies the file of the call site that called /// this function. /// - ULEB128 integer that specifies the source line of the call site that /// called this function. /// - if this object has children, enocode each child InlineInfo using the /// the first address range's start address as the base address. /// struct InlineInfo { … }; inline bool operator==(const InlineInfo &LHS, const InlineInfo &RHS) { … } raw_ostream &operator<<(raw_ostream &OS, const InlineInfo &FI); } // namespace gsym } // namespace llvm #endif // LLVM_DEBUGINFO_GSYM_INLINEINFO_H