LLVM 22.0.0git
TargetExecutionUtils.h
Go to the documentation of this file.
1//===-- TargetExecutionUtils.h - Utils for execution in target --*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// Utilities for execution in the target process.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_TARGETEXECUTIONUTILS_H
14#define LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_TARGETEXECUTIONUTILS_H
15
16#include "llvm/ADT/ArrayRef.h"
17#include "llvm/ADT/StringRef.h"
19#include <string>
20
21namespace llvm {
22namespace orc {
23
24/// Run a main function, returning the result.
25///
26/// If the optional ProgramName argument is given then it will be inserted
27/// before the strings in Args as the first argument to the called function.
28///
29/// It is legal to have an empty argument list and no program name, however
30/// many main functions will expect a name argument at least, and will fail
31/// if none is provided.
32LLVM_ABI int runAsMain(int (*Main)(int, char *[]), ArrayRef<std::string> Args,
33 std::optional<StringRef> ProgramName = std::nullopt);
34
35LLVM_ABI int runAsVoidFunction(int (*Func)(void));
36LLVM_ABI int runAsIntFunction(int (*Func)(int), int Arg);
37
38} // end namespace orc
39} // end namespace llvm
40
41#endif // LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_TARGETEXECUTIONUTILS_H
#define LLVM_ABI
Definition: Compiler.h:213
LLVM_ABI int runAsVoidFunction(int(*Func)(void))
LLVM_ABI int runAsIntFunction(int(*Func)(int), int Arg)
LLVM_ABI int runAsMain(int(*Main)(int, char *[]), ArrayRef< std::string > Args, std::optional< StringRef > ProgramName=std::nullopt)
Run a main function, returning the result.
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18