| 1 | //===- opt.cpp - The LLVM Modular Optimizer -------------------------------===// |
| 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 | // Optimizations may be specified an arbitrary number of times on the command |
| 10 | // line, They are run in the order specified. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #include "llvm/ADT/ArrayRef.h" |
| 15 | #include "llvm/Support/InitLLVM.h" |
| 16 | #include <functional> |
| 17 | |
| 18 | using namespace llvm; |
| 19 | |
| 20 | namespace llvm { |
| 21 | class PassBuilder; |
| 22 | } |
| 23 | |
| 24 | extern "C" int |
| 25 | optMain(int argc, char **argv, |
| 26 | ArrayRef<std::function<void(PassBuilder &)>> PassBuilderCallbacks); |
| 27 | |
| 28 | int main(int argc, char **argv) { |
| 29 | InitLLVM X(argc, argv); |
| 30 | return optMain(argc, argv, PassBuilderCallbacks: {}); |
| 31 | } |
| 32 | |