1 //===- DIALineNumber.cpp - DIA implementation of IPDBLineNumber -*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #include "llvm/DebugInfo/PDB/DIA/DIALineNumber.h"
12 using namespace llvm::pdb
;
14 DIALineNumber::DIALineNumber(CComPtr
<IDiaLineNumber
> DiaLineNumber
)
15 : LineNumber(DiaLineNumber
) {}
17 uint32_t DIALineNumber::getLineNumber() const {
19 return (S_OK
== LineNumber
->get_lineNumber(&Line
)) ? Line
: 0;
22 uint32_t DIALineNumber::getLineNumberEnd() const {
24 return (S_OK
== LineNumber
->get_lineNumberEnd(&LineEnd
)) ? LineEnd
: 0;
27 uint32_t DIALineNumber::getColumnNumber() const {
29 return (S_OK
== LineNumber
->get_columnNumber(&Column
)) ? Column
: 0;
32 uint32_t DIALineNumber::getColumnNumberEnd() const {
34 return (S_OK
== LineNumber
->get_columnNumberEnd(&ColumnEnd
)) ? ColumnEnd
: 0;
37 uint32_t DIALineNumber::getAddressSection() const {
39 return (S_OK
== LineNumber
->get_addressSection(&Section
)) ? Section
: 0;
42 uint32_t DIALineNumber::getAddressOffset() const {
44 return (S_OK
== LineNumber
->get_addressOffset(&Offset
)) ? Offset
: 0;
47 uint32_t DIALineNumber::getRelativeVirtualAddress() const {
49 return (S_OK
== LineNumber
->get_relativeVirtualAddress(&RVA
)) ? RVA
: 0;
52 uint64_t DIALineNumber::getVirtualAddress() const {
54 return (S_OK
== LineNumber
->get_virtualAddress(&Addr
)) ? Addr
: 0;
57 uint32_t DIALineNumber::getLength() const {
59 return (S_OK
== LineNumber
->get_length(&Length
)) ? Length
: 0;
62 uint32_t DIALineNumber::getSourceFileId() const {
64 return (S_OK
== LineNumber
->get_sourceFileId(&Id
)) ? Id
: 0;
67 uint32_t DIALineNumber::getCompilandId() const {
69 return (S_OK
== LineNumber
->get_compilandId(&Id
)) ? Id
: 0;
72 bool DIALineNumber::isStatement() const {
74 return (S_OK
== LineNumber
->get_statement(&Statement
)) ? Statement
: false;