Coverage Report

Created: 2022-01-22 13:19

/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/tools/lldb-vscode/SourceReference.h
Line
Count
Source (jump to first uncovered line)
1
//===-- SourceReference.h ---------------------------------------*- 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
#ifndef LLDB_TOOLS_LLDB_VSCODE_SOURCEREFERENCE_H
10
#define LLDB_TOOLS_LLDB_VSCODE_SOURCEREFERENCE_H
11
12
#include "lldb/lldb-types.h"
13
#include "llvm/ADT/DenseMap.h"
14
#include <string>
15
16
namespace lldb_vscode {
17
18
struct SourceReference {
19
  std::string content;
20
  llvm::DenseMap<lldb::addr_t, int64_t> addr_to_line;
21
22
0
  int64_t GetLineForPC(lldb::addr_t pc) const {
23
0
    auto addr_line = addr_to_line.find(pc);
24
0
    if (addr_line != addr_to_line.end())
25
0
      return addr_line->second;
26
0
    return 0;
27
0
  }
28
};
29
30
} // namespace lldb_vscode
31
32
#endif