1 //===- SymbolRecordHelpers.h ------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORDHELPERS_H
10 #define LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORDHELPERS_H
12 #include "llvm/DebugInfo/CodeView/SymbolRecord.h"
16 /// Return true if this symbol opens a scope. This implies that the symbol has
17 /// "parent" and "end" fields, which contain the offset of the S_END or
18 /// S_INLINESITE_END record.
19 inline bool symbolOpensScope(SymbolKind Kind
) {
21 case SymbolKind::S_GPROC32
:
22 case SymbolKind::S_LPROC32
:
23 case SymbolKind::S_LPROC32_ID
:
24 case SymbolKind::S_GPROC32_ID
:
25 case SymbolKind::S_BLOCK32
:
26 case SymbolKind::S_SEPCODE
:
27 case SymbolKind::S_THUNK32
:
28 case SymbolKind::S_INLINESITE
:
29 case SymbolKind::S_INLINESITE2
:
37 /// Return true if this ssymbol ends a scope.
38 inline bool symbolEndsScope(SymbolKind Kind
) {
40 case SymbolKind::S_END
:
41 case SymbolKind::S_PROC_ID_END
:
42 case SymbolKind::S_INLINESITE_END
:
50 /// Given a symbol P for which symbolOpensScope(P) == true, return the
51 /// corresponding end offset.
52 uint32_t getScopeEndOffset(const CVSymbol
&Symbol
);
53 uint32_t getScopeParentOffset(const CVSymbol
&Symbol
);
55 CVSymbolArray
limitSymbolArrayToScope(const CVSymbolArray
&Symbols
,
58 } // namespace codeview