File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
llvm/examples/HowToUseLLJIT Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 1
- // ===-- examples/HowToUseJIT/HowToUseJIT .cpp - An example use of the JIT --===//
1
+ // ===------- HowToUseLLJIT .cpp - An example use of ORC-based LLJIT ------ --===//
2
2
//
3
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
4
// See https://llvm.org/LICENSE.txt for license information.
5
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
6
//
7
7
// ===----------------------------------------------------------------------===//
8
+ //
9
+ // This small program provides an example of how to quickly build a small
10
+ // module with a 'add1' function and use of IRBuilder to create add & return
11
+ // instructions.
12
+ //
13
+ // Goal:
14
+ // The goal of this snippet is to create in the memory
15
+ // the LLVM module consisting of a function as follow:
16
+ //
17
+ // int add1(int x) {
18
+ // return x+1;
19
+ // }
20
+ // add1(42);
21
+ //
22
+ // then compile the module via LLJIT, then execute the 'add1'
23
+ // function and return result to a driver, i.e. to a "host program".
24
+ //
25
+ // ===----------------------------------------------------------------------===//
8
26
9
27
#include " llvm/ExecutionEngine/Orc/LLJIT.h"
10
28
#include " llvm/IR/Function.h"
You can’t perform that action at this time.
0 commit comments