<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 05/28/2012 12:42 PM, Manuel Klimek wrote:
    <blockquote
cite="mid:CAOsfVvmLkNTF7W29PXaiJmVx34dQ0f77H2xR-UW_8GboK2rbeA@mail.gmail.com"
      type="cite">
      <div class="gmail_quote">On Mon, May 28, 2012 at 12:25 PM, Arnaud
        ALLARD DE GRANDMAISON <span dir="ltr"><<a
            moz-do-not-send="true"
            href="mailto:arnaud.allarddegrandmaison@parrot.com"
            target="_blank">arnaud.allarddegrandmaison@parrot.com</a>></span>
        wrote:<br>
        <blockquote class="gmail_quote" style="margin:0 0 0
          .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Manuel,<br>
          <br>
          For your information, I started the work on point #2 :
          integrating compilation database in libclang + the
          corresponding python binding.<br>
        </blockquote>
        <div><br>
        </div>
        <div>Awesome - feel free to cc me directly to any patches you
          send out for review regarding this.</div>
        <div><br>
        </div>
        <div>Cheers,</div>
        <div>/Manuel</div>
      </div>
    </blockquote>
    <br>
    Manuel,<br>
    <br>
    Here is a preliminary patch to let you know where I stand right now
    as I will be away for a few days. It has the libclang c functions +
    python bindings to export the CompilationDatabase functionality. It
    is already usable with the python script attached.<br>
    <br>
    Feel free to make any comments before I engage further down this way.<br>
    <br>
    A few remarks / questions :<br>
    - no tests yet. For libclang, I intend to do it thru c-index-test
    and provide a 'compile_commands.json' in test/Index. The JSON syntax
    does not allow comments to be embedded inside, so I will probably
    have to add a another file to manage the c-index-test call with lit.
    For the python binding, I will enhance the attached python script.<br>
    - What is the invariant for class CompileCommand ? I understood from
    the mailing list that CommandLine[0] is the compiler executable. Are
    there any other ?<br>
    - Error management : simplistic for now. Either aborts with a
    hopefully useful message, or return a value which the caller is
    expected to interpret correctly. Any thoughts on this ?<br>
    - (not related to this patch) Would it make sense for CompileCommand
    to provide a higher level interface for the CommandLine (at the C++
    level). As a user of the CommandLine for a CompileCommand, I would
    have expected an easy way to access easily (and separately) some
    important parts of it : executable name (ok, that's the first
    argument), input file and output file. This capture the fact that a
    CommandLine is $(compiler) $(bunch_of_args) -o $(output) $(input)
    and enable user to adapt to $(compiler) or mangle $(output) /
    $(input) depending on the application's needs.<br>
    <br>
    Cheers,<br>
    <pre class="moz-signature" cols="72">-- 
Arnaud de Grandmaison
</pre>
  </body>
</html>