diff options
Diffstat (limited to 'lldb/source')
-rw-r--r-- | lldb/source/API/SBCompileUnit.cpp | 14 | ||||
-rw-r--r-- | lldb/source/Symbol/CompileUnit.cpp | 4 |
2 files changed, 8 insertions, 10 deletions
diff --git a/lldb/source/API/SBCompileUnit.cpp b/lldb/source/API/SBCompileUnit.cpp index 48b501043e1..c9ca70645d9 100644 --- a/lldb/source/API/SBCompileUnit.cpp +++ b/lldb/source/API/SBCompileUnit.cpp @@ -118,10 +118,9 @@ uint32_t SBCompileUnit::FindLineEntryIndex(uint32_t start_idx, uint32_t line, uint32_t SBCompileUnit::GetNumSupportFiles() const { LLDB_RECORD_METHOD_CONST_NO_ARGS(uint32_t, SBCompileUnit, GetNumSupportFiles); - if (m_opaque_ptr) { - FileSpecList &support_files = m_opaque_ptr->GetSupportFiles(); - return support_files.GetSize(); - } + if (m_opaque_ptr) + return m_opaque_ptr->GetSupportFiles().GetSize(); + return 0; } @@ -155,9 +154,8 @@ SBFileSpec SBCompileUnit::GetSupportFileAtIndex(uint32_t idx) const { SBFileSpec sb_file_spec; if (m_opaque_ptr) { - FileSpecList &support_files = m_opaque_ptr->GetSupportFiles(); - FileSpec file_spec = support_files.GetFileSpecAtIndex(idx); - sb_file_spec.SetFileSpec(file_spec); + FileSpec spec = m_opaque_ptr->GetSupportFiles().GetFileSpecAtIndex(idx); + sb_file_spec.SetFileSpec(spec); } @@ -172,7 +170,7 @@ uint32_t SBCompileUnit::FindSupportFileIndex(uint32_t start_idx, sb_file, full); if (m_opaque_ptr) { - FileSpecList &support_files = m_opaque_ptr->GetSupportFiles(); + const FileSpecList &support_files = m_opaque_ptr->GetSupportFiles(); return support_files.FindFileIndex(start_idx, sb_file.ref(), full); } return 0; diff --git a/lldb/source/Symbol/CompileUnit.cpp b/lldb/source/Symbol/CompileUnit.cpp index ba9fd2776f3..5fb9b6b9f72 100644 --- a/lldb/source/Symbol/CompileUnit.cpp +++ b/lldb/source/Symbol/CompileUnit.cpp @@ -248,7 +248,7 @@ uint32_t CompileUnit::FindLineEntry(uint32_t start_idx, uint32_t line, // All the line table entries actually point to the version of the Compile // Unit that is in the support files (the one at 0 was artificially added.) // So prefer the one further on in the support files if it exists... - FileSpecList &support_files = GetSupportFiles(); + const FileSpecList &support_files = GetSupportFiles(); const bool full = true; file_idx = support_files.FindFileIndex( 1, support_files.GetFileSpecAtIndex(0), full); @@ -397,7 +397,7 @@ const std::vector<SourceModule> &CompileUnit::GetImportedModules() { return m_imported_modules; } -FileSpecList &CompileUnit::GetSupportFiles() { +const FileSpecList &CompileUnit::GetSupportFiles() { if (m_support_files.GetSize() == 0) { if (m_flags.IsClear(flagsParsedSupportFiles)) { m_flags.Set(flagsParsedSupportFiles); |