diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2011-04-21 23:44:07 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2011-04-21 23:44:07 +0000 |
commit | e8ba8d78a258ec992d3521eebdae8324db777b14 (patch) | |
tree | 8ae2203575319074b026b5fb77372c5a66f3f896 /include/clang | |
parent | 3cc3ffc740e932e07519fdfc38ba4a76884e6e8d (diff) |
Wire up the -ftest-coverage and -fprofile-arcs flags to .gcno file emission (at
compile time) and .gcda emission (at runtime). --coverage enables both.
This does not yet add the profile_rt library to the link step if -fprofile-arcs
is enabled when linking.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129956 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/Driver/CC1Options.td | 4 | ||||
-rw-r--r-- | include/clang/Driver/Options.td | 1 | ||||
-rw-r--r-- | include/clang/Frontend/CodeGenOptions.h | 4 |
3 files changed, 9 insertions, 0 deletions
diff --git a/include/clang/Driver/CC1Options.td b/include/clang/Driver/CC1Options.td index 3457a20d01..0c2a077a93 100644 --- a/include/clang/Driver/CC1Options.td +++ b/include/clang/Driver/CC1Options.td @@ -135,6 +135,10 @@ def fdata_sections : Flag<"-fdata-sections">, HelpText<"Place each data in its own section (ELF Only)">; def funroll_loops : Flag<"-funroll-loops">, HelpText<"Turn on loop unroller">; +def femit_coverage_notes : Flag<"-femit-coverage-notes">, + HelpText<"Emit a gcov coverage notes file when compiling.">; +def femit_coverage_data: Flag<"-femit-coverage-data">, + HelpText<"Instrument the program to emit gcov coverage data when run.">; def relaxed_aliasing : Flag<"-relaxed-aliasing">, HelpText<"Turn off Type Based Alias Analysis">; def masm_verbose : Flag<"-masm-verbose">, diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td index ed891c067a..542728f2f1 100644 --- a/include/clang/Driver/Options.td +++ b/include/clang/Driver/Options.td @@ -423,6 +423,7 @@ def ftabstop_EQ : Joined<"-ftabstop=">, Group<f_Group>; def ftemplate_depth_ : Joined<"-ftemplate-depth-">, Group<f_Group>; def ftemplate_backtrace_limit_EQ : Joined<"-ftemplate-backtrace-limit=">, Group<f_Group>; +def ftest_coverage : Flag<"-ftest-coverage">, Group<f_Group>; def Wlarge_by_value_copy_def : Flag<"-Wlarge-by-value-copy">; def Wlarge_by_value_copy_EQ : Joined<"-Wlarge-by-value-copy=">; diff --git a/include/clang/Frontend/CodeGenOptions.h b/include/clang/Frontend/CodeGenOptions.h index 60a6398262..cede010199 100644 --- a/include/clang/Frontend/CodeGenOptions.h +++ b/include/clang/Frontend/CodeGenOptions.h @@ -52,6 +52,8 @@ public: /// Decl* various IR entities came from. Only /// useful when running CodeGen as a /// subroutine. + unsigned EmitGcovArcs : 1; /// Emit coverage data files, aka. GCDA. + unsigned EmitGcovNotes : 1; /// Emit coverage "notes" files, aka GCNO. unsigned ForbidGuardVariables : 1; /// Issue errors if C++ guard variables /// are required unsigned FunctionSections : 1; /// Set when -ffunction-sections is enabled @@ -135,6 +137,8 @@ public: DisableLLVMOpts = 0; DisableRedZone = 0; EmitDeclMetadata = 0; + EmitGcovArcs = 0; + EmitGcovNotes = 0; ForbidGuardVariables = 0; FunctionSections = 0; HiddenWeakTemplateVTables = 0; |