Parser.h 1.3 KB

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