LLVM 22.0.0git
Main.h
Go to the documentation of this file.
1//===- llvm/TableGen/Main.h - tblgen entry point ----------------*- 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// This file declares the common entry point for tblgen tools.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_TABLEGEN_MAIN_H
14#define LLVM_TABLEGEN_MAIN_H
15
17#include <map>
18
19namespace llvm {
20
21class raw_ostream;
22class RecordKeeper;
23
25 std::string MainFile;
26
27 // Translates additional output file names to their contents.
28 std::map<StringRef, std::string> AdditionalFiles;
29};
30
31/// Returns true on error, false otherwise.
33 function_ref<bool(raw_ostream &OS, const RecordKeeper &Records)>;
34
35/// Perform the action using Records, and store output in OutFiles.
36/// Returns true on error, false otherwise.
38 const RecordKeeper &Records)>;
39
40int TableGenMain(const char *argv0, TableGenMainFn MainFn = nullptr);
41
42int TableGenMain(const char *argv0, MultiFileTableGenMainFn MainFn = nullptr);
43
44/// Controls emitting large character arrays as strings or character arrays.
45/// Typically set to false when building with MSVC.
47
48} // end namespace llvm
49
50#endif // LLVM_TABLEGEN_MAIN_H
An efficient, type-erasing, non-owning reference to a callable.
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
This is an optimization pass for GlobalISel generic memory operations.
function_ref< bool(TableGenOutputFiles &OutFiles, const RecordKeeper &Records)> MultiFileTableGenMainFn
Perform the action using Records, and store output in OutFiles.
Definition Main.h:37
function_ref< bool(raw_ostream &OS, const RecordKeeper &Records)> TableGenMainFn
Returns true on error, false otherwise.
Definition Main.h:32
cl::opt< bool > EmitLongStrLiterals
Controls emitting large character arrays as strings or character arrays.
int TableGenMain(const char *argv0, TableGenMainFn MainFn=nullptr)
Definition Main.cpp:211
std::map< StringRef, std::string > AdditionalFiles
Definition Main.h:28
std::string MainFile
Definition Main.h:25