2 #include "llvm_api/clang_frontend.h"
3 #include <llvm/Support/CommandLine.h>
9 int clang_compile(vector<str> input_files,
TanCompilation *config) {
10 vector<const char *> args;
13 args.push_back(
"clang++");
16 args.push_back(
"-fintegrated-cc1");
19 for (
size_t i = 0; i < n_import; ++i) {
25 str opt_level = opt_level_to_string(config->
opt_level);
26 args.push_back(opt_level.c_str());
29 std::for_each(input_files.begin(), input_files.end(), [&args](
const auto &s) { args.push_back(s.c_str()); });
31 std::for_each(input_files.begin(), input_files.end(), [](
const auto &a) { std::cout << a <<
' '; });
34 return clang_main((
int)args.size(), (
char **)args.data());
Compilation configuration.
vector< str > import_dirs
Library search paths.
TanOptLevel opt_level
Type of compilation,.