1 //===-- DebugMacros.cpp -----------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "lldb/Symbol/DebugMacros.h"
12 #include "lldb/Symbol/CompileUnit.h"
14 using namespace lldb_private;
16 DebugMacroEntry::DebugMacroEntry(EntryType type,
18 uint32_t debug_line_file_idx,
22 m_debug_line_file_idx(debug_line_file_idx),
26 DebugMacroEntry::DebugMacroEntry(EntryType type,
27 const DebugMacrosSP &debug_macros_sp)
28 : m_type(type), m_line(0), m_debug_line_file_idx(0), m_debug_macros_sp(debug_macros_sp)
32 DebugMacroEntry::GetFileSpec(CompileUnit *comp_unit) const
34 return comp_unit->GetSupportFiles().GetFileSpecAtIndex(m_debug_line_file_idx);
38 DebugMacroEntry::CreateDefineEntry(uint32_t line, const char *str)
40 return DebugMacroEntry(DebugMacroEntry::DEFINE, line, 0, str);
44 DebugMacroEntry::CreateUndefEntry(uint32_t line, const char *str)
46 return DebugMacroEntry(DebugMacroEntry::UNDEF, line, 0, str);
50 DebugMacroEntry::CreateStartFileEntry(uint32_t line, uint32_t debug_line_file_idx)
52 return DebugMacroEntry(DebugMacroEntry::START_FILE, line, debug_line_file_idx, nullptr);
56 DebugMacroEntry::CreateEndFileEntry()
58 return DebugMacroEntry(DebugMacroEntry::END_FILE, 0, 0, nullptr);
62 DebugMacroEntry::CreateIndirectEntry(const DebugMacrosSP &debug_macros_sp)
64 return DebugMacroEntry(DebugMacroEntry::INDIRECT, debug_macros_sp);