Skip to content

Commit a328278

Browse files
Adding new property for transforming all files regardless of compile status
Added transformAll property to config.properties. Also set values to temporarily lower values
1 parent 2fd18cc commit a328278

File tree

2 files changed

+21
-11
lines changed

2 files changed

+21
-11
lines changed

config.properties

+6-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ downloadDir=database
66
benchmarkDir=benchmarks
77
debugLevel=2
88
type=I
9-
minExpr=3
9+
minExpr=1
1010
minIfStmt=1
1111
minParams=0
12-
target=DEF
12+
minTypeExpr=0
13+
minTypeCond=0
14+
minTypeParams=0
15+
transformAll=true
16+
target=SPF

src/java/transform/Main.java

+15-9
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public class Main {
3737
private final static String DEFAULT_MIN_TYPE_EXPR = "3";
3838
private final static String DEFAULT_MIN_TYPE_COND = "1";
3939
private final static String DEFAULT_MIN_TYPE_PARAMS = "0";
40+
private final static String DEFAULT_TRANSFORM_ALL = "False";
4041
private final static CType DEFAULT_TYPE = CType.INT;
4142

4243
public static void main(String[] args) throws IOException {
@@ -56,6 +57,7 @@ public static void main(String[] args) throws IOException {
5657
int minTypeExpr = Integer.parseInt(DEFAULT_MIN_TYPE_EXPR);
5758
int minTypeCond = Integer.parseInt(DEFAULT_MIN_TYPE_COND);
5859
int minTypeParams = Integer.parseInt(DEFAULT_MIN_TYPE_PARAMS);
60+
boolean transformAll = Boolean.parseBoolean(DEFAULT_TRANSFORM_ALL);
5961
CType type = DEFAULT_TYPE;
6062
try {
6163
FileReader reader = new FileReader(configFile);
@@ -73,7 +75,7 @@ public static void main(String[] args) throws IOException {
7375
minTypeExpr = Integer.parseInt(props.getProperty("minTypeExpr", DEFAULT_MIN_TYPE_EXPR));
7476
minTypeCond = Integer.parseInt(props.getProperty("minTypeCond", DEFAULT_MIN_TYPE_COND));
7577
minTypeParams = Integer.parseInt(props.getProperty("minTypeParams", DEFAULT_MIN_TYPE_PARAMS));
76-
78+
transformAll = Boolean.parseBoolean(props.getProperty("transformAll", DEFAULT_TRANSFORM_ALL));
7779
} catch (IOException exp) {
7880
System.out.println("Invalid configuration file.");
7981
System.exit(1);
@@ -111,14 +113,18 @@ public static void main(String[] args) throws IOException {
111113
ArrayList<File> unsuccessfulCompiles = new ArrayList<File>();
112114
Iterator<File> file_itr = FileUtils.iterateFiles(destDir, new String[] { "java" }, true);
113115

114-
file_itr.forEachRemaining(file -> {
115-
boolean success = compile(file);
116-
if (!success) {
117-
unsuccessfulCompiles.add(file);
118-
} else {
119-
successfulCompiles.add(file);
120-
}
121-
});
116+
if (transformAll) {
117+
file_itr.forEachRemaining(file -> unsuccessfulCompiles.add(file));
118+
} else {
119+
file_itr.forEachRemaining(file -> {
120+
boolean success = compile(file);
121+
if (!success) {
122+
unsuccessfulCompiles.add(file);
123+
} else {
124+
successfulCompiles.add(file);
125+
}
126+
});
127+
}
122128

123129
System.out.println(unsuccessfulCompiles + " ------- " + successfulCompiles);
124130

0 commit comments

Comments
 (0)