diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
commit | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch) | |
tree | 64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/libs/llvm12/include/llvm/DebugInfo/PDB | |
parent | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff) | |
download | ydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/llvm12/include/llvm/DebugInfo/PDB')
12 files changed, 331 insertions, 331 deletions
diff --git a/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/DIA/DIASession.h b/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/DIA/DIASession.h index 0452ab767a..48b167843f 100644 --- a/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/DIA/DIASession.h +++ b/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/DIA/DIASession.h @@ -1,104 +1,104 @@ -#pragma once - -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#endif - -//===- DIASession.h - DIA implementation of IPDBSession ---------*- 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_PDB_DIA_DIASESSION_H -#define LLVM_DEBUGINFO_PDB_DIA_DIASESSION_H - -#include "DIASupport.h" -#include "llvm/DebugInfo/PDB/IPDBSession.h" -#include "llvm/Support/Error.h" - -#include <system_error> - -namespace llvm { -class StringRef; - -namespace pdb { -class DIASession : public IPDBSession { -public: - explicit DIASession(CComPtr<IDiaSession> DiaSession); - - static Error createFromPdb(StringRef Path, - std::unique_ptr<IPDBSession> &Session); - static Error createFromExe(StringRef Path, - std::unique_ptr<IPDBSession> &Session); - - uint64_t getLoadAddress() const override; - bool setLoadAddress(uint64_t Address) override; - std::unique_ptr<PDBSymbolExe> getGlobalScope() override; - std::unique_ptr<PDBSymbol> getSymbolById(SymIndexId SymbolId) const override; - - bool addressForVA(uint64_t VA, uint32_t &Section, - uint32_t &Offset) const override; - bool addressForRVA(uint32_t RVA, uint32_t &Section, - uint32_t &Offset) const override; - - std::unique_ptr<PDBSymbol> findSymbolByAddress(uint64_t Address, - PDB_SymType Type) override; - std::unique_ptr<PDBSymbol> findSymbolByRVA(uint32_t RVA, - PDB_SymType Type) override; - std::unique_ptr<PDBSymbol> findSymbolBySectOffset(uint32_t Section, - uint32_t Offset, - PDB_SymType Type) override; - - std::unique_ptr<IPDBEnumLineNumbers> - findLineNumbers(const PDBSymbolCompiland &Compiland, - const IPDBSourceFile &File) const override; - std::unique_ptr<IPDBEnumLineNumbers> - findLineNumbersByAddress(uint64_t Address, uint32_t Length) const override; - std::unique_ptr<IPDBEnumLineNumbers> - findLineNumbersByRVA(uint32_t RVA, uint32_t Length) const override; - std::unique_ptr<IPDBEnumLineNumbers> - findLineNumbersBySectOffset(uint32_t Section, uint32_t Offset, - uint32_t Length) const override; - - std::unique_ptr<IPDBEnumSourceFiles> - findSourceFiles(const PDBSymbolCompiland *Compiland, llvm::StringRef Pattern, - PDB_NameSearchFlags Flags) const override; - std::unique_ptr<IPDBSourceFile> - findOneSourceFile(const PDBSymbolCompiland *Compiland, - llvm::StringRef Pattern, - PDB_NameSearchFlags Flags) const override; - std::unique_ptr<IPDBEnumChildren<PDBSymbolCompiland>> - findCompilandsForSourceFile(llvm::StringRef Pattern, - PDB_NameSearchFlags Flags) const override; - std::unique_ptr<PDBSymbolCompiland> - findOneCompilandForSourceFile(llvm::StringRef Pattern, - PDB_NameSearchFlags Flags) const override; - std::unique_ptr<IPDBEnumSourceFiles> getAllSourceFiles() const override; - std::unique_ptr<IPDBEnumSourceFiles> getSourceFilesForCompiland( - const PDBSymbolCompiland &Compiland) const override; - std::unique_ptr<IPDBSourceFile> - getSourceFileById(uint32_t FileId) const override; - - std::unique_ptr<IPDBEnumDataStreams> getDebugStreams() const override; - - std::unique_ptr<IPDBEnumTables> getEnumTables() const override; - - std::unique_ptr<IPDBEnumInjectedSources> getInjectedSources() const override; - - std::unique_ptr<IPDBEnumSectionContribs> getSectionContribs() const override; - - std::unique_ptr<IPDBEnumFrameData> getFrameData() const override; -private: - CComPtr<IDiaSession> Session; -}; -} // namespace pdb -} // namespace llvm -#endif - -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif +#pragma once + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif + +//===- DIASession.h - DIA implementation of IPDBSession ---------*- 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_PDB_DIA_DIASESSION_H +#define LLVM_DEBUGINFO_PDB_DIA_DIASESSION_H + +#include "DIASupport.h" +#include "llvm/DebugInfo/PDB/IPDBSession.h" +#include "llvm/Support/Error.h" + +#include <system_error> + +namespace llvm { +class StringRef; + +namespace pdb { +class DIASession : public IPDBSession { +public: + explicit DIASession(CComPtr<IDiaSession> DiaSession); + + static Error createFromPdb(StringRef Path, + std::unique_ptr<IPDBSession> &Session); + static Error createFromExe(StringRef Path, + std::unique_ptr<IPDBSession> &Session); + + uint64_t getLoadAddress() const override; + bool setLoadAddress(uint64_t Address) override; + std::unique_ptr<PDBSymbolExe> getGlobalScope() override; + std::unique_ptr<PDBSymbol> getSymbolById(SymIndexId SymbolId) const override; + + bool addressForVA(uint64_t VA, uint32_t &Section, + uint32_t &Offset) const override; + bool addressForRVA(uint32_t RVA, uint32_t &Section, + uint32_t &Offset) const override; + + std::unique_ptr<PDBSymbol> findSymbolByAddress(uint64_t Address, + PDB_SymType Type) override; + std::unique_ptr<PDBSymbol> findSymbolByRVA(uint32_t RVA, + PDB_SymType Type) override; + std::unique_ptr<PDBSymbol> findSymbolBySectOffset(uint32_t Section, + uint32_t Offset, + PDB_SymType Type) override; + + std::unique_ptr<IPDBEnumLineNumbers> + findLineNumbers(const PDBSymbolCompiland &Compiland, + const IPDBSourceFile &File) const override; + std::unique_ptr<IPDBEnumLineNumbers> + findLineNumbersByAddress(uint64_t Address, uint32_t Length) const override; + std::unique_ptr<IPDBEnumLineNumbers> + findLineNumbersByRVA(uint32_t RVA, uint32_t Length) const override; + std::unique_ptr<IPDBEnumLineNumbers> + findLineNumbersBySectOffset(uint32_t Section, uint32_t Offset, + uint32_t Length) const override; + + std::unique_ptr<IPDBEnumSourceFiles> + findSourceFiles(const PDBSymbolCompiland *Compiland, llvm::StringRef Pattern, + PDB_NameSearchFlags Flags) const override; + std::unique_ptr<IPDBSourceFile> + findOneSourceFile(const PDBSymbolCompiland *Compiland, + llvm::StringRef Pattern, + PDB_NameSearchFlags Flags) const override; + std::unique_ptr<IPDBEnumChildren<PDBSymbolCompiland>> + findCompilandsForSourceFile(llvm::StringRef Pattern, + PDB_NameSearchFlags Flags) const override; + std::unique_ptr<PDBSymbolCompiland> + findOneCompilandForSourceFile(llvm::StringRef Pattern, + PDB_NameSearchFlags Flags) const override; + std::unique_ptr<IPDBEnumSourceFiles> getAllSourceFiles() const override; + std::unique_ptr<IPDBEnumSourceFiles> getSourceFilesForCompiland( + const PDBSymbolCompiland &Compiland) const override; + std::unique_ptr<IPDBSourceFile> + getSourceFileById(uint32_t FileId) const override; + + std::unique_ptr<IPDBEnumDataStreams> getDebugStreams() const override; + + std::unique_ptr<IPDBEnumTables> getEnumTables() const override; + + std::unique_ptr<IPDBEnumInjectedSources> getInjectedSources() const override; + + std::unique_ptr<IPDBEnumSectionContribs> getSectionContribs() const override; + + std::unique_ptr<IPDBEnumFrameData> getFrameData() const override; +private: + CComPtr<IDiaSession> Session; +}; +} // namespace pdb +} // namespace llvm +#endif + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif diff --git a/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h b/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h index 52147c36fa..3b3598fc27 100644 --- a/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h +++ b/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h @@ -41,34 +41,34 @@ struct MSFLayout; } namespace pdb { -// Represents merged or unmerged symbols. Merged symbols can be written to the -// output file as is, but unmerged symbols must be rewritten first. In either -// case, the size must be known up front. -struct SymbolListWrapper { - explicit SymbolListWrapper(ArrayRef<uint8_t> Syms) - : SymPtr(const_cast<uint8_t *>(Syms.data())), SymSize(Syms.size()), - NeedsToBeMerged(false) {} - explicit SymbolListWrapper(void *SymSrc, uint32_t Length) - : SymPtr(SymSrc), SymSize(Length), NeedsToBeMerged(true) {} - - ArrayRef<uint8_t> asArray() const { - return ArrayRef<uint8_t>(static_cast<const uint8_t *>(SymPtr), SymSize); - } - - uint32_t size() const { return SymSize; } - - void *SymPtr = nullptr; - uint32_t SymSize = 0; - bool NeedsToBeMerged = false; -}; - -/// Represents a string table reference at some offset in the module symbol -/// stream. -struct StringTableFixup { - uint32_t StrTabOffset = 0; - uint32_t SymOffsetOfReference = 0; -}; - +// Represents merged or unmerged symbols. Merged symbols can be written to the +// output file as is, but unmerged symbols must be rewritten first. In either +// case, the size must be known up front. +struct SymbolListWrapper { + explicit SymbolListWrapper(ArrayRef<uint8_t> Syms) + : SymPtr(const_cast<uint8_t *>(Syms.data())), SymSize(Syms.size()), + NeedsToBeMerged(false) {} + explicit SymbolListWrapper(void *SymSrc, uint32_t Length) + : SymPtr(SymSrc), SymSize(Length), NeedsToBeMerged(true) {} + + ArrayRef<uint8_t> asArray() const { + return ArrayRef<uint8_t>(static_cast<const uint8_t *>(SymPtr), SymSize); + } + + uint32_t size() const { return SymSize; } + + void *SymPtr = nullptr; + uint32_t SymSize = 0; + bool NeedsToBeMerged = false; +}; + +/// Represents a string table reference at some offset in the module symbol +/// stream. +struct StringTableFixup { + uint32_t StrTabOffset = 0; + uint32_t SymOffsetOfReference = 0; +}; + class DbiModuleDescriptorBuilder { friend class DbiStreamBuilder; @@ -83,28 +83,28 @@ public: void setPdbFilePathNI(uint32_t NI); void setObjFileName(StringRef Name); - - // Callback to merge one source of unmerged symbols. - using MergeSymbolsCallback = Error (*)(void *Ctx, void *Symbols, - BinaryStreamWriter &Writer); - - void setMergeSymbolsCallback(void *Ctx, MergeSymbolsCallback Callback) { - MergeSymsCtx = Ctx; - MergeSymsCallback = Callback; - } - - void setStringTableFixups(std::vector<StringTableFixup> &&Fixups) { - StringTableFixups = std::move(Fixups); - } - + + // Callback to merge one source of unmerged symbols. + using MergeSymbolsCallback = Error (*)(void *Ctx, void *Symbols, + BinaryStreamWriter &Writer); + + void setMergeSymbolsCallback(void *Ctx, MergeSymbolsCallback Callback) { + MergeSymsCtx = Ctx; + MergeSymsCallback = Callback; + } + + void setStringTableFixups(std::vector<StringTableFixup> &&Fixups) { + StringTableFixups = std::move(Fixups); + } + void setFirstSectionContrib(const SectionContrib &SC); void addSymbol(codeview::CVSymbol Symbol); void addSymbolsInBulk(ArrayRef<uint8_t> BulkSymbols); - // Add symbols of known size which will be merged (rewritten) when committing - // the PDB to disk. - void addUnmergedSymbols(void *SymSrc, uint32_t SymLength); - + // Add symbols of known size which will be merged (rewritten) when committing + // the PDB to disk. + void addUnmergedSymbols(void *SymSrc, uint32_t SymLength); + void addDebugSubsection(std::shared_ptr<codeview::DebugSubsection> Subsection); @@ -130,15 +130,15 @@ public: void finalize(); Error finalizeMsfLayout(); - /// Commit the DBI descriptor to the DBI stream. - Error commit(BinaryStreamWriter &ModiWriter); + /// Commit the DBI descriptor to the DBI stream. + Error commit(BinaryStreamWriter &ModiWriter); + + /// Commit the accumulated symbols to the module symbol stream. Safe to call + /// in parallel on different DbiModuleDescriptorBuilder objects. Only modifies + /// the pre-allocated stream in question. + Error commitSymbolStream(const msf::MSFLayout &MsfLayout, + WritableBinaryStreamRef MsfBuffer); - /// Commit the accumulated symbols to the module symbol stream. Safe to call - /// in parallel on different DbiModuleDescriptorBuilder objects. Only modifies - /// the pre-allocated stream in question. - Error commitSymbolStream(const msf::MSFLayout &MsfLayout, - WritableBinaryStreamRef MsfBuffer); - private: uint32_t calculateC13DebugInfoSize() const; @@ -150,13 +150,13 @@ private: std::string ModuleName; std::string ObjFileName; std::vector<std::string> SourceFiles; - std::vector<SymbolListWrapper> Symbols; + std::vector<SymbolListWrapper> Symbols; + + void *MergeSymsCtx = nullptr; + MergeSymbolsCallback MergeSymsCallback = nullptr; + + std::vector<StringTableFixup> StringTableFixups; - void *MergeSymsCtx = nullptr; - MergeSymbolsCallback MergeSymsCallback = nullptr; - - std::vector<StringTableFixup> StringTableFixups; - std::vector<codeview::DebugSubsectionRecordBuilder> C13Builders; ModuleInfoHeader Layout; diff --git a/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/NativeEnumSymbols.h b/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/NativeEnumSymbols.h index 76de64f03c..54e3b02876 100644 --- a/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/NativeEnumSymbols.h +++ b/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/NativeEnumSymbols.h @@ -1,52 +1,52 @@ -#pragma once - -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#endif - -//==- NativeEnumSymbols.h - Native Symbols Enumerator impl -------*- 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_PDB_NATIVE_NATIVEENUMSYMBOLS_H -#define LLVM_DEBUGINFO_PDB_NATIVE_NATIVEENUMSYMBOLS_H - -#include "llvm/DebugInfo/CodeView/TypeRecord.h" -#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h" -#include "llvm/DebugInfo/PDB/PDBSymbol.h" - -#include <vector> - -namespace llvm { -namespace pdb { - -class NativeSession; - -class NativeEnumSymbols : public IPDBEnumChildren<PDBSymbol> { -public: - NativeEnumSymbols(NativeSession &Session, std::vector<SymIndexId> Symbols); - - uint32_t getChildCount() const override; - std::unique_ptr<PDBSymbol> getChildAtIndex(uint32_t Index) const override; - std::unique_ptr<PDBSymbol> getNext() override; - void reset() override; - -private: - std::vector<SymIndexId> Symbols; - uint32_t Index; - NativeSession &Session; -}; - -} // namespace pdb -} // namespace llvm - -#endif - -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif +#pragma once + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif + +//==- NativeEnumSymbols.h - Native Symbols Enumerator impl -------*- 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_PDB_NATIVE_NATIVEENUMSYMBOLS_H +#define LLVM_DEBUGINFO_PDB_NATIVE_NATIVEENUMSYMBOLS_H + +#include "llvm/DebugInfo/CodeView/TypeRecord.h" +#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h" +#include "llvm/DebugInfo/PDB/PDBSymbol.h" + +#include <vector> + +namespace llvm { +namespace pdb { + +class NativeSession; + +class NativeEnumSymbols : public IPDBEnumChildren<PDBSymbol> { +public: + NativeEnumSymbols(NativeSession &Session, std::vector<SymIndexId> Symbols); + + uint32_t getChildCount() const override; + std::unique_ptr<PDBSymbol> getChildAtIndex(uint32_t Index) const override; + std::unique_ptr<PDBSymbol> getNext() override; + void reset() override; + +private: + std::vector<SymIndexId> Symbols; + uint32_t Index; + NativeSession &Session; +}; + +} // namespace pdb +} // namespace llvm + +#endif + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif diff --git a/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/NativeFunctionSymbol.h b/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/NativeFunctionSymbol.h index aa2fa7cea3..cb9599004e 100644 --- a/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/NativeFunctionSymbol.h +++ b/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/NativeFunctionSymbol.h @@ -27,7 +27,7 @@ namespace pdb { class NativeFunctionSymbol : public NativeRawSymbol { public: NativeFunctionSymbol(NativeSession &Session, SymIndexId Id, - const codeview::ProcSym &Sym, uint32_t RecordOffset); + const codeview::ProcSym &Sym, uint32_t RecordOffset); ~NativeFunctionSymbol() override; @@ -40,12 +40,12 @@ public: uint64_t getLength() const override; uint32_t getRelativeVirtualAddress() const override; uint64_t getVirtualAddress() const override; - std::unique_ptr<IPDBEnumSymbols> - findInlineFramesByVA(uint64_t VA) const override; + std::unique_ptr<IPDBEnumSymbols> + findInlineFramesByVA(uint64_t VA) const override; protected: const codeview::ProcSym Sym; - uint32_t RecordOffset = 0; + uint32_t RecordOffset = 0; }; } // namespace pdb diff --git a/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/NativeInlineSiteSymbol.h b/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/NativeInlineSiteSymbol.h index 8c70920066..1cc64ca303 100644 --- a/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/NativeInlineSiteSymbol.h +++ b/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/NativeInlineSiteSymbol.h @@ -1,57 +1,57 @@ -#pragma once - -#ifdef __GNUC__ -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-parameter" -#endif - -//===- NativeInlineSiteSymbol.h - info about inline sites -------*- 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_PDB_NATIVE_NATIVEINLINESITESYMBOL_H -#define LLVM_DEBUGINFO_PDB_NATIVE_NATIVEINLINESITESYMBOL_H - -#include "llvm/DebugInfo/CodeView/CodeView.h" -#include "llvm/DebugInfo/CodeView/SymbolRecord.h" -#include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h" -#include "llvm/DebugInfo/PDB/Native/NativeSession.h" - -namespace llvm { -namespace pdb { - -class NativeInlineSiteSymbol : public NativeRawSymbol { -public: - NativeInlineSiteSymbol(NativeSession &Session, SymIndexId Id, - const codeview::InlineSiteSym &Sym, - uint64_t ParentAddr); - - ~NativeInlineSiteSymbol() override; - - void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields, - PdbSymbolIdField RecurseIdFields) const override; - - std::string getName() const override; - std::unique_ptr<IPDBEnumLineNumbers> - findInlineeLinesByVA(uint64_t VA, uint32_t Length) const override; - -private: - const codeview::InlineSiteSym Sym; - uint64_t ParentAddr; - - void getLineOffset(uint32_t OffsetInFunc, uint32_t &LineOffset, - uint32_t &FileOffset) const; -}; - -} // namespace pdb -} // namespace llvm - -#endif // LLVM_DEBUGINFO_PDB_NATIVE_NATIVEINLINESITESYMBOL_H - -#ifdef __GNUC__ -#pragma GCC diagnostic pop -#endif +#pragma once + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif + +//===- NativeInlineSiteSymbol.h - info about inline sites -------*- 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_PDB_NATIVE_NATIVEINLINESITESYMBOL_H +#define LLVM_DEBUGINFO_PDB_NATIVE_NATIVEINLINESITESYMBOL_H + +#include "llvm/DebugInfo/CodeView/CodeView.h" +#include "llvm/DebugInfo/CodeView/SymbolRecord.h" +#include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h" +#include "llvm/DebugInfo/PDB/Native/NativeSession.h" + +namespace llvm { +namespace pdb { + +class NativeInlineSiteSymbol : public NativeRawSymbol { +public: + NativeInlineSiteSymbol(NativeSession &Session, SymIndexId Id, + const codeview::InlineSiteSym &Sym, + uint64_t ParentAddr); + + ~NativeInlineSiteSymbol() override; + + void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields, + PdbSymbolIdField RecurseIdFields) const override; + + std::string getName() const override; + std::unique_ptr<IPDBEnumLineNumbers> + findInlineeLinesByVA(uint64_t VA, uint32_t Length) const override; + +private: + const codeview::InlineSiteSym Sym; + uint64_t ParentAddr; + + void getLineOffset(uint32_t OffsetInFunc, uint32_t &LineOffset, + uint32_t &FileOffset) const; +}; + +} // namespace pdb +} // namespace llvm + +#endif // LLVM_DEBUGINFO_PDB_NATIVE_NATIVEINLINESITESYMBOL_H + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif diff --git a/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/NativeLineNumber.h b/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/NativeLineNumber.h index b6c58baee9..f9bd5157ed 100644 --- a/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/NativeLineNumber.h +++ b/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/NativeLineNumber.h @@ -29,7 +29,7 @@ public: const codeview::LineInfo Line, uint32_t ColumnNumber, uint32_t Length, uint32_t Section, uint32_t Offset, - uint32_t SrcFileId, uint32_t CompilandId); + uint32_t SrcFileId, uint32_t CompilandId); uint32_t getLineNumber() const override; uint32_t getLineNumberEnd() const override; @@ -52,7 +52,7 @@ private: uint32_t Offset; uint32_t Length; uint32_t SrcFileId; - uint32_t CompilandId; + uint32_t CompilandId; }; } // namespace pdb } // namespace llvm diff --git a/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/NativeSession.h b/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/NativeSession.h index 5033c58150..37222ba4bf 100644 --- a/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/NativeSession.h +++ b/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/NativeSession.h @@ -117,14 +117,14 @@ public: const SymbolCache &getSymbolCache() const { return Cache; } uint32_t getRVAFromSectOffset(uint32_t Section, uint32_t Offset) const; uint64_t getVAFromSectOffset(uint32_t Section, uint32_t Offset) const; - bool moduleIndexForVA(uint64_t VA, uint16_t &ModuleIndex) const; - bool moduleIndexForSectOffset(uint32_t Sect, uint32_t Offset, - uint16_t &ModuleIndex) const; - Expected<ModuleDebugStreamRef> getModuleDebugStream(uint32_t Index) const; + bool moduleIndexForVA(uint64_t VA, uint16_t &ModuleIndex) const; + bool moduleIndexForSectOffset(uint32_t Sect, uint32_t Offset, + uint16_t &ModuleIndex) const; + Expected<ModuleDebugStreamRef> getModuleDebugStream(uint32_t Index) const; private: void initializeExeSymbol(); - void parseSectionContribs(); + void parseSectionContribs(); std::unique_ptr<PDBFile> Pdb; std::unique_ptr<BumpPtrAllocator> Allocator; @@ -132,12 +132,12 @@ private: SymbolCache Cache; SymIndexId ExeSymbol = 0; uint64_t LoadAddress = 0; - - /// Map from virtual address to module index. - using IMap = - IntervalMap<uint64_t, uint16_t, 8, IntervalMapHalfOpenInfo<uint64_t>>; - IMap::Allocator IMapAllocator; - IMap AddrToModuleIndex; + + /// Map from virtual address to module index. + using IMap = + IntervalMap<uint64_t, uint16_t, 8, IntervalMapHalfOpenInfo<uint64_t>>; + IMap::Allocator IMapAllocator; + IMap AddrToModuleIndex; }; } // namespace pdb } // namespace llvm diff --git a/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/SymbolCache.h b/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/SymbolCache.h index b9ae7930d9..730142f3c7 100644 --- a/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/SymbolCache.h +++ b/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/SymbolCache.h @@ -44,40 +44,40 @@ class SymbolCache { /// an Id. Id allocation is an implementation, with the only guarantee /// being that once an Id is allocated, the symbol can be assumed to be /// cached. - mutable std::vector<std::unique_ptr<NativeRawSymbol>> Cache; + mutable std::vector<std::unique_ptr<NativeRawSymbol>> Cache; /// For type records from the TPI stream which have been paresd and cached, /// stores a mapping to SymIndexId of the cached symbol. - mutable DenseMap<codeview::TypeIndex, SymIndexId> TypeIndexToSymbolId; + mutable DenseMap<codeview::TypeIndex, SymIndexId> TypeIndexToSymbolId; /// For field list members which have been parsed and cached, stores a mapping /// from (IndexOfClass, MemberIndex) to the corresponding SymIndexId of the /// cached symbol. - mutable DenseMap<std::pair<codeview::TypeIndex, uint32_t>, SymIndexId> + mutable DenseMap<std::pair<codeview::TypeIndex, uint32_t>, SymIndexId> FieldListMembersToSymbolId; /// List of SymIndexIds for each compiland, indexed by compiland index as they /// appear in the PDB file. - mutable std::vector<SymIndexId> Compilands; + mutable std::vector<SymIndexId> Compilands; /// List of source files, indexed by unique source file index. mutable std::vector<std::unique_ptr<NativeSourceFile>> SourceFiles; - - /// Map from string table offset to source file Id. + + /// Map from string table offset to source file Id. mutable DenseMap<uint32_t, SymIndexId> FileNameOffsetToId; /// Map from global symbol offset to SymIndexId. - mutable DenseMap<uint32_t, SymIndexId> GlobalOffsetToSymbolId; + mutable DenseMap<uint32_t, SymIndexId> GlobalOffsetToSymbolId; - /// Map from segment and code offset to function symbols. - mutable DenseMap<std::pair<uint32_t, uint32_t>, SymIndexId> AddressToSymbolId; - /// Map from segment and code offset to public symbols. - mutable DenseMap<std::pair<uint32_t, uint32_t>, SymIndexId> - AddressToPublicSymId; + /// Map from segment and code offset to function symbols. + mutable DenseMap<std::pair<uint32_t, uint32_t>, SymIndexId> AddressToSymbolId; + /// Map from segment and code offset to public symbols. + mutable DenseMap<std::pair<uint32_t, uint32_t>, SymIndexId> + AddressToPublicSymId; - /// Map from module index and symbol table offset to SymIndexId. - mutable DenseMap<std::pair<uint16_t, uint32_t>, SymIndexId> - SymTabOffsetToSymbolId; + /// Map from module index and symbol table offset to SymIndexId. + mutable DenseMap<std::pair<uint16_t, uint32_t>, SymIndexId> + SymTabOffsetToSymbolId; struct LineTableEntry { uint64_t Addr; @@ -90,7 +90,7 @@ class SymbolCache { std::vector<LineTableEntry> findLineTable(uint16_t Modi) const; mutable DenseMap<uint16_t, std::vector<LineTableEntry>> LineTable; - SymIndexId createSymbolPlaceholder() const { + SymIndexId createSymbolPlaceholder() const { SymIndexId Id = Cache.size(); Cache.push_back(nullptr); return Id; @@ -98,7 +98,7 @@ class SymbolCache { template <typename ConcreteSymbolT, typename CVRecordT, typename... Args> SymIndexId createSymbolForType(codeview::TypeIndex TI, codeview::CVType CVT, - Args &&...ConstructorArgs) const { + Args &&...ConstructorArgs) const { CVRecordT Record; if (auto EC = codeview::TypeDeserializer::deserializeAs<CVRecordT>(CVT, Record)) { @@ -111,10 +111,10 @@ class SymbolCache { } SymIndexId createSymbolForModifiedType(codeview::TypeIndex ModifierTI, - codeview::CVType CVT) const; + codeview::CVType CVT) const; SymIndexId createSimpleType(codeview::TypeIndex TI, - codeview::ModifierOptions Mods) const; + codeview::ModifierOptions Mods) const; std::unique_ptr<PDBSymbol> findFunctionSymbolBySectOffset(uint32_t Sect, uint32_t Offset); @@ -125,7 +125,7 @@ public: SymbolCache(NativeSession &Session, DbiStream *Dbi); template <typename ConcreteSymbolT, typename... Args> - SymIndexId createSymbol(Args &&...ConstructorArgs) const { + SymIndexId createSymbol(Args &&...ConstructorArgs) const { SymIndexId Id = Cache.size(); // Initial construction must not access the cache, since it must be done @@ -152,7 +152,7 @@ public: std::unique_ptr<IPDBEnumSymbols> createGlobalsEnumerator(codeview::SymbolKind Kind); - SymIndexId findSymbolByTypeIndex(codeview::TypeIndex TI) const; + SymIndexId findSymbolByTypeIndex(codeview::TypeIndex TI) const; template <typename ConcreteSymbolT, typename... Args> SymIndexId getOrCreateFieldListMember(codeview::TypeIndex FieldListTI, @@ -170,9 +170,9 @@ public: } SymIndexId getOrCreateGlobalSymbolByOffset(uint32_t Offset); - SymIndexId getOrCreateInlineSymbol(codeview::InlineSiteSym Sym, - uint64_t ParentAddr, uint16_t Modi, - uint32_t RecordOffset) const; + SymIndexId getOrCreateInlineSymbol(codeview::InlineSiteSym Sym, + uint64_t ParentAddr, uint16_t Modi, + uint32_t RecordOffset) const; std::unique_ptr<PDBSymbol> findSymbolBySectOffset(uint32_t Sect, uint32_t Offset, PDB_SymType Type); diff --git a/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/TpiStream.h b/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/TpiStream.h index 8fa7b01ef0..4b2d9854a8 100644 --- a/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/TpiStream.h +++ b/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/TpiStream.h @@ -16,7 +16,7 @@ #ifndef LLVM_DEBUGINFO_PDB_RAW_PDBTPISTREAM_H #define LLVM_DEBUGINFO_PDB_RAW_PDBTPISTREAM_H -#include "llvm/DebugInfo/CodeView/CVRecord.h" +#include "llvm/DebugInfo/CodeView/CVRecord.h" #include "llvm/DebugInfo/PDB/Native/HashTable.h" #include "llvm/DebugInfo/PDB/Native/RawConstants.h" #include "llvm/DebugInfo/PDB/Native/RawTypes.h" diff --git a/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h b/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h index deb0032172..8cfb4ff501 100644 --- a/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h +++ b/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/Native/TpiStreamBuilder.h @@ -61,20 +61,20 @@ public: void setVersionHeader(PdbRaw_TpiVer Version); void addTypeRecord(ArrayRef<uint8_t> Type, Optional<uint32_t> Hash); - void addTypeRecords(ArrayRef<uint8_t> Types, ArrayRef<uint16_t> Sizes, - ArrayRef<uint32_t> Hashes); + void addTypeRecords(ArrayRef<uint8_t> Types, ArrayRef<uint16_t> Sizes, + ArrayRef<uint32_t> Hashes); Error finalizeMsfLayout(); - uint32_t getRecordCount() const { return TypeRecordCount; } + uint32_t getRecordCount() const { return TypeRecordCount; } Error commit(const msf::MSFLayout &Layout, WritableBinaryStreamRef Buffer); uint32_t calculateSerializedLength(); private: - void updateTypeIndexOffsets(ArrayRef<uint16_t> Sizes); - + void updateTypeIndexOffsets(ArrayRef<uint16_t> Sizes); + uint32_t calculateHashBufferSize() const; uint32_t calculateIndexOffsetSize() const; Error finalize(); @@ -82,11 +82,11 @@ private: msf::MSFBuilder &Msf; BumpPtrAllocator &Allocator; - uint32_t TypeRecordCount = 0; + uint32_t TypeRecordCount = 0; size_t TypeRecordBytes = 0; PdbRaw_TpiVer VerHeader = PdbRaw_TpiVer::PdbTpiV80; - std::vector<ArrayRef<uint8_t>> TypeRecBuffers; + std::vector<ArrayRef<uint8_t>> TypeRecBuffers; std::vector<uint32_t> TypeHashes; std::vector<codeview::TypeIndexOffset> TypeIndexOffsets; uint32_t HashStreamIndex = kInvalidStreamIndex; diff --git a/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/PDBExtras.h b/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/PDBExtras.h index 52b91b1fd2..7b5e4b5de2 100644 --- a/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/PDBExtras.h +++ b/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/PDBExtras.h @@ -16,11 +16,11 @@ #ifndef LLVM_DEBUGINFO_PDB_PDBEXTRAS_H #define LLVM_DEBUGINFO_PDB_PDBEXTRAS_H -#include "llvm/ADT/StringRef.h" +#include "llvm/ADT/StringRef.h" #include "llvm/DebugInfo/CodeView/CodeView.h" #include "llvm/DebugInfo/PDB/PDBTypes.h" #include "llvm/Support/raw_ostream.h" -#include <cstdint> +#include <cstdint> #include <unordered_map> namespace llvm { diff --git a/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/PDBSymbol.h b/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/PDBSymbol.h index ced7157701..1154cc660b 100644 --- a/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/PDBSymbol.h +++ b/contrib/libs/llvm12/include/llvm/DebugInfo/PDB/PDBSymbol.h @@ -147,15 +147,15 @@ public: StringRef Name, PDB_NameSearchFlags Flags, uint32_t RVA) const; - std::unique_ptr<IPDBEnumSymbols> findInlineFramesByVA(uint64_t VA) const; + std::unique_ptr<IPDBEnumSymbols> findInlineFramesByVA(uint64_t VA) const; std::unique_ptr<IPDBEnumSymbols> findInlineFramesByRVA(uint32_t RVA) const; - std::unique_ptr<IPDBEnumLineNumbers> - findInlineeLinesByVA(uint64_t VA, uint32_t Length) const; - std::unique_ptr<IPDBEnumLineNumbers> - findInlineeLinesByRVA(uint32_t RVA, uint32_t Length) const; + std::unique_ptr<IPDBEnumLineNumbers> + findInlineeLinesByVA(uint64_t VA, uint32_t Length) const; + std::unique_ptr<IPDBEnumLineNumbers> + findInlineeLinesByRVA(uint32_t RVA, uint32_t Length) const; + + std::string getName() const; - std::string getName() const; - const IPDBRawSymbol &getRawSymbol() const { return *RawSymbol; } IPDBRawSymbol &getRawSymbol() { return *RawSymbol; } |