1 //===- DIALineNumber.cpp - DIA implementation of IPDBLineNumber -*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #include "llvm/DebugInfo/PDB/DIA/DIALineNumber.h"
11 
12 using namespace llvm;
13 
DIALineNumber(CComPtr<IDiaLineNumber> DiaLineNumber)14 DIALineNumber::DIALineNumber(CComPtr<IDiaLineNumber> DiaLineNumber)
15     : LineNumber(DiaLineNumber) {}
16 
getLineNumber() const17 uint32_t DIALineNumber::getLineNumber() const {
18   DWORD Line = 0;
19   return (S_OK == LineNumber->get_lineNumber(&Line)) ? Line : 0;
20 }
21 
getLineNumberEnd() const22 uint32_t DIALineNumber::getLineNumberEnd() const {
23   DWORD LineEnd = 0;
24   return (S_OK == LineNumber->get_lineNumberEnd(&LineEnd)) ? LineEnd : 0;
25 }
26 
getColumnNumber() const27 uint32_t DIALineNumber::getColumnNumber() const {
28   DWORD Column = 0;
29   return (S_OK == LineNumber->get_columnNumber(&Column)) ? Column : 0;
30 }
31 
getColumnNumberEnd() const32 uint32_t DIALineNumber::getColumnNumberEnd() const {
33   DWORD ColumnEnd = 0;
34   return (S_OK == LineNumber->get_columnNumberEnd(&ColumnEnd)) ? ColumnEnd : 0;
35 }
36 
getAddressSection() const37 uint32_t DIALineNumber::getAddressSection() const {
38   DWORD Section = 0;
39   return (S_OK == LineNumber->get_addressSection(&Section)) ? Section : 0;
40 }
41 
getAddressOffset() const42 uint32_t DIALineNumber::getAddressOffset() const {
43   DWORD Offset = 0;
44   return (S_OK == LineNumber->get_addressOffset(&Offset)) ? Offset : 0;
45 }
46 
getRelativeVirtualAddress() const47 uint32_t DIALineNumber::getRelativeVirtualAddress() const {
48   DWORD RVA = 0;
49   return (S_OK == LineNumber->get_relativeVirtualAddress(&RVA)) ? RVA : 0;
50 }
51 
getVirtualAddress() const52 uint64_t DIALineNumber::getVirtualAddress() const {
53   ULONGLONG Addr = 0;
54   return (S_OK == LineNumber->get_virtualAddress(&Addr)) ? Addr : 0;
55 }
56 
getLength() const57 uint32_t DIALineNumber::getLength() const {
58   DWORD Length = 0;
59   return (S_OK == LineNumber->get_length(&Length)) ? Length : 0;
60 }
61 
getSourceFileId() const62 uint32_t DIALineNumber::getSourceFileId() const {
63   DWORD Id = 0;
64   return (S_OK == LineNumber->get_sourceFileId(&Id)) ? Id : 0;
65 }
66 
getCompilandId() const67 uint32_t DIALineNumber::getCompilandId() const {
68   DWORD Id = 0;
69   return (S_OK == LineNumber->get_compilandId(&Id)) ? Id : 0;
70 }
71 
isStatement() const72 bool DIALineNumber::isStatement() const {
73   BOOL Statement = 0;
74   return (S_OK == LineNumber->get_statement(&Statement)) ? Statement : false;
75 }
76