Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:40

0001 //===- SymbolRecordHelpers.h ------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORDHELPERS_H
0010 #define LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORDHELPERS_H
0011 
0012 #include "llvm/DebugInfo/CodeView/CVRecord.h"
0013 #include "llvm/DebugInfo/CodeView/CodeView.h"
0014 
0015 namespace llvm {
0016 namespace codeview {
0017 /// Return true if this symbol opens a scope. This implies that the symbol has
0018 /// "parent" and "end" fields, which contain the offset of the S_END or
0019 /// S_INLINESITE_END record.
0020 inline bool symbolOpensScope(SymbolKind Kind) {
0021   switch (Kind) {
0022   case SymbolKind::S_GPROC32:
0023   case SymbolKind::S_LPROC32:
0024   case SymbolKind::S_LPROC32_ID:
0025   case SymbolKind::S_GPROC32_ID:
0026   case SymbolKind::S_BLOCK32:
0027   case SymbolKind::S_SEPCODE:
0028   case SymbolKind::S_THUNK32:
0029   case SymbolKind::S_INLINESITE:
0030   case SymbolKind::S_INLINESITE2:
0031     return true;
0032   default:
0033     break;
0034   }
0035   return false;
0036 }
0037 
0038 /// Return true if this ssymbol ends a scope.
0039 inline bool symbolEndsScope(SymbolKind Kind) {
0040   switch (Kind) {
0041   case SymbolKind::S_END:
0042   case SymbolKind::S_PROC_ID_END:
0043   case SymbolKind::S_INLINESITE_END:
0044     return true;
0045   default:
0046     break;
0047   }
0048   return false;
0049 }
0050 
0051 /// Given a symbol P for which symbolOpensScope(P) == true, return the
0052 /// corresponding end offset.
0053 uint32_t getScopeEndOffset(const CVSymbol &Symbol);
0054 uint32_t getScopeParentOffset(const CVSymbol &Symbol);
0055 
0056 CVSymbolArray limitSymbolArrayToScope(const CVSymbolArray &Symbols,
0057                                       uint32_t ScopeBegin);
0058 
0059 } // namespace codeview
0060 } // namespace llvm
0061 
0062 #endif