Thanks to visit codestin.com
Credit goes to llvm.org
LLVM
22.0.0git
include
llvm
InterfaceStub
ELFObjHandler.h
Go to the documentation of this file.
1
//===- ELFObjHandler.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
/// \file
9
/// This supports reading and writing of elf dynamic shared objects.
10
///
11
//===-----------------------------------------------------------------------===/
12
13
#ifndef LLVM_INTERFACESTUB_ELFOBJHANDLER_H
14
#define LLVM_INTERFACESTUB_ELFOBJHANDLER_H
15
16
#include "
llvm/ADT/StringRef.h
"
17
#include "
llvm/Support/Compiler.h
"
18
#include "
llvm/Support/Error.h
"
19
#include "
llvm/Support/MemoryBufferRef.h
"
20
#include <memory>
21
22
namespace
llvm
{
23
24
namespace
ifs
{
25
struct
IFSStub
;
26
27
/// Attempt to read a binary ELF file from a MemoryBuffer.
28
LLVM_ABI
Expected<std::unique_ptr<IFSStub>
>
readELFFile
(
MemoryBufferRef
Buf);
29
30
/// Attempt to write a binary ELF stub.
31
/// This function determines appropriate ELFType using the passed ELFTarget and
32
/// then writes a binary ELF stub to a specified file path.
33
///
34
/// @param FilePath File path for writing the ELF binary.
35
/// @param Stub Source ELFStub to generate a binary ELF stub from.
36
/// @param WriteIfChanged Whether or not to preserve timestamp if
37
/// the output stays the same.
38
LLVM_ABI
Error
writeBinaryStub
(
StringRef
FilePath,
const
IFSStub
&Stub,
39
bool
WriteIfChanged
=
false
);
40
41
}
// end namespace ifs
42
}
// end namespace llvm
43
44
#endif
// LLVM_INTERFACESTUB_ELFOBJHANDLER_H
Compiler.h
LLVM_ABI
#define LLVM_ABI
Definition
Compiler.h:213
WriteIfChanged
static cl::opt< bool > WriteIfChanged("write-if-changed", cl::desc("Only write output if it changed"))
MemoryBufferRef.h
StringRef.h
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition
Error.h:159
llvm::Expected
Tagged union holding either a T or a Error.
Definition
Error.h:485
llvm::MemoryBufferRef
Definition
MemoryBufferRef.h:23
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition
StringRef.h:55
Error.h
llvm::ifs
Definition
ELFObjHandler.h:24
llvm::ifs::readELFFile
LLVM_ABI Expected< std::unique_ptr< IFSStub > > readELFFile(MemoryBufferRef Buf)
Attempt to read a binary ELF file from a MemoryBuffer.
Definition
ELFObjHandler.cpp:691
llvm::ifs::writeBinaryStub
LLVM_ABI Error writeBinaryStub(StringRef FilePath, const IFSStub &Stub, bool WriteIfChanged=false)
Attempt to write a binary ELF stub.
Definition
ELFObjHandler.cpp:712
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition
AddressRanges.h:18
llvm::ifs::IFSStub
Definition
IFSStub.h:90
Generated on
for LLVM by
1.14.0