diff options
Diffstat (limited to 'include/llvm/Object/IRSymtab.h')
-rw-r--r-- | include/llvm/Object/IRSymtab.h | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/include/llvm/Object/IRSymtab.h b/include/llvm/Object/IRSymtab.h index 5f6a024cd132..0bbfc932493c 100644 --- a/include/llvm/Object/IRSymtab.h +++ b/include/llvm/Object/IRSymtab.h @@ -1,9 +1,8 @@ //===- IRSymtab.h - data definitions for IR symbol tables -------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// 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 // //===----------------------------------------------------------------------===// // @@ -126,12 +125,13 @@ struct Uncommon { Str SectionName; }; + struct Header { /// Version number of the symtab format. This number should be incremented /// when the format changes, but it does not need to be incremented if a /// change to LLVM would cause it to create a different symbol table. Word Version; - enum { kCurrentVersion = 1 }; + enum { kCurrentVersion = 2 }; /// The producer's version string (LLVM_VERSION_STRING " " LLVM_REVISION). /// Consumers should rebuild the symbol table from IR if the producer's @@ -148,6 +148,9 @@ struct Header { /// COFF-specific: linker directives. Str COFFLinkerOpts; + + /// Dependent Library Specifiers + Range<Str> DependentLibraries; }; } // end namespace storage @@ -232,6 +235,7 @@ class Reader { ArrayRef<storage::Comdat> Comdats; ArrayRef<storage::Symbol> Symbols; ArrayRef<storage::Uncommon> Uncommons; + ArrayRef<storage::Str> DependentLibraries; StringRef str(storage::Str S) const { return S.get(Strtab); } @@ -252,6 +256,7 @@ public: Comdats = range(header().Comdats); Symbols = range(header().Symbols); Uncommons = range(header().Uncommons); + DependentLibraries = range(header().DependentLibraries); } using symbol_range = iterator_range<object::content_iterator<SymbolRef>>; @@ -284,6 +289,16 @@ public: /// COFF-specific: returns linker options specified in the input file. StringRef getCOFFLinkerOpts() const { return str(header().COFFLinkerOpts); } + + /// Returns dependent library specifiers + std::vector<StringRef> getDependentLibraries() const { + std::vector<StringRef> Specifiers; + Specifiers.reserve(DependentLibraries.size()); + for (auto S : DependentLibraries) { + Specifiers.push_back(str(S)); + } + return Specifiers; + } }; /// Ephemeral symbols produced by Reader::symbols() and |