LLVM 20.0.0git
TextAPIReader.h
Go to the documentation of this file.
1//===--- TextAPIReader.h - Text API Reader ----------------------*- 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#ifndef LLVM_TEXTAPI_TEXTAPIREADER_H
10#define LLVM_TEXTAPI_TEXTAPIREADER_H
11
12#include "llvm/Support/Error.h"
13
14namespace llvm {
15
16class MemoryBufferRef;
17
18namespace MachO {
19
20class InterfaceFile;
21enum FileType : unsigned;
22
24public:
25 /// Determine whether input can be interpreted as TAPI text file.
26 /// This allows one to exit early when file is not recognized as TAPI file
27 /// as opposed to `get` which attempts to full parse and load of library
28 /// attributes.
29 ///
30 /// \param InputBuffer Buffer holding contents of TAPI text file.
31 /// \return The file format version of TAPI text file.
32 static Expected<FileType> canRead(MemoryBufferRef InputBuffer);
33
34 /// Parse and get an InterfaceFile that represents the full
35 /// library.
36 ///
37 /// \param InputBuffer Buffer holding contents of TAPI text file.
39 get(MemoryBufferRef InputBuffer);
40
41 TextAPIReader() = delete;
42};
43
44} // end namespace MachO.
45} // end namespace llvm.
46
47#endif // LLVM_TEXTAPI_TEXTAPIREADER_H
Tagged union holding either a T or a Error.
Definition: Error.h:481
static Expected< FileType > canRead(MemoryBufferRef InputBuffer)
Determine whether input can be interpreted as TAPI text file.
Definition: TextStub.cpp:1074
static Expected< std::unique_ptr< InterfaceFile > > get(MemoryBufferRef InputBuffer)
Parse and get an InterfaceFile that represents the full library.
Definition: TextStub.cpp:1099
FileType
Defines the file type TextAPI files can represent.
Definition: FileTypes.h:15
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18