TargetExecutionUtils.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===-- TargetExecutionUtils.h - Utils for execution in target --*- 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. // Utilities for execution in the target process.
  15. //
  16. //===----------------------------------------------------------------------===//
  17. #ifndef LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_TARGETEXECUTIONUTILS_H
  18. #define LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_TARGETEXECUTIONUTILS_H
  19. #include "llvm/ADT/ArrayRef.h"
  20. #include "llvm/ADT/Optional.h"
  21. #include "llvm/ADT/StringRef.h"
  22. #include <string>
  23. namespace llvm {
  24. namespace orc {
  25. /// Run a main function, returning the result.
  26. ///
  27. /// If the optional ProgramName argument is given then it will be inserted
  28. /// before the strings in Args as the first argument to the called function.
  29. ///
  30. /// It is legal to have an empty argument list and no program name, however
  31. /// many main functions will expect a name argument at least, and will fail
  32. /// if none is provided.
  33. int runAsMain(int (*Main)(int, char *[]), ArrayRef<std::string> Args,
  34. Optional<StringRef> ProgramName = None);
  35. } // end namespace orc
  36. } // end namespace llvm
  37. #endif // LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_TARGETEXECUTIONUTILS_H
  38. #ifdef __GNUC__
  39. #pragma GCC diagnostic pop
  40. #endif