LLVM  11.0.0git
TypeRecordHelpers.h
Go to the documentation of this file.
1 //===- TypeRecordHelpers.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_TYPERECORDHELPERS_H
10 #define LLVM_DEBUGINFO_CODEVIEW_TYPERECORDHELPERS_H
11 
13 
14 namespace llvm {
15 namespace codeview {
16 
17 /// Given an arbitrary codeview type, determine if it is an LF_STRUCTURE,
18 /// LF_CLASS, LF_INTERFACE, LF_UNION, or LF_ENUM with the forward ref class
19 /// option.
20 bool isUdtForwardRef(CVType CVT);
21 
22 /// Given a CVType which is assumed to be an LF_MODIFIER, return the
23 /// TypeIndex of the type that the LF_MODIFIER modifies.
24 TypeIndex getModifiedType(const CVType &CVT);
25 
26 /// Return true if this record should be in the IPI stream of a PDB. In an
27 /// object file, these record kinds will appear mixed into the .debug$T section.
28 inline bool isIdRecord(TypeLeafKind K) {
29  switch (K) {
30  case TypeLeafKind::LF_FUNC_ID:
31  case TypeLeafKind::LF_MFUNC_ID:
32  case TypeLeafKind::LF_STRING_ID:
33  case TypeLeafKind::LF_SUBSTR_LIST:
34  case TypeLeafKind::LF_BUILDINFO:
35  case TypeLeafKind::LF_UDT_SRC_LINE:
36  case TypeLeafKind::LF_UDT_MOD_SRC_LINE:
37  return true;
38  default:
39  return false;
40  }
41 }
42 
43 } // namespace codeview
44 } // namespace llvm
45 
46 #endif
This class represents lattice values for constants.
Definition: AllocatorList.h:23
TypeLeafKind
Duplicate copy of the above enum, but using the official CV names.
Definition: CodeView.h:33
bool isUdtForwardRef(CVType CVT)
Given an arbitrary codeview type, determine if it is an LF_STRUCTURE, LF_CLASS, LF_INTERFACE, LF_UNION, or LF_ENUM with the forward ref class option.
CVRecord< TypeLeafKind > CVType
Definition: TypeRecord.h:35
TypeIndex getModifiedType(const CVType &CVT)
Given a CVType which is assumed to be an LF_MODIFIER, return the TypeIndex of the type that the LF_MO...
bool isIdRecord(TypeLeafKind K)
Return true if this record should be in the IPI stream of a PDB.