@ -278,17 +278,14 @@ public class InferRunner {
TemporaryFolder folder ,
TemporaryFolder folder ,
String sourceFile ,
String sourceFile ,
Language lang ,
Language lang ,
boolean analyze ,
String analyzer ,
@Nullable String isysroot ,
@Nullable String isysroot ,
@Nullable String ml_buckets ,
@Nullable String ml_buckets ,
boolean arc ,
boolean arc ,
ImmutableList < String > extraInferOptions ) {
ImmutableList < String > extraInferOptions ) {
ImmutableList . Builder < String > inferOptionsBuilder = new ImmutableList . Builder < String > ( )
ImmutableList . Builder < String > inferOptionsBuilder = new ImmutableList . Builder < String > ( )
. addAll ( extraInferOptions ) ;
. addAll ( extraInferOptions ) ;
inferOptionsBuilder . add ( "--analyzer" ) . add ( analyzer ) ;
if ( ! analyze ) {
inferOptionsBuilder . add ( "--analyzer" ) . add ( "capture" ) ;
}
inferOptionsBuilder
inferOptionsBuilder
. add ( "--ml_buckets" )
. add ( "--ml_buckets" )
@ -311,7 +308,7 @@ public class InferRunner {
folder ,
folder ,
sourceFile ,
sourceFile ,
Language . C ,
Language . C ,
false ,
"capture" ,
null ,
null ,
null ,
null ,
false ,
false ,
@ -332,7 +329,7 @@ public class InferRunner {
folder ,
folder ,
sourceFile ,
sourceFile ,
Language . CPP ,
Language . CPP ,
false ,
"capture" ,
null ,
null ,
null ,
null ,
false ,
false ,
@ -353,7 +350,7 @@ public class InferRunner {
folder ,
folder ,
sourceFile ,
sourceFile ,
Language . ObjC ,
Language . ObjC ,
false ,
"capture" ,
getXcodeRoot ( ) + IPHONESIMULATOR_ISYSROOT_SUFFIX ,
getXcodeRoot ( ) + IPHONESIMULATOR_ISYSROOT_SUFFIX ,
null ,
null ,
false ,
false ,
@ -374,7 +371,7 @@ public class InferRunner {
folder ,
folder ,
sourceFile ,
sourceFile ,
Language . ObjC ,
Language . ObjC ,
false ,
"capture" ,
getXcodeRoot ( ) + IPHONESIMULATOR_ISYSROOT_SUFFIX ,
getXcodeRoot ( ) + IPHONESIMULATOR_ISYSROOT_SUFFIX ,
null ,
null ,
true ,
true ,
@ -395,7 +392,7 @@ public class InferRunner {
folder ,
folder ,
sourceFile ,
sourceFile ,
Language . ObjCPP ,
Language . ObjCPP ,
false ,
"capture" ,
getXcodeRoot ( ) + IPHONESIMULATOR_ISYSROOT_SUFFIX ,
getXcodeRoot ( ) + IPHONESIMULATOR_ISYSROOT_SUFFIX ,
null ,
null ,
false ,
false ,
@ -416,7 +413,7 @@ public class InferRunner {
folder ,
folder ,
sourceFile ,
sourceFile ,
Language . C ,
Language . C ,
true ,
"infer" ,
null ,
null ,
null ,
null ,
false ,
false ,
@ -441,7 +438,7 @@ public class InferRunner {
folder ,
folder ,
sourceFile ,
sourceFile ,
Language . CPP ,
Language . CPP ,
true ,
"infer" ,
null ,
null ,
null ,
null ,
false ,
false ,
@ -471,7 +468,7 @@ public class InferRunner {
folder ,
folder ,
sourceFile ,
sourceFile ,
Language . CPP ,
Language . CPP ,
true ,
"infer" ,
null ,
null ,
ml_bucket ,
ml_bucket ,
false ,
false ,
@ -485,28 +482,13 @@ public class InferRunner {
folder ,
folder ,
sourceFile ,
sourceFile ,
Language . ObjC ,
Language . ObjC ,
true ,
"infer" ,
getXcodeRoot ( ) + IPHONESIMULATOR_ISYSROOT_SUFFIX ,
getXcodeRoot ( ) + IPHONESIMULATOR_ISYSROOT_SUFFIX ,
null ,
null ,
false ,
false ,
ImmutableList . < String > of ( ) ) ;
ImmutableList . < String > of ( ) ) ;
}
}
public static ImmutableList < String > createObjCInferCommandSimple (
TemporaryFolder folder ,
String sourceFile ,
String ml_bucket ) throws IOException , InterruptedException {
return createClangInferCommand (
folder ,
sourceFile ,
Language . ObjC ,
true ,
null ,
ml_bucket ,
false ,
ImmutableList . < String > of ( ) ) ;
}
public static ImmutableList < String > createObjCInferCommandWithMLBuckets (
public static ImmutableList < String > createObjCInferCommandWithMLBuckets (
TemporaryFolder folder ,
TemporaryFolder folder ,
String sourceFile ,
String sourceFile ,
@ -516,7 +498,7 @@ public class InferRunner {
folder ,
folder ,
sourceFile ,
sourceFile ,
Language . ObjC ,
Language . ObjC ,
true ,
"infer" ,
getXcodeRoot ( ) + IPHONESIMULATOR_ISYSROOT_SUFFIX ,
getXcodeRoot ( ) + IPHONESIMULATOR_ISYSROOT_SUFFIX ,
ml_bucket ,
ml_bucket ,
arc ,
arc ,
@ -530,7 +512,7 @@ public class InferRunner {
folder ,
folder ,
sourceFile ,
sourceFile ,
Language . ObjCPP ,
Language . ObjCPP ,
true ,
"infer" ,
getXcodeRoot ( ) + IPHONESIMULATOR_ISYSROOT_SUFFIX ,
getXcodeRoot ( ) + IPHONESIMULATOR_ISYSROOT_SUFFIX ,
null ,
null ,
false ,
false ,
@ -544,7 +526,7 @@ public class InferRunner {
folder ,
folder ,
sourceFile ,
sourceFile ,
Language . ObjC ,
Language . ObjC ,
false ,
"infer" ,
getXcodeRoot ( ) + IPHONESIMULATOR_ISYSROOT_SUFFIX ,
getXcodeRoot ( ) + IPHONESIMULATOR_ISYSROOT_SUFFIX ,
null ,
null ,
false ,
false ,
@ -558,7 +540,7 @@ public class InferRunner {
folder ,
folder ,
sourceFile ,
sourceFile ,
Language . ObjC ,
Language . ObjC ,
true ,
"infer" ,
getXcodeRoot ( ) + IPHONESIMULATOR_ISYSROOT_SUFFIX ,
getXcodeRoot ( ) + IPHONESIMULATOR_ISYSROOT_SUFFIX ,
null ,
null ,
false ,
false ,
@ -574,13 +556,55 @@ public class InferRunner {
folder ,
folder ,
sourceFile ,
sourceFile ,
Language . ObjC ,
Language . ObjC ,
true ,
"infer" ,
getXcodeRoot ( ) + IPHONESIMULATOR_ISYSROOT_SUFFIX ,
getXcodeRoot ( ) + IPHONESIMULATOR_ISYSROOT_SUFFIX ,
bucket ,
bucket ,
arc ,
arc ,
ImmutableList . < String > of ( ) ) ;
ImmutableList . < String > of ( ) ) ;
}
}
public static ImmutableList < String > createLintersCommand (
TemporaryFolder folder ,
String sourceFile ,
Language lang ) throws IOException , InterruptedException {
return createClangInferCommand (
folder ,
sourceFile ,
lang ,
"linters" ,
getXcodeRoot ( ) + IPHONESIMULATOR_ISYSROOT_SUFFIX ,
null ,
true ,
ImmutableList . < String > of ( ) ) ;
}
public static ImmutableList < String > createObjCLintersCommand (
TemporaryFolder folder ,
String sourceFile ) throws IOException , InterruptedException {
return createLintersCommand ( folder , sourceFile , Language . ObjC ) ;
}
public static ImmutableList < String > createObjCLintersCommandSimple (
TemporaryFolder folder ,
String sourceFile ) throws IOException , InterruptedException {
return createClangInferCommand (
folder ,
sourceFile ,
Language . ObjC ,
"linters" ,
null ,
null ,
true ,
ImmutableList . < String > of ( ) ) ;
}
public static ImmutableList < String > createObjCPPLintersCommand (
TemporaryFolder folder ,
String sourceFile ) throws IOException , InterruptedException {
return createLintersCommand ( folder , sourceFile , Language . ObjCPP ) ;
}
@Nullable
@Nullable
public static File runInferFrontend ( ImmutableList < String > inferCmd )
public static File runInferFrontend ( ImmutableList < String > inferCmd )
throws IOException , InterruptedException , InferException {
throws IOException , InterruptedException , InferException {