forked from OSchip/llvm-project
Add -fplugin=name.so option to the driver
This translates to -load name.so in the cc1 command. We can't name the driver option -load, as that means "link against oad", so instead we follow GCC's lead and name the option -fplugin. llvm-svn: 248378
This commit is contained in:
parent
2dfd35499e
commit
ad31ace8c8
|
@ -949,6 +949,8 @@ def fpic : Flag<["-"], "fpic">, Group<f_Group>;
|
|||
def fno_pic : Flag<["-"], "fno-pic">, Group<f_Group>;
|
||||
def fpie : Flag<["-"], "fpie">, Group<f_Group>;
|
||||
def fno_pie : Flag<["-"], "fno-pie">, Group<f_Group>;
|
||||
def fplugin_EQ : Joined<["-"], "fplugin=">, Group<f_Group>, Flags<[DriverOption]>, MetaVarName<"<dsopath>">,
|
||||
HelpText<"Load the named plugin (dynamic shared object)">;
|
||||
def fprofile_arcs : Flag<["-"], "fprofile-arcs">, Group<f_Group>;
|
||||
def fno_profile_arcs : Flag<["-"], "fno-profile-arcs">, Group<f_Group>;
|
||||
def framework : Separate<["-"], "framework">, Flags<[LinkerInput]>;
|
||||
|
|
|
@ -5037,6 +5037,13 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
// Forward -fparse-all-comments to -cc1.
|
||||
Args.AddAllArgs(CmdArgs, options::OPT_fparse_all_comments);
|
||||
|
||||
// Turn -fplugin=name.so into -load name.so
|
||||
for (const Arg *A : Args.filtered(options::OPT_fplugin_EQ)) {
|
||||
CmdArgs.push_back("-load");
|
||||
CmdArgs.push_back(A->getValue());
|
||||
A->claim();
|
||||
}
|
||||
|
||||
// Forward -Xclang arguments to -cc1, and -mllvm arguments to the LLVM option
|
||||
// parser.
|
||||
Args.AddAllArgValues(CmdArgs, options::OPT_Xclang);
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
// Check that all -fplugin arguments are converted to -load
|
||||
|
||||
// RUN: %clang -c %s -fplugin=foo.so -### 2>&1 | FileCheck %s --check-prefix=CHECK1
|
||||
// RUN: %clang -c %s -fplugin=foo.so -fplugin=bar.so -### 2>&1 | FileCheck %s --check-prefix=CHECK2
|
||||
|
||||
// CHECK1: "-load" "foo.so"
|
||||
// CHECK2: "-load" "foo.so" "-load" "bar.so"
|
Loading…
Reference in New Issue