LLVM  15.0.0git
IFSHandler.h
Go to the documentation of this file.
1 //===- IFSHandler.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 .ifs (text-based
11 /// InterFace Stub) files.
12 ///
13 //===-----------------------------------------------------------------------===/
14 
15 #ifndef LLVM_INTERFACESTUB_IFSHANDLER_H
16 #define LLVM_INTERFACESTUB_IFSHANDLER_H
17 
18 #include "IFSStub.h"
19 #include "llvm/Support/Error.h"
21 #include <memory>
22 #include <string>
23 #include <vector>
24 
25 namespace llvm {
26 
27 class raw_ostream;
28 class Error;
29 class StringRef;
30 
31 namespace ifs {
32 
33 struct IFSStub;
34 
35 const VersionTuple IFSVersionCurrent(3, 0);
36 
37 /// Attempts to read an IFS interface file from a StringRef buffer.
38 Expected<std::unique_ptr<IFSStub>> readIFSFromBuffer(StringRef Buf);
39 
40 /// Attempts to write an IFS interface file to a raw_ostream.
41 Error writeIFSToOutputStream(raw_ostream &OS, const IFSStub &Stub);
42 
43 /// Override the target platform inforation in the text stub.
44 Error overrideIFSTarget(IFSStub &Stub, Optional<IFSArch> OverrideArch,
45  Optional<IFSEndiannessType> OverrideEndianness,
46  Optional<IFSBitWidthType> OverrideBitWidth,
47  Optional<std::string> OverrideTriple);
48 
49 /// Validate the target platform inforation in the text stub.
50 Error validateIFSTarget(IFSStub &Stub, bool ParseTriple);
51 
52 /// Strips target platform information from the text stub.
53 void stripIFSTarget(IFSStub &Stub, bool StripTriple, bool StripArch,
54  bool StripEndianness, bool StripBitWidth);
55 
56 Error filterIFSSyms(IFSStub &Stub, bool StripUndefined,
57  const std::vector<std::string> &Exclude = {});
58 
59 /// Parse llvm triple string into a IFSTarget struct.
60 IFSTarget parseTriple(StringRef TripleStr);
61 
62 } // end namespace ifs
63 } // end namespace llvm
64 
65 #endif // LLVM_INTERFACESTUB_IFSHANDLER_H
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::lltok::Error
@ Error
Definition: LLToken.h:21
llvm::ifs::filterIFSSyms
Error filterIFSSyms(IFSStub &Stub, bool StripUndefined, const std::vector< std::string > &Exclude={})
Definition: IFSHandler.cpp:335
VersionTuple.h
Error.h
llvm::ifs::IFSVersionCurrent
const VersionTuple IFSVersionCurrent(3, 0)
llvm::ifs::writeIFSToOutputStream
Error writeIFSToOutputStream(raw_ostream &OS, const IFSStub &Stub)
Attempts to write an IFS interface file to a raw_ostream.
Definition: IFSHandler.cpp:201
llvm::ifs::validateIFSTarget
Error validateIFSTarget(IFSStub &Stub, bool ParseTriple)
Validate the target platform inforation in the text stub.
Definition: IFSHandler.cpp:259
llvm::ifs::readIFSFromBuffer
Expected< std::unique_ptr< IFSStub > > readIFSFromBuffer(StringRef Buf)
Attempts to read an IFS interface file from a StringRef buffer.
Definition: IFSHandler.cpp:178
IFSStub.h
llvm::ifs::stripIFSTarget
void stripIFSTarget(IFSStub &Stub, bool StripTriple, bool StripArch, bool StripEndianness, bool StripBitWidth)
Strips target platform information from the text stub.
Definition: IFSHandler.cpp:315
llvm::ifs::parseTriple
IFSTarget parseTriple(StringRef TripleStr)
Parse llvm triple string into a IFSTarget struct.
Definition: IFSHandler.cpp:294
llvm::ifs::overrideIFSTarget
Error overrideIFSTarget(IFSStub &Stub, Optional< IFSArch > OverrideArch, Optional< IFSEndiannessType > OverrideEndianness, Optional< IFSBitWidthType > OverrideBitWidth, Optional< std::string > OverrideTriple)
Override the target platform inforation in the text stub.
Definition: IFSHandler.cpp:219