Files
clang-p2996/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
Pavel Labath 6a2eb36710 Have DWARFUnit store a *reference* to SymbolFileDWARF
Previously it was storing a *pointer*, which left open the possibility
of this pointer being null. We never made use of that possibility (it
does not make sense), and most of the code was already assuming that.
However, there were a couple of null-checks scattered around the code.

This patch replaces the reference with a pointer, making the
non-null-ness explicit, and removes the remaining null-checks.

llvm-svn: 363381
2019-06-14 13:01:16 +00:00

36 lines
1.2 KiB
C++

//===-- DWARFCompileUnit.h --------------------------------------*- C++ -*-===//
//
// 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
//
//===----------------------------------------------------------------------===//
#ifndef SymbolFileDWARF_DWARFCompileUnit_h_
#define SymbolFileDWARF_DWARFCompileUnit_h_
#include "DWARFUnit.h"
#include "llvm/Support/Error.h"
class DWARFCompileUnit : public DWARFUnit {
public:
void BuildAddressRangeTable(DWARFDebugAranges *debug_aranges) override;
void Dump(lldb_private::Stream *s) const override;
static bool classof(const DWARFUnit *unit) { return !unit->IsTypeUnit(); }
private:
DWARFCompileUnit(SymbolFileDWARF &dwarf, lldb::user_id_t uid,
const DWARFUnitHeader &header,
const DWARFAbbreviationDeclarationSet &abbrevs,
DIERef::Section section)
: DWARFUnit(dwarf, uid, header, abbrevs, section) {}
DISALLOW_COPY_AND_ASSIGN(DWARFCompileUnit);
friend class DWARFUnit;
};
#endif // SymbolFileDWARF_DWARFCompileUnit_h_