Add LLVM-pass plugin support to LDC. Commandline flag: -plugin=.... (#2554)

This adds functionality to load plugins such as the AFL llvm-mode plugin: https://github.com/mirrorer/afl/blob/master/llvm_mode/afl-llvm-pass.so.cc
Note that such plugins developed for Clang should also work for LDC !
This commit is contained in:
Johan Engelen 2018-02-13 20:22:48 +01:00 committed by GitHub
parent b22d8cccf3
commit 16ecb3e79f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 196 additions and 0 deletions

View file

@ -29,6 +29,7 @@
#include "driver/exe_path.h"
#include "driver/ldc-version.h"
#include "driver/linker.h"
#include "driver/plugins.h"
#include "driver/targetmachine.h"
#include "gen/cl_helpers.h"
#include "gen/irstate.h"
@ -1063,6 +1064,8 @@ int cppmain(int argc, char **argv) {
opts::initializeInstrumentationOptionsFromCmdline(
*global.params.targetTriple);
loadAllPlugins();
Strings libmodules;
return mars_mainBody(files, libmodules);
}