test-release.sh: Only build clang for stage1 and stage2
[llvm-project.git] / lldb / tools / lldb-vscode / SourceReference.h
blobcf62fb6680e2fd66f703834b541cc286a036a058
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 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_TOOLS_LLDB_VSCODE_SOURCEREFERENCE_H
10 #define LLDB_TOOLS_LLDB_VSCODE_SOURCEREFERENCE_H
12 #include "lldb/lldb-types.h"
13 #include "llvm/ADT/DenseMap.h"
14 #include <string>
16 namespace lldb_vscode {
18 struct SourceReference {
19 std::string content;
20 llvm::DenseMap<lldb::addr_t, int64_t> addr_to_line;
22 int64_t GetLineForPC(lldb::addr_t pc) const {
23 auto addr_line = addr_to_line.find(pc);
24 if (addr_line != addr_to_line.end())
25 return addr_line->second;
26 return 0;
30 } // namespace lldb_vscode
32 #endif