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
NativeLineNumber(const NativeSession & Session,const codeview::LineInfo Line,uint32_t ColumnNumber,uint32_t Section,uint32_t Offset,uint32_t Length,uint32_t SrcFileId,uint32_t CompilandId)14 NativeLineNumber::NativeLineNumber(const NativeSession &Session,
15 const codeview::LineInfo Line,
16 uint32_t ColumnNumber, uint32_t Section,
17 uint32_t Offset, uint32_t Length,
18 uint32_t SrcFileId, uint32_t CompilandId)
19 : Session(Session), Line(Line), ColumnNumber(ColumnNumber),
20 Section(Section), Offset(Offset), Length(Length), SrcFileId(SrcFileId),
21 CompilandId(CompilandId) {}
22
getLineNumber() const23 uint32_t NativeLineNumber::getLineNumber() const { return Line.getStartLine(); }
24
getLineNumberEnd() const25 uint32_t NativeLineNumber::getLineNumberEnd() const {
26 return Line.getEndLine();
27 }
28
getColumnNumber() const29 uint32_t NativeLineNumber::getColumnNumber() const { return ColumnNumber; }
30
getColumnNumberEnd() const31 uint32_t NativeLineNumber::getColumnNumberEnd() const { return 0; }
32
getAddressSection() const33 uint32_t NativeLineNumber::getAddressSection() const { return Section; }
34
getAddressOffset() const35 uint32_t NativeLineNumber::getAddressOffset() const { return Offset; }
36
getRelativeVirtualAddress() const37 uint32_t NativeLineNumber::getRelativeVirtualAddress() const {
38 return Session.getRVAFromSectOffset(Section, Offset);
39 }
40
getVirtualAddress() const41 uint64_t NativeLineNumber::getVirtualAddress() const {
42 return Session.getVAFromSectOffset(Section, Offset);
43 }
44
getLength() const45 uint32_t NativeLineNumber::getLength() const { return Length; }
46
getSourceFileId() const47 uint32_t NativeLineNumber::getSourceFileId() const { return SrcFileId; }
48
getCompilandId() const49 uint32_t NativeLineNumber::getCompilandId() const { return CompilandId; }
50
isStatement() const51 bool NativeLineNumber::isStatement() const { return Line.isStatement(); }
52