• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 using namespace llvm::pdb;
14 
DIALineNumber(CComPtr<IDiaLineNumber> DiaLineNumber)15 DIALineNumber::DIALineNumber(CComPtr<IDiaLineNumber> DiaLineNumber)
16     : LineNumber(DiaLineNumber) {}
17 
getLineNumber() const18 uint32_t DIALineNumber::getLineNumber() const {
19   DWORD Line = 0;
20   return (S_OK == LineNumber->get_lineNumber(&Line)) ? Line : 0;
21 }
22 
getLineNumberEnd() const23 uint32_t DIALineNumber::getLineNumberEnd() const {
24   DWORD LineEnd = 0;
25   return (S_OK == LineNumber->get_lineNumberEnd(&LineEnd)) ? LineEnd : 0;
26 }
27 
getColumnNumber() const28 uint32_t DIALineNumber::getColumnNumber() const {
29   DWORD Column = 0;
30   return (S_OK == LineNumber->get_columnNumber(&Column)) ? Column : 0;
31 }
32 
getColumnNumberEnd() const33 uint32_t DIALineNumber::getColumnNumberEnd() const {
34   DWORD ColumnEnd = 0;
35   return (S_OK == LineNumber->get_columnNumberEnd(&ColumnEnd)) ? ColumnEnd : 0;
36 }
37 
getAddressSection() const38 uint32_t DIALineNumber::getAddressSection() const {
39   DWORD Section = 0;
40   return (S_OK == LineNumber->get_addressSection(&Section)) ? Section : 0;
41 }
42 
getAddressOffset() const43 uint32_t DIALineNumber::getAddressOffset() const {
44   DWORD Offset = 0;
45   return (S_OK == LineNumber->get_addressOffset(&Offset)) ? Offset : 0;
46 }
47 
getRelativeVirtualAddress() const48 uint32_t DIALineNumber::getRelativeVirtualAddress() const {
49   DWORD RVA = 0;
50   return (S_OK == LineNumber->get_relativeVirtualAddress(&RVA)) ? RVA : 0;
51 }
52 
getVirtualAddress() const53 uint64_t DIALineNumber::getVirtualAddress() const {
54   ULONGLONG Addr = 0;
55   return (S_OK == LineNumber->get_virtualAddress(&Addr)) ? Addr : 0;
56 }
57 
getLength() const58 uint32_t DIALineNumber::getLength() const {
59   DWORD Length = 0;
60   return (S_OK == LineNumber->get_length(&Length)) ? Length : 0;
61 }
62 
getSourceFileId() const63 uint32_t DIALineNumber::getSourceFileId() const {
64   DWORD Id = 0;
65   return (S_OK == LineNumber->get_sourceFileId(&Id)) ? Id : 0;
66 }
67 
getCompilandId() const68 uint32_t DIALineNumber::getCompilandId() const {
69   DWORD Id = 0;
70   return (S_OK == LineNumber->get_compilandId(&Id)) ? Id : 0;
71 }
72 
isStatement() const73 bool DIALineNumber::isStatement() const {
74   BOOL Statement = 0;
75   return (S_OK == LineNumber->get_statement(&Statement)) ? Statement : false;
76 }
77