ParseAST.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===--- ParseAST.h - Define the ParseAST method ----------------*- 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 defines the clang::ParseAST method.
  15. //
  16. //===----------------------------------------------------------------------===//
  17. #ifndef LLVM_CLANG_PARSE_PARSEAST_H
  18. #define LLVM_CLANG_PARSE_PARSEAST_H
  19. #include "clang/Basic/LangOptions.h"
  20. namespace clang {
  21. class Preprocessor;
  22. class ASTConsumer;
  23. class ASTContext;
  24. class CodeCompleteConsumer;
  25. class Sema;
  26. /// Parse the entire file specified, notifying the ASTConsumer as
  27. /// the file is parsed.
  28. ///
  29. /// This operation inserts the parsed decls into the translation
  30. /// unit held by Ctx.
  31. ///
  32. /// \param PrintStats Whether to print LLVM statistics related to parsing.
  33. /// \param TUKind The kind of translation unit being parsed.
  34. /// \param CompletionConsumer If given, an object to consume code completion
  35. /// results.
  36. /// \param SkipFunctionBodies Whether to skip parsing of function bodies.
  37. /// This option can be used, for example, to speed up searches for
  38. /// declarations/definitions when indexing.
  39. void ParseAST(Preprocessor &pp, ASTConsumer *C,
  40. ASTContext &Ctx, bool PrintStats = false,
  41. TranslationUnitKind TUKind = TU_Complete,
  42. CodeCompleteConsumer *CompletionConsumer = nullptr,
  43. bool SkipFunctionBodies = false);
  44. /// Parse the main file known to the preprocessor, producing an
  45. /// abstract syntax tree.
  46. void ParseAST(Sema &S, bool PrintStats = false,
  47. bool SkipFunctionBodies = false);
  48. } // end namespace clang
  49. #endif
  50. #ifdef __GNUC__
  51. #pragma GCC diagnostic pop
  52. #endif