Skip to content

Commit

Permalink
Added hacks around too aggressive inlining
Browse files Browse the repository at this point in the history
  • Loading branch information
leventeBajczi committed Jul 23, 2023
1 parent 98601e4 commit c61d04b
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ public static XCFA fromFile(File model, ArithmeticType arithmeticType) throws IO

if (!model.exists()) throw new FileNotFoundException();

if (model.getName().endsWith(".ll") || model.getName().endsWith(".bc")) {
if (model.getName().endsWith("ll") || model.getName().endsWith("bc")) {
return createXCFA(new LlvmIrProvider(model.getAbsolutePath()), arithmeticType);

} else if (model.getName().endsWith(".c") || model.getName().endsWith(".i")) {
} else if (model.getName().endsWith("c") || model.getName().endsWith("i")) {
return createXCFA(new LlvmIrProvider(model.getAbsolutePath(), true, true, true, true), arithmeticType);

} else {
Expand Down Expand Up @@ -106,6 +106,7 @@ else if(arithmeticType == ArithmeticType.efficient) {
GlobalState globalState = new GlobalState(ssa, arithmeticType);

for (Tuple3<String, Optional<String>, List<Tuple2<String, String>>> function : ssa.getFunctions()) {
if(function.get1().equals("reach_error")) continue;
FunctionState functionState = new FunctionState(globalState, function);

for (String block : ssa.getBlocks(function.get1())) {
Expand Down Expand Up @@ -136,6 +137,13 @@ else if(arithmeticType == ArithmeticType.efficient) {
System.exit(-80);
}

builtState.getProcedures().forEach((s, builder) -> {
if(builder.getErrorLoc() == null) {
System.err.println("Frontend failed");
System.exit(-80);
}
});

final XCFA.Builder builder = globalState.getBuilder();

return new XCFA(builder.getGlobalVars(),
Expand Down

0 comments on commit c61d04b

Please sign in to comment.