[cfe-dev] clang-query cache?
Manuel Klimek
klimek at google.com
Sat Aug 1 23:34:25 PDT 2015
+pcc
On Sat, Aug 1, 2015 at 7:14 PM rzaghi at mosaic3dx.com <rzaghi at mosaic3dx.com>
wrote:
> Hey
>
>
> I've tried and it works really well actually [image: 😊]
>
>
> You can pass many source files to clang-query and it takes a while the
> first time to parse and build the AST.
>
>
> But once it's saved the AST, the next time you can get to clang-query
> prompt almost instantly which is what I wanted.
>
>
> I never submitted any patches so will do this as my first one in the next
> few days.
>
Cool!
>
> Any suggestions on what command line option to add to clang-query? May be
> "--save-ast" or something similar?
>
We can bikeshed that on the code review :)
>
>
> -Ramin
>
>
>
> ------------------------------
> *From:* Nikola Smiljanic <popizdeh at gmail.com>
> *Sent:* 27 July 2015 11:48
> *To:* rzaghi at mosaic3dx.com
> *Cc:* Manuel Klimek; cfe-dev at cs.uiuc.edu
>
> *Subject:* Re: [cfe-dev] clang-query cache?
> Yes, have a look at ASTReader and ASTWriter.
>
> On Mon, Jul 27, 2015 at 8:46 PM, rzaghi at mosaic3dx.com <
> rzaghi at mosaic3dx.com> wrote:
>
>> Correct. I want the AST to be stored on disk.
>>
>> I am not as familiar with the datastructure but if the classes provide a
>> means of serialzsing and deserializing then I would imagine I can get it
>> done in a couple weeks myself?
>>
>> Is there any such functionality in the node classes?
>>
>> R.
>> ------------------------------
>> *From:* Manuel Klimek <klimek at google.com>
>> *Sent:* 27 July 2015 10:50:09
>> *To:* Nikola Smiljanic
>> *Cc:* rzaghi at mosaic3dx.com; cfe-dev at cs.uiuc.edu
>> *Subject:* Re: [cfe-dev] clang-query cache?
>>
>> So, that would mean storing ASTs on disk and then loading them instead of
>> parsing the files. That would sound like a reasonable enough feature to
>> implement, if somebody is up for it.
>>
>> On Mon, Jul 27, 2015 at 10:48 AM Nikola Smiljanic <popizdeh at gmail.com>
>> wrote:
>>
>>> If I understand correctly he wants to run it over entire codebase as
>>> opposed to feed each file individually.
>>>
>>> On Mon, Jul 27, 2015 at 3:32 PM, Manuel Klimek <klimek at google.com>
>>> wrote:
>>>
>>>> Well, it depends. If you have certain kinds of queries you want to
>>>> repeat, there are projects like kythe [1]. Otherwise, clang-query allows
>>>> you to match the whole AST, so I'm not sure what you'd want to cache. Do
>>>> you want to cache sub-queries that do not change?
>>>>
>>>> [1] https://github.com/google/kythe
>>>> <https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_google_kythe&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=RGEB26MVTqKGZXxvcZqaaRMp_fkvS93UH30yi2rx0bw&s=wVSUYuH6Xq1DgjTf64kuojS4d58RPqCzAUDP_xapim4&e=>
>>>>
>>>
>>>> On Sat, Jul 25, 2015 at 3:45 PM rzaghi at mosaic3dx.com <
>>>> rzaghi at mosaic3dx.com> wrote:
>>>>
>>>>> Is it possible to cache clang-query results so I don't need to run it
>>>>> for every file in a project evertime?
>>>>>
>>>>> - Ramin
>>>>>
>>>>> _______________________________________________
>>>>> cfe-dev mailing list
>>>>> cfe-dev at cs.uiuc.edu
>>>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>>>>
>>>>
>>>> _______________________________________________
>>>> cfe-dev mailing list
>>>> cfe-dev at cs.uiuc.edu
>>>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>>>
>>>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150802/4515df90/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OutlookEmoji-😊.png
Type: image/png
Size: 488 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150802/4515df90/attachment.png>
More information about the cfe-dev
mailing list