annotate lldb/source/Symbol/DebugMacros.cpp @ 266:00f31e85ec16 default tip

Added tag current for changeset 31d058e83c98
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 14 Oct 2023 10:13:55 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 //===-- DebugMacros.cpp ---------------------------------------------------===//
anatofuz
parents:
diff changeset
2 //
anatofuz
parents:
diff changeset
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
anatofuz
parents:
diff changeset
4 // See https://llvm.org/LICENSE.txt for license information.
anatofuz
parents:
diff changeset
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
anatofuz
parents:
diff changeset
6 //
anatofuz
parents:
diff changeset
7 //===----------------------------------------------------------------------===//
anatofuz
parents:
diff changeset
8
anatofuz
parents:
diff changeset
9 #include "lldb/Symbol/DebugMacros.h"
anatofuz
parents:
diff changeset
10
anatofuz
parents:
diff changeset
11 #include "lldb/Symbol/CompileUnit.h"
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 using namespace lldb_private;
anatofuz
parents:
diff changeset
14
anatofuz
parents:
diff changeset
15 DebugMacroEntry::DebugMacroEntry(EntryType type, uint32_t line,
anatofuz
parents:
diff changeset
16 uint32_t debug_line_file_idx, const char *str)
anatofuz
parents:
diff changeset
17 : m_type(type), m_line(line), m_debug_line_file_idx(debug_line_file_idx),
anatofuz
parents:
diff changeset
18 m_str(str) {}
anatofuz
parents:
diff changeset
19
anatofuz
parents:
diff changeset
20 DebugMacroEntry::DebugMacroEntry(EntryType type,
anatofuz
parents:
diff changeset
21 const DebugMacrosSP &debug_macros_sp)
anatofuz
parents:
diff changeset
22 : m_type(type), m_line(0), m_debug_line_file_idx(0),
anatofuz
parents:
diff changeset
23 m_debug_macros_sp(debug_macros_sp) {}
anatofuz
parents:
diff changeset
24
anatofuz
parents:
diff changeset
25 const FileSpec &DebugMacroEntry::GetFileSpec(CompileUnit *comp_unit) const {
anatofuz
parents:
diff changeset
26 return comp_unit->GetSupportFiles().GetFileSpecAtIndex(m_debug_line_file_idx);
anatofuz
parents:
diff changeset
27 }
anatofuz
parents:
diff changeset
28
anatofuz
parents:
diff changeset
29 DebugMacroEntry DebugMacroEntry::CreateDefineEntry(uint32_t line,
anatofuz
parents:
diff changeset
30 const char *str) {
anatofuz
parents:
diff changeset
31 return DebugMacroEntry(DebugMacroEntry::DEFINE, line, 0, str);
anatofuz
parents:
diff changeset
32 }
anatofuz
parents:
diff changeset
33
anatofuz
parents:
diff changeset
34 DebugMacroEntry DebugMacroEntry::CreateUndefEntry(uint32_t line,
anatofuz
parents:
diff changeset
35 const char *str) {
anatofuz
parents:
diff changeset
36 return DebugMacroEntry(DebugMacroEntry::UNDEF, line, 0, str);
anatofuz
parents:
diff changeset
37 }
anatofuz
parents:
diff changeset
38
anatofuz
parents:
diff changeset
39 DebugMacroEntry
anatofuz
parents:
diff changeset
40 DebugMacroEntry::CreateStartFileEntry(uint32_t line,
anatofuz
parents:
diff changeset
41 uint32_t debug_line_file_idx) {
anatofuz
parents:
diff changeset
42 return DebugMacroEntry(DebugMacroEntry::START_FILE, line, debug_line_file_idx,
anatofuz
parents:
diff changeset
43 nullptr);
anatofuz
parents:
diff changeset
44 }
anatofuz
parents:
diff changeset
45
anatofuz
parents:
diff changeset
46 DebugMacroEntry DebugMacroEntry::CreateEndFileEntry() {
anatofuz
parents:
diff changeset
47 return DebugMacroEntry(DebugMacroEntry::END_FILE, 0, 0, nullptr);
anatofuz
parents:
diff changeset
48 }
anatofuz
parents:
diff changeset
49
anatofuz
parents:
diff changeset
50 DebugMacroEntry
anatofuz
parents:
diff changeset
51 DebugMacroEntry::CreateIndirectEntry(const DebugMacrosSP &debug_macros_sp) {
anatofuz
parents:
diff changeset
52 return DebugMacroEntry(DebugMacroEntry::INDIRECT, debug_macros_sp);
anatofuz
parents:
diff changeset
53 }