Path: blob/main/contrib/llvm-project/llvm/lib/DebugInfo/PDB/DIA/DIATable.cpp
35294 views
//===- DIATable.cpp - DIA implementation of IPDBTable -----------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "llvm/DebugInfo/PDB/DIA/DIATable.h"9#include "llvm/DebugInfo/PDB/DIA/DIAUtils.h"1011using namespace llvm;12using namespace llvm::pdb;1314DIATable::DIATable(CComPtr<IDiaTable> DiaTable) : Table(DiaTable) {}1516uint32_t DIATable::getItemCount() const {17LONG Count = 0;18return (S_OK == Table->get_Count(&Count)) ? Count : 0;19}2021std::string DIATable::getName() const {22return invokeBstrMethod(*Table, &IDiaTable::get_name);23}2425PDB_TableType DIATable::getTableType() const {26CComBSTR Name16;27if (S_OK != Table->get_name(&Name16))28return PDB_TableType::TableInvalid;2930if (Name16 == DiaTable_Symbols)31return PDB_TableType::Symbols;32if (Name16 == DiaTable_SrcFiles)33return PDB_TableType::SourceFiles;34if (Name16 == DiaTable_Sections)35return PDB_TableType::SectionContribs;36if (Name16 == DiaTable_LineNums)37return PDB_TableType::LineNumbers;38if (Name16 == DiaTable_SegMap)39return PDB_TableType::Segments;40if (Name16 == DiaTable_InjSrc)41return PDB_TableType::InjectedSources;42if (Name16 == DiaTable_FrameData)43return PDB_TableType::FrameData;44if (Name16 == DiaTable_InputAssemblyFiles)45return PDB_TableType::InputAssemblyFiles;46if (Name16 == DiaTable_Dbg)47return PDB_TableType::Dbg;48return PDB_TableType::TableInvalid;49}505152