//===--------- LLJITRemovableCode.cpp -- LLJIT with Code Removal ----------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// In this example we will use an the resource management APIs to transfer
// ownership of modules, remove modules from a JITDylib, and then a whole
// JITDylib from the ExecutionSession.
//
//===----------------------------------------------------------------------===//
using namespace llvm;
using namespace llvm::orc;
ExitOnError ExitOnErr;
// Example IR modules.
//
// We will use a few modules containing no-op functions to demonstrate the code
// removal APIs.
const llvm::StringRef FooMod =
R"(
define void @foo() {
entry:
ret void
}
)";
const llvm::StringRef BarMod =
R"(
define void @bar() {
entry:
ret void
}
)";
const llvm::StringRef BazMod =
R"(
define void @baz() {
entry:
ret void
}
)";
int