LLVM  9.0.0svn
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 
13 
14 namespace llvm {
15 namespace codeview {
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.
20  switch (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:
30  return true;
31  default:
32  break;
33  }
34  return false;
35 }
36 
37 /// Return true if this ssymbol ends a scope.
39  switch (Kind) {
40  case SymbolKind::S_END:
41  case SymbolKind::S_PROC_ID_END:
42  case SymbolKind::S_INLINESITE_END:
43  return true;
44  default:
45  break;
46  }
47  return false;
48 }
49 
50 /// Given a symbol P for which symbolOpensScope(P) == true, return the
51 /// corresponding end offset.
54 
56  uint32_t ScopeBegin);
57 
58 } // namespace codeview
59 } // namespace llvm
60 
61 #endif
bool symbolEndsScope(SymbolKind Kind)
Return true if this ssymbol ends a scope.
This class represents lattice values for constants.
Definition: AllocatorList.h:23
uint32_t getScopeEndOffset(const CVSymbol &Symbol)
Given a symbol P for which symbolOpensScope(P) == true, return the corresponding end offset...
bool symbolOpensScope(SymbolKind Kind)
Return true if this symbol opens a scope.
uint32_t getScopeParentOffset(const CVSymbol &Symbol)
CVSymbolArray limitSymbolArrayToScope(const CVSymbolArray &Symbols, uint32_t ScopeBegin)
SymbolKind
Duplicate copy of the above enum, but using the official CV names.
Definition: CodeView.h:47
const unsigned Kind