xref: /freebsd/contrib/llvm-project/llvm/include/llvm/TableGen/Parser.h (revision 5f757f3ff9144b609b3c433dfd370cc6bdc191ad)
1*81ad6265SDimitry Andric //===- llvm/TableGen/Parser.h - tblgen parser entry point -------*- C++ -*-===//
2*81ad6265SDimitry Andric //
3*81ad6265SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*81ad6265SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5*81ad6265SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*81ad6265SDimitry Andric //
7*81ad6265SDimitry Andric //===----------------------------------------------------------------------===//
8*81ad6265SDimitry Andric //
9*81ad6265SDimitry Andric // This file declares an entry point into the tablegen parser for use by tools.
10*81ad6265SDimitry Andric //
11*81ad6265SDimitry Andric //===----------------------------------------------------------------------===//
12*81ad6265SDimitry Andric 
13*81ad6265SDimitry Andric #ifndef LLVM_TABLEGEN_PARSER_H
14*81ad6265SDimitry Andric #define LLVM_TABLEGEN_PARSER_H
15*81ad6265SDimitry Andric 
16*81ad6265SDimitry Andric namespace llvm {
17*81ad6265SDimitry Andric class RecordKeeper;
18*81ad6265SDimitry Andric class SourceMgr;
19*81ad6265SDimitry Andric 
20*81ad6265SDimitry Andric /// Parse the TableGen file defined within the main buffer of the given
21*81ad6265SDimitry Andric /// SourceMgr. On success, populates the provided RecordKeeper with the parsed
22*81ad6265SDimitry Andric /// records and returns false. On failure, returns true.
23*81ad6265SDimitry Andric ///
24*81ad6265SDimitry Andric /// NOTE: TableGen currently relies on global state within a given parser
25*81ad6265SDimitry Andric ///       invocation, so this function is not thread-safe.
26*81ad6265SDimitry Andric bool TableGenParseFile(SourceMgr &InputSrcMgr, RecordKeeper &Records);
27*81ad6265SDimitry Andric 
28*81ad6265SDimitry Andric } // end namespace llvm
29*81ad6265SDimitry Andric 
30*81ad6265SDimitry Andric #endif // LLVM_TABLEGEN_PARSER_H
31