LLVM  14.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 
23 namespace llvm {
24 
25 class raw_ostream;
26 class Error;
27 class StringRef;
28 
29 namespace ifs {
30 
31 struct IFSStub;
32 
33 const VersionTuple IFSVersionCurrent(3, 0);
34 
35 /// Attempts to read an IFS interface file from a StringRef buffer.
36 Expected<std::unique_ptr<IFSStub>> readIFSFromBuffer(StringRef Buf);
37 
38 /// Attempts to write an IFS interface file to a raw_ostream.
39 Error writeIFSToOutputStream(raw_ostream &OS, const IFSStub &Stub);
40 
41 /// Override the target platform inforation in the text stub.
42 Error overrideIFSTarget(IFSStub &Stub, Optional<IFSArch> OverrideArch,
43  Optional<IFSEndiannessType> OverrideEndianness,
44  Optional<IFSBitWidthType> OverrideBitWidth,
45  Optional<std::string> OverrideTriple);
46 
47 /// Validate the target platform inforation in the text stub.
48 Error validateIFSTarget(IFSStub &Stub, bool ParseTriple);
49 
50 /// Strips target platform information from the text stub.
51 void stripIFSTarget(IFSStub &Stub, bool StripTriple, bool StripArch,
52  bool StripEndianness, bool StripBitWidth);
53 
54 /// Strips symbols from IFS symbol table that are undefined.
55 void stripIFSUndefinedSymbols(IFSStub &Stub);
56 
57 /// Parse llvm triple string into a IFSTarget struct.
58 IFSTarget parseTriple(StringRef TripleStr);
59 
60 } // end namespace ifs
61 } // end namespace llvm
62 
63 #endif // LLVM_INTERFACESTUB_IFSHANDLER_H
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:23
llvm::lltok::Error
@ Error
Definition: LLToken.h:21
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:197
llvm::ifs::validateIFSTarget
Error validateIFSTarget(IFSStub &Stub, bool ParseTriple)
Validate the target platform inforation in the text stub.
Definition: IFSHandler.cpp:255
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:174
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:311
llvm::ifs::parseTriple
IFSTarget parseTriple(StringRef TripleStr)
Parse llvm triple string into a IFSTarget struct.
Definition: IFSHandler.cpp:290
llvm::ifs::stripIFSUndefinedSymbols
void stripIFSUndefinedSymbols(IFSStub &Stub)
Strips symbols from IFS symbol table that are undefined.
Definition: IFSHandler.cpp:331
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:215