[Alignment][NFC] Convert StoreInst to MaybeAlign
[llvm-complete.git] / lib / DebugInfo / PDB / DIA / DIAEnumLineNumbers.cpp
blob6f1d7733fb2deddb73ac4ff5f893a00a715d8e82
1 //==- DIAEnumLineNumbers.cpp - DIA Line Number Enumerator impl ---*- C++ -*-==//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "llvm/DebugInfo/PDB/DIA/DIAEnumLineNumbers.h"
10 #include "llvm/DebugInfo/PDB/DIA/DIALineNumber.h"
11 #include "llvm/DebugInfo/PDB/PDBSymbol.h"
13 using namespace llvm;
14 using namespace llvm::pdb;
16 DIAEnumLineNumbers::DIAEnumLineNumbers(
17 CComPtr<IDiaEnumLineNumbers> DiaEnumerator)
18 : Enumerator(DiaEnumerator) {}
20 uint32_t DIAEnumLineNumbers::getChildCount() const {
21 LONG Count = 0;
22 return (S_OK == Enumerator->get_Count(&Count)) ? Count : 0;
25 std::unique_ptr<IPDBLineNumber>
26 DIAEnumLineNumbers::getChildAtIndex(uint32_t Index) const {
27 CComPtr<IDiaLineNumber> Item;
28 if (S_OK != Enumerator->Item(Index, &Item))
29 return nullptr;
31 return std::unique_ptr<IPDBLineNumber>(new DIALineNumber(Item));
34 std::unique_ptr<IPDBLineNumber> DIAEnumLineNumbers::getNext() {
35 CComPtr<IDiaLineNumber> Item;
36 ULONG NumFetched = 0;
37 if (S_OK != Enumerator->Next(1, &Item, &NumFetched))
38 return nullptr;
40 return std::unique_ptr<IPDBLineNumber>(new DIALineNumber(Item));
43 void DIAEnumLineNumbers::reset() { Enumerator->Reset(); }