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