File tree Expand file tree Collapse file tree 4 files changed +13
-15
lines changed Expand file tree Collapse file tree 4 files changed +13
-15
lines changed Original file line number Diff line number Diff line change @@ -18,14 +18,11 @@ public static int Main(string[] args)
18
18
if ( args . Length > 0 && args [ 0 ] == "--dotnetexec" )
19
19
{
20
20
var compilerRegEx = new Regex ( @"csc\.exe|mcs\.exe|csc\.dll" , RegexOptions . Compiled ) ;
21
- var cil = args . Length > 1 && args [ 1 ] == "--cil" ;
22
- for ( var i = cil ? 2 : 1 ; i < args . Length ; i ++ )
21
+ for ( var i = 1 ; i < args . Length ; i ++ )
23
22
{
24
23
if ( compilerRegEx . IsMatch ( args [ i ] ) )
25
24
{
26
25
var argsList = new List < string > ( ) ;
27
- if ( cil )
28
- argsList . Add ( "--cil" ) ;
29
26
argsList . Add ( "--compiler" ) ;
30
27
argsList . Add ( args [ i ] ) ;
31
28
if ( i + 1 < args . Length )
Original file line number Diff line number Diff line change @@ -56,7 +56,6 @@ public static int Main(string[] args)
56
56
CSharp . Extractor . SetInvariantCulture ( ) ;
57
57
58
58
var options = Options . Create ( args ) ;
59
- // options.CIL = true; // To do: Enable this
60
59
61
60
if ( options . Help )
62
61
{
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ public abstract class CommonOptions : ICommandLineOptions
28
28
/// <summary>
29
29
/// Holds if CIL should be extracted.
30
30
/// </summary>
31
- public bool CIL { get ; private set ; } = false ;
31
+ public bool CIL { get ; private set ; } = true ;
32
32
33
33
/// <summary>
34
34
/// Holds if assemblies shouldn't be extracted twice.
@@ -50,7 +50,6 @@ public abstract class CommonOptions : ICommandLineOptions
50
50
/// </summary>
51
51
public bool QlTest { get ; private set ; } = false ;
52
52
53
-
54
53
/// <summary>
55
54
/// The compression algorithm used for trap files.
56
55
/// </summary>
@@ -73,6 +72,9 @@ public virtual bool HandleOption(string key, string value)
73
72
return true ;
74
73
}
75
74
return false ;
75
+ case "cil" :
76
+ CIL = Boolean . Parse ( value ) ;
77
+ return true ;
76
78
default :
77
79
return false ;
78
80
}
@@ -97,9 +99,6 @@ public virtual bool HandleFlag(string flag, bool value)
97
99
case "cache" :
98
100
Cache = value ;
99
101
return true ;
100
- case "cil" :
101
- CIL = value ;
102
- return true ;
103
102
case "pdb" :
104
103
PDB = value ;
105
104
CIL = true ;
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ public interface ICommandLineOptions
17
17
bool HandleOption ( string key , string value ) ;
18
18
19
19
/// <summary>
20
- /// Handle a flag of the form "--cil " or "--nocil "
20
+ /// Handle a flag of the form "--cache " or "--nocache "
21
21
/// </summary>
22
22
/// <param name="key">The name of the flag. This is case sensitive.</param>
23
23
/// <param name="value">True if set, or false if prefixed by "--no"</param>
@@ -40,19 +40,22 @@ public interface ICommandLineOptions
40
40
41
41
public static class OptionsExtensions
42
42
{
43
+ private static readonly string [ ] ExtractorOptions = new [ ] { "trap_compression" , "cil" } ;
43
44
private static string ? GetExtractorOption ( string name ) =>
44
45
Environment . GetEnvironmentVariable ( $ "CODEQL_EXTRACTOR_CSHARP_OPTION_{ name . ToUpper ( ) } ") ;
45
46
46
47
private static List < string > GetExtractorOptions ( )
47
48
{
48
49
var extractorOptions = new List < string > ( ) ;
49
50
50
- var trapCompression = GetExtractorOption ( "trap_compression" ) ;
51
- if ( ! string . IsNullOrEmpty ( trapCompression ) )
51
+ foreach ( var option in ExtractorOptions )
52
52
{
53
- extractorOptions . Add ( $ "--trap_compression:{ trapCompression } ") ;
53
+ var value = GetExtractorOption ( option ) ;
54
+ if ( ! string . IsNullOrEmpty ( value ) )
55
+ {
56
+ extractorOptions . Add ( $ "--{ option } :{ value } ") ;
57
+ }
54
58
}
55
-
56
59
return extractorOptions ;
57
60
}
58
61
You can’t perform that action at this time.
0 commit comments