Skip to content
This repository was archived by the owner on Nov 13, 2026. It is now read-only.

Add support for single method compilation mode - #1516

Merged
MichalStrehovsky merged 3 commits into
dotnet:masterfrom
MichalStrehovsky:singleMethod
Jul 14, 2016
Merged

MichalStrehovsky merged 3 commits into
dotnet:masterfrom
MichalStrehovsky:singleMethod

Conversation

@MichalStrehovsky

Copy link
Copy Markdown
Member

Add a set of command line arguments that let us specify a single method
to compile. This is useful when investigating code generation issues to
help narrow down the focus and make it easier to set up breakpoints.

Fixes #1142.

Add a set of command line arguments that let us specify a single method
to compile. This is useful when investigating code generation issue to
help narrow down the focus and make it easier to set up breakpoints.

Fixes dotnet#1142.
@MichalStrehovsky

Copy link
Copy Markdown
Member Author

@nattress PTAL

return null;

if (_singleMethodName == null || _singleMethodTypeName == null)
throw new CommandLineException("Both method name and type name are required parameters for single method mode");

@nattress nattress Jul 14, 2016 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would be nice to parse the type / method name as a single string instead of a collection of pieces and if a method fails to compile, write out the name in the same parseable format a la Nutc

Edit: We could bring over TypeNameUtilities to make parsing easier, though we'd have to switch out CCI and replace with the common type system.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

NUTC has -singlemethodbyname TypeName MethodName where TypeName is in the ECMA-335 SerString format and method name is just the method name, followed by a bunch of -singleMethodGenericParam Param.

This is the exact same thing, except we need to split -singlemethodbyname TypeName MethodName because System.CommandLine can't do a switch with two arguments.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: We should be consistent on whether we use braces for single statement inside ifs / loops. This one has no braces but the throw in FindType above does.

@nattress

Copy link
Copy Markdown
Contributor

LGTM!

@MichalStrehovsky
MichalStrehovsky merged commit 39e5d69 into dotnet:master Jul 14, 2016
@MichalStrehovsky
MichalStrehovsky deleted the singleMethod branch July 14, 2016 19:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants