[InstCombine] Signed saturation patterns
[llvm-complete.git] / include / llvm / ObjectYAML / CodeViewYAMLTypes.h
blob04b5e0ba3aa1a0992f3b2bbb7b6d3a30d4642f2d
1 //==- CodeViewYAMLTypes.h - CodeView YAMLIO Type implementation --*- 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 // This file defines classes for handling the YAML representation of CodeView
10 // Debug Info.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_OBJECTYAML_CODEVIEWYAMLTYPES_H
15 #define LLVM_OBJECTYAML_CODEVIEWYAMLTYPES_H
17 #include "llvm/ADT/ArrayRef.h"
18 #include "llvm/DebugInfo/CodeView/TypeRecord.h"
19 #include "llvm/Support/Allocator.h"
20 #include "llvm/Support/Error.h"
21 #include "llvm/Support/YAMLTraits.h"
22 #include <cstdint>
23 #include <memory>
24 #include <vector>
26 namespace llvm {
28 namespace codeview {
29 class AppendingTypeTableBuilder;
32 namespace CodeViewYAML {
34 namespace detail {
36 struct LeafRecordBase;
37 struct MemberRecordBase;
39 } // end namespace detail
41 struct MemberRecord {
42 std::shared_ptr<detail::MemberRecordBase> Member;
45 struct LeafRecord {
46 std::shared_ptr<detail::LeafRecordBase> Leaf;
48 codeview::CVType
49 toCodeViewRecord(codeview::AppendingTypeTableBuilder &Serializer) const;
50 static Expected<LeafRecord> fromCodeViewRecord(codeview::CVType Type);
53 std::vector<LeafRecord> fromDebugT(ArrayRef<uint8_t> DebugTorP,
54 StringRef SectionName);
55 ArrayRef<uint8_t> toDebugT(ArrayRef<LeafRecord>, BumpPtrAllocator &Alloc,
56 StringRef SectionName);
58 } // end namespace CodeViewYAML
60 } // end namespace llvm
62 LLVM_YAML_DECLARE_SCALAR_TRAITS(codeview::GUID, QuotingType::Single)
64 LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::LeafRecord)
65 LLVM_YAML_DECLARE_MAPPING_TRAITS(CodeViewYAML::MemberRecord)
67 LLVM_YAML_IS_SEQUENCE_VECTOR(CodeViewYAML::LeafRecord)
68 LLVM_YAML_IS_SEQUENCE_VECTOR(CodeViewYAML::MemberRecord)
70 #endif // LLVM_OBJECTYAML_CODEVIEWYAMLTYPES_H