Add GCC-compatible flags -fprofile-generate and -fprofile-use.
This patch adds support for specifying where the profile is emitted in a way similar to GCC. These flags are used to specify directories instead of filenames. When -fprofile-generate=DIR is used, the compiler will generate code to write to <DIR>/default.profraw. The patch also adds a couple of extensions: LLVM_PROFILE_FILE can still be used to override the directory and file name to use and -fprofile-use accepts both directories and filenames. To simplify the set of flags used in the backend, all the flags get canonicalized to -fprofile-instr-{generate,use} when passed to the backend. The decision to use a default name for the profile is done in the driver. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241825 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- docs/UsersManual.rst 39 additions, 0 deletionsdocs/UsersManual.rst
- include/clang/Driver/Options.td 12 additions, 4 deletionsinclude/clang/Driver/Options.td
- include/clang/Frontend/CodeGenOptions.h 1 addition, 0 deletionsinclude/clang/Frontend/CodeGenOptions.h
- lib/Driver/ToolChains.cpp 1 addition, 0 deletionslib/Driver/ToolChains.cpp
- lib/Driver/Tools.cpp 40 additions, 17 deletionslib/Driver/Tools.cpp
- test/Driver/clang_f_opts.c 34 additions, 5 deletionstest/Driver/clang_f_opts.c
- test/Profile/Inputs/gcc-flag-compatibility.proftext 5 additions, 0 deletionstest/Profile/Inputs/gcc-flag-compatibility.proftext
- test/Profile/gcc-flag-compatibility.c 48 additions, 0 deletionstest/Profile/gcc-flag-compatibility.c
Loading
Please register or sign in to comment