diff options
Diffstat (limited to 'source/Core/SourceManager.cpp')
-rw-r--r-- | source/Core/SourceManager.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/source/Core/SourceManager.cpp b/source/Core/SourceManager.cpp index fe603c5a44e6..87065ab62425 100644 --- a/source/Core/SourceManager.cpp +++ b/source/Core/SourceManager.cpp @@ -1,9 +1,8 @@ //===-- SourceManager.cpp ---------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -50,9 +49,7 @@ using namespace lldb_private; static inline bool is_newline_char(char ch) { return ch == '\n' || ch == '\r'; } -//---------------------------------------------------------------------- // SourceManager constructor -//---------------------------------------------------------------------- SourceManager::SourceManager(const TargetSP &target_sp) : m_last_file_sp(), m_last_line(0), m_last_count(0), m_default_set(false), m_target_wp(target_sp), @@ -62,9 +59,7 @@ SourceManager::SourceManager(const DebuggerSP &debugger_sp) : m_last_file_sp(), m_last_line(0), m_last_count(0), m_default_set(false), m_target_wp(), m_debugger_wp(debugger_sp) {} -//---------------------------------------------------------------------- // Destructor -//---------------------------------------------------------------------- SourceManager::~SourceManager() {} SourceManager::FileSP SourceManager::GetFile(const FileSpec &file_spec) { @@ -331,7 +326,7 @@ bool SourceManager::GetDefaultFileAndLine(FileSpec &file_spec, uint32_t &line) { bool inlines_okay = true; bool append = false; size_t num_matches = executable_ptr->FindFunctions( - main_name, NULL, lldb::eFunctionNameTypeBase, inlines_okay, + main_name, nullptr, lldb::eFunctionNameTypeBase, inlines_okay, symbols_okay, append, sc_list); for (size_t idx = 0; idx < num_matches; idx++) { SymbolContext sc; @@ -404,7 +399,7 @@ void SourceManager::File::CommonInitializer(const FileSpec &file_spec, if (num_matches != 0) { if (num_matches > 1) { SymbolContext sc; - FileSpec *test_cu_spec = NULL; + FileSpec *test_cu_spec = nullptr; for (unsigned i = 0; i < num_matches; i++) { sc_list.GetContextAtIndex(i, sc); @@ -466,12 +461,12 @@ uint32_t SourceManager::File::GetNumLines() { const char *SourceManager::File::PeekLineData(uint32_t line) { if (!LineIsValid(line)) - return NULL; + return nullptr; size_t line_offset = GetLineOffset(line); if (line_offset < m_data_sp->GetByteSize()) return (const char *)m_data_sp->GetBytes() + line_offset; - return NULL; + return nullptr; } uint32_t SourceManager::File::GetLineLength(uint32_t line, @@ -626,7 +621,7 @@ bool SourceManager::File::CalculateLineOffsets(uint32_t line) { return true; if (m_offsets.empty()) { - if (m_data_sp.get() == NULL) + if (m_data_sp.get() == nullptr) return false; const char *start = (char *)m_data_sp->GetBytes(); |