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)
1818 if ( args . Length > 0 && args [ 0 ] == "--dotnetexec" )
1919 {
2020 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 ++ )
2322 {
2423 if ( compilerRegEx . IsMatch ( args [ i ] ) )
2524 {
2625 var argsList = new List < string > ( ) ;
27- if ( cil )
28- argsList . Add ( "--cil" ) ;
2926 argsList . Add ( "--compiler" ) ;
3027 argsList . Add ( args [ i ] ) ;
3128 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)
5656 CSharp . Extractor . SetInvariantCulture ( ) ;
5757
5858 var options = Options . Create ( args ) ;
59- // options.CIL = true; // To do: Enable this
6059
6160 if ( options . Help )
6261 {
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ public abstract class CommonOptions : ICommandLineOptions
2828 /// <summary>
2929 /// Holds if CIL should be extracted.
3030 /// </summary>
31- public bool CIL { get ; private set ; } = false ;
31+ public bool CIL { get ; private set ; } = true ;
3232
3333 /// <summary>
3434 /// Holds if assemblies shouldn't be extracted twice.
@@ -50,7 +50,6 @@ public abstract class CommonOptions : ICommandLineOptions
5050 /// </summary>
5151 public bool QlTest { get ; private set ; } = false ;
5252
53-
5453 /// <summary>
5554 /// The compression algorithm used for trap files.
5655 /// </summary>
@@ -73,6 +72,9 @@ public virtual bool HandleOption(string key, string value)
7372 return true ;
7473 }
7574 return false ;
75+ case "cil" :
76+ CIL = Boolean . Parse ( value ) ;
77+ return true ;
7678 default :
7779 return false ;
7880 }
@@ -97,9 +99,6 @@ public virtual bool HandleFlag(string flag, bool value)
9799 case "cache" :
98100 Cache = value ;
99101 return true ;
100- case "cil" :
101- CIL = value ;
102- return true ;
103102 case "pdb" :
104103 PDB = value ;
105104 CIL = true ;
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ public interface ICommandLineOptions
1717 bool HandleOption ( string key , string value ) ;
1818
1919 /// <summary>
20- /// Handle a flag of the form "--cil " or "--nocil "
20+ /// Handle a flag of the form "--cache " or "--nocache "
2121 /// </summary>
2222 /// <param name="key">The name of the flag. This is case sensitive.</param>
2323 /// <param name="value">True if set, or false if prefixed by "--no"</param>
@@ -40,19 +40,22 @@ public interface ICommandLineOptions
4040
4141 public static class OptionsExtensions
4242 {
43+ private static readonly string [ ] ExtractorOptions = new [ ] { "trap_compression" , "cil" } ;
4344 private static string ? GetExtractorOption ( string name ) =>
4445 Environment . GetEnvironmentVariable ( $ "CODEQL_EXTRACTOR_CSHARP_OPTION_{ name . ToUpper ( ) } ") ;
4546
4647 private static List < string > GetExtractorOptions ( )
4748 {
4849 var extractorOptions = new List < string > ( ) ;
4950
50- var trapCompression = GetExtractorOption ( "trap_compression" ) ;
51- if ( ! string . IsNullOrEmpty ( trapCompression ) )
51+ foreach ( var option in ExtractorOptions )
5252 {
53- extractorOptions . Add ( $ "--trap_compression:{ trapCompression } ") ;
53+ var value = GetExtractorOption ( option ) ;
54+ if ( ! string . IsNullOrEmpty ( value ) )
55+ {
56+ extractorOptions . Add ( $ "--{ option } :{ value } ") ;
57+ }
5458 }
55-
5659 return extractorOptions ;
5760 }
5861
You can’t perform that action at this time.
0 commit comments