Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:56

0001 //===- IFSHandler.h ---------------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===-----------------------------------------------------------------------===/
0008 ///
0009 /// \file
0010 /// This file declares an interface for reading and writing .ifs (text-based
0011 /// InterFace Stub) files.
0012 ///
0013 //===-----------------------------------------------------------------------===/
0014 
0015 #ifndef LLVM_INTERFACESTUB_IFSHANDLER_H
0016 #define LLVM_INTERFACESTUB_IFSHANDLER_H
0017 
0018 #include "IFSStub.h"
0019 #include "llvm/Support/Error.h"
0020 #include "llvm/Support/VersionTuple.h"
0021 #include <memory>
0022 #include <optional>
0023 #include <string>
0024 #include <vector>
0025 
0026 namespace llvm {
0027 
0028 class raw_ostream;
0029 class Error;
0030 class StringRef;
0031 
0032 namespace ifs {
0033 
0034 struct IFSStub;
0035 
0036 const VersionTuple IFSVersionCurrent(3, 0);
0037 
0038 /// Attempts to read an IFS interface file from a StringRef buffer.
0039 Expected<std::unique_ptr<IFSStub>> readIFSFromBuffer(StringRef Buf);
0040 
0041 /// Attempts to write an IFS interface file to a raw_ostream.
0042 Error writeIFSToOutputStream(raw_ostream &OS, const IFSStub &Stub);
0043 
0044 /// Override the target platform inforation in the text stub.
0045 Error overrideIFSTarget(IFSStub &Stub, std::optional<IFSArch> OverrideArch,
0046                         std::optional<IFSEndiannessType> OverrideEndianness,
0047                         std::optional<IFSBitWidthType> OverrideBitWidth,
0048                         std::optional<std::string> OverrideTriple);
0049 
0050 /// Validate the target platform inforation in the text stub.
0051 Error validateIFSTarget(IFSStub &Stub, bool ParseTriple);
0052 
0053 /// Strips target platform information from the text stub.
0054 void stripIFSTarget(IFSStub &Stub, bool StripTriple, bool StripArch,
0055                     bool StripEndianness, bool StripBitWidth);
0056 
0057 Error filterIFSSyms(IFSStub &Stub, bool StripUndefined,
0058                     const std::vector<std::string> &Exclude = {});
0059 
0060 /// Parse llvm triple string into a IFSTarget struct.
0061 IFSTarget parseTriple(StringRef TripleStr);
0062 
0063 } // end namespace ifs
0064 } // end namespace llvm
0065 
0066 #endif // LLVM_INTERFACESTUB_IFSHANDLER_H