{"action":"opened","issue":{"url":"https://api.github.com/repos/graalvm/sulong/issues/82","repository_url":"https://api.github.com/repos/graalvm/sulong","labels_url":"https://api.github.com/repos/graalvm/sulong/issues/82/labels{/name}","comments_url":"https://api.github.com/repos/graalvm/sulong/issues/82/comments","events_url":"https://api.github.com/repos/graalvm/sulong/issues/82/events","html_url":"https://github.com/graalvm/sulong/issues/82","id":139819738,"number":82,"title":"Duplication of Compilation Logic on the mx and Java side","user":{"login":"mrigger","id":14328197,"avatar_url":"https://avatars.githubusercontent.com/u/14328197?v=3","gravatar_id":"","url":"https://api.github.com/users/mrigger","html_url":"https://github.com/mrigger","followers_url":"https://api.github.com/users/mrigger/followers","following_url":"https://api.github.com/users/mrigger/following{/other_user}","gists_url":"https://api.github.com/users/mrigger/gists{/gist_id}","starred_url":"https://api.github.com/users/mrigger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrigger/subscriptions","organizations_url":"https://api.github.com/users/mrigger/orgs","repos_url":"https://api.github.com/users/mrigger/repos","events_url":"https://api.github.com/users/mrigger/events{/privacy}","received_events_url":"https://api.github.com/users/mrigger/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/graalvm/sulong/labels/refactoring","name":"refactoring","color":"bfdadc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-10T08:26:33Z","updated_at":"2016-03-10T08:26:33Z","closed_at":null,"body":"Currently, the logic for compiling a file written in C, C++, or Fortran to LLVM IR or machine code is once on the Java side and once on the mx side. In Java, the test framework uses classes like [GCC](https://github.com/graalvm/sulong/blob/master/projects/com.oracle.truffle.llvm.tools/src/com/oracle/truffle/llvm/tools/GCC.java) and [opt](https://github.com/graalvm/sulong/blob/master/projects/com.oracle.truffle.llvm.tools/src/com/oracle/truffle/llvm/tools/Opt.java). In [mx](https://github.com/graalvm/sulong/blob/master/mx.sulong/mx_sulong.py), there are equivalent functions like `compileWithGCC` and `opt`.\r\n\r\nIt would be nice to remove this duplication of logic to easy maintenance when, e.g., adopting new versions of LLVM or GCC. It would probably be best to remove the Java part, since mx already takes care of downloading the dependencies. The Java part could then have a mx class from which the test framework can compile source files."}}