diff options
| author | Diego Novillo <dnovillo@google.com> | 2013-11-13 12:22:39 +0000 |
|---|---|---|
| committer | Diego Novillo <dnovillo@google.com> | 2013-11-13 12:22:39 +0000 |
| commit | 5c29705c131fcff9ba8412fd458c95228d7fe772 (patch) | |
| tree | f994e085e84580e337539a77fee1f042b24327c3 /clang/lib/Driver/Tools.cpp | |
| parent | 8d6568b56b5f983350530cb6401bf5e286af0b36 (diff) | |
| download | bcm5719-llvm-5c29705c131fcff9ba8412fd458c95228d7fe772.tar.gz bcm5719-llvm-5c29705c131fcff9ba8412fd458c95228d7fe772.zip | |
Add -fprofile-sample-use to Clang's driver.
This adds a new option -fprofile-sample-use=filename to Clang. It
tells the driver to schedule the SampleProfileLoader pass and passes
on the name of the profile file to use.
llvm-svn: 194567
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
| -rw-r--r-- | clang/lib/Driver/Tools.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 810e3c1ef73..a4e4672ab97 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -3074,6 +3074,13 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, // Forward -f options with positive and negative forms; we translate // these by hand. + if (Arg *A = Args.getLastArg(options::OPT_fprofile_sample_use_EQ)) { + StringRef fname = A->getValue(); + if (!llvm::sys::fs::exists(fname)) + D.Diag(diag::err_drv_no_such_file) << fname; + else + A->render(Args, CmdArgs); + } if (Args.hasArg(options::OPT_mkernel)) { if (!Args.hasArg(options::OPT_fapple_kext) && types::isCXX(InputType)) |

