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 <functional>
18
19namespace llvm {
20
21class raw_ostream;
22class RecordKeeper;
23
24/// Perform the action using Records, and write output to OS.
25/// Returns true on error, false otherwise.
26using TableGenMainFn = bool(raw_ostream &OS, const RecordKeeper &Records);
27
28int TableGenMain(const char *argv0,
29 std::function<TableGenMainFn> MainFn = nullptr);
30
31/// Controls emitting large character arrays as strings or character arrays.
32/// Typically set to false when building with MSVC.
34
35} // end namespace llvm
36
37#endif // LLVM_TABLEGEN_MAIN_H
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.
cl::opt< bool > EmitLongStrLiterals
Controls emitting large character arrays as strings or character arrays.
bool(raw_ostream &OS, const RecordKeeper &Records) TableGenMainFn
Perform the action using Records, and write output to OS.
Definition Main.h:26
int TableGenMain(const char *argv0, std::function< TableGenMainFn > MainFn=nullptr)
Definition Main.cpp:108