2017-04-16 12:01:22 -04:00
|
|
|
//==- NativeEnumModules.cpp - Native Symbol Enumerator impl ------*- C++ -*-==//
|
|
|
|
|
//
|
2019-08-20 16:50:12 -04:00
|
|
|
// 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
|
2017-04-16 12:01:22 -04:00
|
|
|
//
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
|
|
#include "llvm/DebugInfo/PDB/Native/NativeEnumModules.h"
|
|
|
|
|
|
|
|
|
|
#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
|
|
|
|
|
#include "llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h"
|
2019-01-19 05:01:25 -05:00
|
|
|
#include "llvm/DebugInfo/PDB/Native/NativeExeSymbol.h"
|
2017-04-16 12:01:22 -04:00
|
|
|
#include "llvm/DebugInfo/PDB/Native/NativeSession.h"
|
|
|
|
|
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
|
|
|
|
|
#include "llvm/DebugInfo/PDB/PDBSymbolCompiland.h"
|
2019-01-19 05:01:25 -05:00
|
|
|
#include "llvm/DebugInfo/PDB/PDBSymbolExe.h"
|
2017-04-16 12:01:22 -04:00
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
namespace pdb {
|
|
|
|
|
|
2019-01-19 05:01:25 -05:00
|
|
|
NativeEnumModules::NativeEnumModules(NativeSession &PDBSession, uint32_t Index)
|
|
|
|
|
: Session(PDBSession), Index(Index) {}
|
2017-04-16 12:01:22 -04:00
|
|
|
|
|
|
|
|
uint32_t NativeEnumModules::getChildCount() const {
|
2019-01-19 05:01:25 -05:00
|
|
|
return Session.getSymbolCache().getNumCompilands();
|
2017-04-16 12:01:22 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::unique_ptr<PDBSymbol>
|
2019-01-19 05:01:25 -05:00
|
|
|
NativeEnumModules::getChildAtIndex(uint32_t N) const {
|
|
|
|
|
return Session.getSymbolCache().getOrCreateCompiland(N);
|
2017-04-16 12:01:22 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::unique_ptr<PDBSymbol> NativeEnumModules::getNext() {
|
2019-01-19 05:01:25 -05:00
|
|
|
if (Index >= getChildCount())
|
2017-04-16 12:01:22 -04:00
|
|
|
return nullptr;
|
|
|
|
|
return getChildAtIndex(Index++);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void NativeEnumModules::reset() { Index = 0; }
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|