blob: 5c523eba037e7dc110cd8569b67de8b24cd81f12 [file] [log] [blame]
Olivier Deprezf4ef2d02021-04-20 13:36:24 +02001//===- TBEHandler.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/// \file
10/// This file declares an interface for reading and writing .tbe (text-based
11/// ELF) files.
12///
13//===-----------------------------------------------------------------------===/
14
15#ifndef LLVM_TEXTAPI_ELF_TBEHANDLER_H
16#define LLVM_TEXTAPI_ELF_TBEHANDLER_H
17
18#include "llvm/Support/Error.h"
19#include "llvm/Support/VersionTuple.h"
20#include <memory>
21
22namespace llvm {
23
24class raw_ostream;
25class Error;
26class StringRef;
27
28namespace elfabi {
29
30class ELFStub;
31
32const VersionTuple TBEVersionCurrent(1, 0);
33
34/// Attempts to read an ELF interface file from a StringRef buffer.
35Expected<std::unique_ptr<ELFStub>> readTBEFromBuffer(StringRef Buf);
36
37/// Attempts to write an ELF interface file to a raw_ostream.
38Error writeTBEToOutputStream(raw_ostream &OS, const ELFStub &Stub);
39
40} // end namespace elfabi
41} // end namespace llvm
42
43#endif // LLVM_TEXTAPI_ELF_TBEHANDLER_H