LLVM 20.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 <optional>
23#include <string>
24#include <vector>
25
26namespace llvm {
27
28class raw_ostream;
29class Error;
30class StringRef;
31
32namespace ifs {
33
34struct IFSStub;
35
37
38/// Attempts to read an IFS interface file from a StringRef buffer.
40
41/// Attempts to write an IFS interface file to a raw_ostream.
43
44/// Override the target platform inforation in the text stub.
45Error overrideIFSTarget(IFSStub &Stub, std::optional<IFSArch> OverrideArch,
46 std::optional<IFSEndiannessType> OverrideEndianness,
47 std::optional<IFSBitWidthType> OverrideBitWidth,
48 std::optional<std::string> OverrideTriple);
49
50/// Validate the target platform inforation in the text stub.
51Error validateIFSTarget(IFSStub &Stub, bool ParseTriple);
52
53/// Strips target platform information from the text stub.
54void stripIFSTarget(IFSStub &Stub, bool StripTriple, bool StripArch,
55 bool StripEndianness, bool StripBitWidth);
56
57Error filterIFSSyms(IFSStub &Stub, bool StripUndefined,
58 const std::vector<std::string> &Exclude = {});
59
60/// Parse llvm triple string into a IFSTarget struct.
61IFSTarget parseTriple(StringRef TripleStr);
62
63} // end namespace ifs
64} // end namespace llvm
65
66#endif // LLVM_INTERFACESTUB_IFSHANDLER_H
This file defines an internal representation of an InterFace Stub.
raw_pwrite_stream & OS
Defines the llvm::VersionTuple class, which represents a version in the form major[....
Lightweight error class with error context and mandatory checking.
Definition: Error.h:160
Tagged union holding either a T or a Error.
Definition: Error.h:481
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:51
Represents a version number in the form major[.minor[.subminor[.build]]].
Definition: VersionTuple.h:29
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:52
void stripIFSTarget(IFSStub &Stub, bool StripTriple, bool StripArch, bool StripEndianness, bool StripBitWidth)
Strips target platform information from the text stub.
Definition: IFSHandler.cpp:328
Expected< std::unique_ptr< IFSStub > > readIFSFromBuffer(StringRef Buf)
Attempts to read an IFS interface file from a StringRef buffer.
Definition: IFSHandler.cpp:179
Error validateIFSTarget(IFSStub &Stub, bool ParseTriple)
Validate the target platform inforation in the text stub.
Definition: IFSHandler.cpp:269
IFSTarget parseTriple(StringRef TripleStr)
Parse llvm triple string into a IFSTarget struct.
Definition: IFSHandler.cpp:304
Error writeIFSToOutputStream(raw_ostream &OS, const IFSStub &Stub)
Attempts to write an IFS interface file to a raw_ostream.
Definition: IFSHandler.cpp:213
const VersionTuple IFSVersionCurrent(3, 0)
Error filterIFSSyms(IFSStub &Stub, bool StripUndefined, const std::vector< std::string > &Exclude={})
Definition: IFSHandler.cpp:348
Error overrideIFSTarget(IFSStub &Stub, std::optional< IFSArch > OverrideArch, std::optional< IFSEndiannessType > OverrideEndianness, std::optional< IFSBitWidthType > OverrideBitWidth, std::optional< std::string > OverrideTriple)
Override the target platform inforation in the text stub.
Definition: IFSHandler.cpp:231
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18