Path: blob/main/contrib/llvm-project/lldb/source/Symbol/DebugMacros.cpp
39587 views
//===-- DebugMacros.cpp ---------------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#include "lldb/Symbol/DebugMacros.h"910#include "lldb/Symbol/CompileUnit.h"1112using namespace lldb_private;1314DebugMacroEntry::DebugMacroEntry(EntryType type, uint32_t line,15uint32_t debug_line_file_idx, const char *str)16: m_type(type), m_line(line), m_debug_line_file_idx(debug_line_file_idx),17m_str(str) {}1819DebugMacroEntry::DebugMacroEntry(EntryType type,20const DebugMacrosSP &debug_macros_sp)21: m_type(type), m_line(0), m_debug_line_file_idx(0),22m_debug_macros_sp(debug_macros_sp) {}2324const FileSpec &DebugMacroEntry::GetFileSpec(CompileUnit *comp_unit) const {25return comp_unit->GetSupportFiles().GetFileSpecAtIndex(m_debug_line_file_idx);26}2728DebugMacroEntry DebugMacroEntry::CreateDefineEntry(uint32_t line,29const char *str) {30return DebugMacroEntry(DebugMacroEntry::DEFINE, line, 0, str);31}3233DebugMacroEntry DebugMacroEntry::CreateUndefEntry(uint32_t line,34const char *str) {35return DebugMacroEntry(DebugMacroEntry::UNDEF, line, 0, str);36}3738DebugMacroEntry39DebugMacroEntry::CreateStartFileEntry(uint32_t line,40uint32_t debug_line_file_idx) {41return DebugMacroEntry(DebugMacroEntry::START_FILE, line, debug_line_file_idx,42nullptr);43}4445DebugMacroEntry DebugMacroEntry::CreateEndFileEntry() {46return DebugMacroEntry(DebugMacroEntry::END_FILE, 0, 0, nullptr);47}4849DebugMacroEntry50DebugMacroEntry::CreateIndirectEntry(const DebugMacrosSP &debug_macros_sp) {51return DebugMacroEntry(DebugMacroEntry::INDIRECT, debug_macros_sp);52}535455