1 //===- NativeLineNumber.cpp - Native line number implementation -*- 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 //===----------------------------------------------------------------------===//
8 
9 #include "llvm/DebugInfo/PDB/Native/NativeLineNumber.h"
10 
11 using namespace llvm;
12 using namespace llvm::pdb;
13 
14 NativeLineNumber::NativeLineNumber(const NativeSession &Session,
15                                    const codeview::LineInfo Line,
16                                    uint32_t Section, uint32_t Offset,
17                                    uint32_t Length, uint32_t SrcFileId)
18     : Session(Session), Line(Line), Section(Section), Offset(Offset),
19       Length(Length), SrcFileId(SrcFileId) {}
20 
21 uint32_t NativeLineNumber::getLineNumber() const { return Line.getStartLine(); }
22 
23 uint32_t NativeLineNumber::getLineNumberEnd() const {
24   return Line.getEndLine();
25 }
26 
27 uint32_t NativeLineNumber::getColumnNumber() const { return 0; }
28 
29 uint32_t NativeLineNumber::getColumnNumberEnd() const { return 0; }
30 
31 uint32_t NativeLineNumber::getAddressSection() const { return Section; }
32 
33 uint32_t NativeLineNumber::getAddressOffset() const { return Offset; }
34 
35 uint32_t NativeLineNumber::getRelativeVirtualAddress() const {
36   return Session.getRVAFromSectOffset(Section, Offset);
37 }
38 
39 uint64_t NativeLineNumber::getVirtualAddress() const {
40   return Session.getVAFromSectOffset(Section, Offset);
41 }
42 
43 uint32_t NativeLineNumber::getLength() const { return Length; }
44 
45 uint32_t NativeLineNumber::getSourceFileId() const { return SrcFileId; }
46 
47 uint32_t NativeLineNumber::getCompilandId() const { return 0; }
48 
49 bool NativeLineNumber::isStatement() const { return Line.isStatement(); }
50