Utils.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===--- Utils.h - Misc utilities for the front-end -------------*- 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 header contains miscellaneous utilities for various front-end actions
  15. // which were split from Frontend to minimise Frontend's dependencies.
  16. //
  17. //===----------------------------------------------------------------------===//
  18. #ifndef LLVM_CLANG_FRONTENDTOOL_UTILS_H
  19. #define LLVM_CLANG_FRONTENDTOOL_UTILS_H
  20. #include <memory>
  21. namespace clang {
  22. class CompilerInstance;
  23. class FrontendAction;
  24. /// Construct the FrontendAction of a compiler invocation based on the
  25. /// options specified for the compiler invocation.
  26. ///
  27. /// \return - The created FrontendAction object
  28. std::unique_ptr<FrontendAction> CreateFrontendAction(CompilerInstance &CI);
  29. /// ExecuteCompilerInvocation - Execute the given actions described by the
  30. /// compiler invocation object in the given compiler instance.
  31. ///
  32. /// \return - True on success.
  33. bool ExecuteCompilerInvocation(CompilerInstance *Clang);
  34. } // end namespace clang
  35. #endif
  36. #ifdef __GNUC__
  37. #pragma GCC diagnostic pop
  38. #endif