LLVM  14.0.0git
ArchiveYAML.cpp
Go to the documentation of this file.
1 //===- ArchiveYAML.cpp - ELF YAMLIO implementation -------------------- ----===//
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 archives.
10 //
11 //===----------------------------------------------------------------------===//
12 
14 
15 namespace llvm {
16 
17 namespace yaml {
18 
20  assert(!IO.getContext() && "The IO context is initialized already");
21  IO.setContext(&A);
22  IO.mapTag("!Arch", true);
23  IO.mapOptional("Magic", A.Magic, "!<arch>\n");
24  IO.mapOptional("Members", A.Members);
25  IO.mapOptional("Content", A.Content);
26  IO.setContext(nullptr);
27 }
28 
30  ArchYAML::Archive &A) {
31  if (A.Members && A.Content)
32  return "\"Content\" and \"Members\" cannot be used together";
33  return "";
34 }
35 
37  IO &IO, ArchYAML::Archive::Child &E) {
38  assert(IO.getContext() && "The IO context is not initialized");
39  for (auto &P : E.Fields)
40  IO.mapOptional(P.first.data(), P.second.Value, P.second.DefaultValue);
41  IO.mapOptional("Content", E.Content);
42  IO.mapOptional("PaddingByte", E.PaddingByte);
43 }
44 
45 std::string
48  for (auto &P : C.Fields)
49  if (P.second.Value.size() > P.second.MaxLength)
50  return ("the maximum length of \"" + P.first + "\" field is " +
51  Twine(P.second.MaxLength))
52  .str();
53  return "";
54 }
55 
56 } // end namespace yaml
57 
58 } // end namespace llvm
llvm::ArchYAML::Archive::Child
Definition: ArchiveYAML.h:25
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
P
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
Definition: README-SSE.txt:411
ArchiveYAML.h
llvm::yaml::MappingTraits
Definition: ModuleSummaryIndex.h:52
llvm::RISCVFeatures::validate
void validate(const Triple &TT, const FeatureBitset &FeatureBits)
Definition: RISCVBaseInfo.cpp:95
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
llvm::ArchYAML::Archive
Definition: ArchiveYAML.h:24
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:83