1 //===- TBEHandler.h ---------------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===-----------------------------------------------------------------------===/
9 ///
10 /// \file
11 /// This file declares an interface for reading and writing .tbe (text-based
12 /// ELF) files.
13 ///
14 //===-----------------------------------------------------------------------===/
15 
16 #ifndef LLVM_TEXTAPI_ELF_TBEHANDLER_H
17 #define LLVM_TEXTAPI_ELF_TBEHANDLER_H
18 
19 #include "llvm/Support/VersionTuple.h"
20 #include "llvm/Support/Error.h"
21 #include <memory>
22 
23 namespace llvm {
24 
25 class raw_ostream;
26 class Error;
27 class StringRef;
28 class VersionTuple;
29 
30 namespace elfabi {
31 
32 class ELFStub;
33 
34 const VersionTuple TBEVersionCurrent(1, 0);
35 
36 /// Attempts to read an ELF interface file from a StringRef buffer.
37 Expected<std::unique_ptr<ELFStub>> readTBEFromBuffer(StringRef Buf);
38 
39 /// Attempts to write an ELF interface file to a raw_ostream.
40 Error writeTBEToOutputStream(raw_ostream &OS, const ELFStub &Stub);
41 
42 } // end namespace elfabi
43 } // end namespace llvm
44 
45 #endif // LLVM_TEXTAPI_ELF_TBEHANDLER_H
46