LLVM  13.0.0git
SymbolRecordHelpers.h
Go to the documentation of this file.
1 //===- SymbolRecordHelpers.h ------------------------------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORDHELPERS_H
10 #define LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORDHELPERS_H
11 
14 
15 namespace llvm {
16 namespace codeview {
17 /// Return true if this symbol opens a scope. This implies that the symbol has
18 /// "parent" and "end" fields, which contain the offset of the S_END or
19 /// S_INLINESITE_END record.
21  switch (Kind) {
22  case SymbolKind::S_GPROC32:
23  case SymbolKind::S_LPROC32:
24  case SymbolKind::S_LPROC32_ID:
25  case SymbolKind::S_GPROC32_ID:
26  case SymbolKind::S_BLOCK32:
27  case SymbolKind::S_SEPCODE:
28  case SymbolKind::S_THUNK32:
29  case SymbolKind::S_INLINESITE:
30  case SymbolKind::S_INLINESITE2:
31  return true;
32  default:
33  break;
34  }
35  return false;
36 }
37 
38 /// Return true if this ssymbol ends a scope.
40  switch (Kind) {
41  case SymbolKind::S_END:
42  case SymbolKind::S_PROC_ID_END:
43  case SymbolKind::S_INLINESITE_END:
44  return true;
45  default:
46  break;
47  }
48  return false;
49 }
50 
51 /// Given a symbol P for which symbolOpensScope(P) == true, return the
52 /// corresponding end offset.
55 
57  uint32_t ScopeBegin);
58 
59 } // namespace codeview
60 } // namespace llvm
61 
62 #endif
llvm::codeview::symbolEndsScope
bool symbolEndsScope(SymbolKind Kind)
Return true if this ssymbol ends a scope.
Definition: SymbolRecordHelpers.h:39
llvm
Definition: AllocatorList.h:23
llvm::codeview::SymbolKind
SymbolKind
Duplicate copy of the above enum, but using the official CV names.
Definition: CodeView.h:47
llvm::codeview::symbolOpensScope
bool symbolOpensScope(SymbolKind Kind)
Return true if this symbol opens a scope.
Definition: SymbolRecordHelpers.h:20
llvm::codeview::getScopeEndOffset
uint32_t getScopeEndOffset(const CVSymbol &Symbol)
Given a symbol P for which symbolOpensScope(P) == true, return the corresponding end offset.
Definition: SymbolRecordHelpers.cpp:23
llvm::codeview::CVSymbol
CVRecord< SymbolKind > CVSymbol
Definition: CVRecord.h:66
CodeView.h
llvm::lltok::Kind
Kind
Definition: LLToken.h:18
llvm::codeview::getScopeParentOffset
uint32_t getScopeParentOffset(const CVSymbol &Symbol)
Definition: SymbolRecordHelpers.cpp:54
uint32_t
llvm::codeview::CVSymbolArray
VarStreamArray< CVSymbol > CVSymbolArray
Definition: CVRecord.h:127
llvm::codeview::limitSymbolArrayToScope
CVSymbolArray limitSymbolArrayToScope(const CVSymbolArray &Symbols, uint32_t ScopeBegin)
Definition: SymbolRecordHelpers.cpp:85
CVRecord.h
llvm::ARMBuildAttrs::Symbol
@ Symbol
Definition: ARMBuildAttributes.h:79