Skip to content

Add a build option to enable source level coverage analysis #503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions opencl_clang_options.td
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ include "llvm/Option/OptParser.td"
def g_Flag : Flag<["-"], "g">, HelpText<"Generate source level debug information">;
def gline_tables_only_Flag : Flag<["-"], "gline-tables-only">;
def profiling : Flag<["-"], "profiling">, HelpText<"Allow profiling">;
def coverage: Flag<["-"], "coverage">, HelpText<"Enable source level coverage analysis">;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def coverage: Flag<["-"], "coverage">, HelpText<"Enable source level coverage analysis">;
def coverage: Flag<["-"], "code_coverage">, HelpText<"Enable source level coverage analysis">;

is code_coverage better?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang/gcc both use '-coverage'.

def w : Flag<["-"], "w">, HelpText<"Suppress all warnings">;
def D : JoinedOrSeparate<["-"], "D">;
def I : JoinedOrSeparate<["-"], "I">, Flags<[RenderJoined]>, HelpText<"Add directory to include search path">;
Expand Down
1 change: 1 addition & 0 deletions options_compile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ std::string EffectiveOptionsFilter::processOptions(const OpenCLArgList &args,
// The below assert is usable for manual debugging only
// default:
// assert(false && "some unknown argument");
case OPT_COMPILE_coverage:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is line-tables-only enough for coverage?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, line-tables-only is enough. Code coverage doesn't need other information like type.

case OPT_COMPILE_profiling:
case OPT_COMPILE_gline_tables_only_Flag:
effectiveArgs.push_back("-debug-info-kind=line-tables-only");
Expand Down