LLVM  14.0.0git
ArchiveEmitter.cpp
Go to the documentation of this file.
1 //===- ArchiveEmitter.cpp ---------------------------- --------------------===//
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 
11 #include "llvm/Support/Error.h"
13 
14 using namespace llvm;
15 using namespace ArchYAML;
16 
17 namespace llvm {
18 namespace yaml {
19 
21  Out.write(Doc.Magic.data(), Doc.Magic.size());
22 
23  if (Doc.Content) {
24  Doc.Content->writeAsBinary(Out);
25  return true;
26  }
27 
28  if (!Doc.Members)
29  return true;
30 
31  auto WriteField = [&](StringRef Field, uint8_t Size) {
32  Out.write(Field.data(), Field.size());
33  for (size_t I = Field.size(); I != Size; ++I)
34  Out.write(' ');
35  };
36 
37  for (const Archive::Child &C : *Doc.Members) {
38  for (auto &P : C.Fields)
39  WriteField(P.second.Value, P.second.MaxLength);
40 
41  if (C.Content)
42  C.Content->writeAsBinary(Out);
43  if (C.PaddingByte)
44  Out.write(*C.PaddingByte);
45  }
46 
47  return true;
48 }
49 
50 } // namespace yaml
51 } // namespace llvm
llvm::Check::Size
@ Size
Definition: FileCheck.h:73
llvm::ArchYAML::Archive::Child
Definition: ArchiveYAML.h:25
llvm
---------------------— PointerInfo ------------------------------------—
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
Field
OptimizedStructLayoutField Field
Definition: OptimizedStructLayout.cpp:17
ArchiveYAML.h
Error.h
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
llvm::yaml::yaml2archive
bool yaml2archive(ArchYAML::Archive &Doc, raw_ostream &Out, ErrorHandler EH)
Definition: ArchiveEmitter.cpp:20
llvm::raw_ostream::write
raw_ostream & write(unsigned char C)
Definition: raw_ostream.cpp:220
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
llvm::function_ref
An efficient, type-erasing, non-owning reference to a callable.
Definition: STLExtras.h:168
llvm::ArchYAML::Archive
Definition: ArchiveYAML.h:24
I
#define I(x, y, z)
Definition: MD5.cpp:59
llvm::ArchYAML::Archive::Content
Optional< yaml::BinaryRef > Content
Definition: ArchiveYAML.h:53
llvm::ArchYAML::Archive::Magic
StringRef Magic
Definition: ArchiveYAML.h:51
yaml2obj.h
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::ArchYAML::Archive::Members
Optional< std::vector< Child > > Members
Definition: ArchiveYAML.h:52
llvm::StringRef::data
const LLVM_NODISCARD char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
Definition: StringRef.h:149
llvm::OptimizedStructLayoutField
A field in a structure.
Definition: OptimizedStructLayout.h:45
raw_ostream.h
llvm::StringRef::size
LLVM_NODISCARD size_t size() const
size - Get the string size.
Definition: StringRef.h:157