(draft; work in progress)
See also:
- Compilers
- Program analysis:
- Dynamic analysis - instrumentation, translation, sanitizers
// % clang++ $(llvm-config --cxxflags --ldflags --system-libs --libs core) -o hello_world_llvm hello_world_llvm.cpp | |
// % ./hello_world_llvm | |
// hello world | |
#include <llvm/ExecutionEngine/ExecutionEngine.h> | |
#include <llvm/ExecutionEngine/GenericValue.h> | |
#include <llvm/IR/IRBuilder.h> | |
#include <stdio.h> | |
using namespace llvm; |
// This is required to be able to use the rustc crates. | |
#![feature(rustc_private)] | |
// This is only required for the `rustc_*` crates. Regular dependencies can be used without it. | |
extern crate rustc_driver; | |
extern crate rustc_hir; | |
extern crate rustc_interface; | |
extern crate rustc_middle; | |
use rustc_driver::{catch_with_exit_code, Callbacks, Compilation, RunCompiler}; |
(draft; work in progress)
See also: