File indexing completed on 2026-05-10 08:44:19
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef LLVM_OBJECT_MODULESYMBOLTABLE_H
0016 #define LLVM_OBJECT_MODULESYMBOLTABLE_H
0017
0018 #include "llvm/ADT/ArrayRef.h"
0019 #include "llvm/ADT/PointerUnion.h"
0020 #include "llvm/IR/Mangler.h"
0021 #include "llvm/Object/SymbolicFile.h"
0022 #include "llvm/Support/Allocator.h"
0023 #include <cstdint>
0024 #include <string>
0025 #include <utility>
0026 #include <vector>
0027
0028 namespace llvm {
0029
0030 class GlobalValue;
0031 class Module;
0032
0033 class ModuleSymbolTable {
0034 public:
0035 using AsmSymbol = std::pair<std::string, uint32_t>;
0036 using Symbol = PointerUnion<GlobalValue *, AsmSymbol *>;
0037
0038 private:
0039 Module *FirstMod = nullptr;
0040
0041 SpecificBumpPtrAllocator<AsmSymbol> AsmSymbols;
0042 std::vector<Symbol> SymTab;
0043 Mangler Mang;
0044
0045 public:
0046 ArrayRef<Symbol> symbols() const { return SymTab; }
0047 void addModule(Module *M);
0048
0049 void printSymbolName(raw_ostream &OS, Symbol S) const;
0050 uint32_t getSymbolFlags(Symbol S) const;
0051
0052
0053
0054
0055
0056
0057 static void CollectAsmSymbols(
0058 const Module &M,
0059 function_ref<void(StringRef, object::BasicSymbolRef::Flags)> AsmSymbol);
0060
0061
0062
0063
0064
0065
0066 static void
0067 CollectAsmSymvers(const Module &M,
0068 function_ref<void(StringRef, StringRef)> AsmSymver);
0069 };
0070
0071 }
0072
0073 #endif