Skip to content

Commit 9b582a4

Browse files
committed
only run llvm-extract if we have to
1 parent eb6e0ed commit 9b582a4

File tree

1 file changed

+9
-4
lines changed
  • graalpython/com.oracle.graal.python.shell/src/com/oracle/graal/python/shell

1 file changed

+9
-4
lines changed

graalpython/com.oracle.graal.python.shell/src/com/oracle/graal/python/shell/GraalPythonLD.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,19 +265,24 @@ private Collection<? extends String> arMembers(String path) throws IOException,
265265
nmProc.waitFor();
266266

267267
ArrayList<String> extractCmd = new ArrayList<>();
268+
HashSet<String> droppedDefinitions = new HashSet<>(definedHere);
268269
extractCmd.add("llvm-extract");
269270
for (String def : definedHere) {
270271
if (!definedSymbols.contains(def)) {
271272
definedSymbols.add(def);
272273
undefinedSymbols.remove(def);
274+
droppedDefinitions.remove(def);
273275
extractCmd.add("-func");
274276
extractCmd.add(def);
275277
}
276278
}
277-
extractCmd.add(f);
278-
extractCmd.add("-o");
279-
extractCmd.add(f);
280-
exec(extractCmd);
279+
if (!droppedDefinitions.isEmpty()) {
280+
// only run the extractor if we actually need to drop something
281+
extractCmd.add(f);
282+
extractCmd.add("-o");
283+
extractCmd.add(f);
284+
exec(extractCmd);
285+
}
281286
}
282287
}
283288

0 commit comments

Comments
 (0)