[aspectc-user] how to match line with AspectC (ex : loop "for")

BACCARI med emir med.emir.baccari at gmail.com
Mon Mar 9 11:18:39 CET 2009


Hi,

Thanks for your response, but in my work I wish to match "For" loops to
convert parallelisation form automatically, and it will be so good if I can
match Openmp directive like :
"#pragma omp for ... "

Best regards
Emir

2009/3/9 Stefan Marr <aspectc at stefan-marr.de>

> Hi,
>
> an advice directly on a specific language construct is not possible as far
> as I know.
>
> But if I read the language reference correctly, you might give "within()" a
> try. Actually, its only a guess on what you like to achieve.
>
> You cannot capture all similar loops with this, but at least you will be
> able to advice fct() if it is in the lexical body of somefunction()
>
> void somefunction() {
>        for(i=0;i<count;i++) { fct(); }
> }
>
> advice call("% fct()") && within("void somefunction()") : around() {
>        // this is similar to cflow, but matches hopefully
>        // only on calls lexically in the body of somefunction()
> }
>
> Totally unrelated:
>
> Is there a way to match macros?
>
> In the Lua VM there is a handy macro:
> #define GET_OPCODE(i)   (cast(OpCode, ((i)>>POS_OP) & MASK1(SIZE_OP,0)))
>
> and for profiling it would be great if I could write an advice like this:
>
> advice call("% GET_OPCODE(...)") && within("void luaV_execute (lua_State*,
> int)") && args(Instruction)
> : before(Instruction i) {
>        Profiler_add_bytecode(i);
> }
>
> Best regards
> Stefan
>
>
>
>
>>
> On 09 Mar 2009, at 10:06, BACCARI med emir wrote:
>
>  Hello,
>>
>> I want to match the execution of loop for like the code bellow in a C
>> implementation :
>> for(i=0;i<count;i++)
>>      { fct(); }
>> but I think that aspectC allow me to match only executions of functions :(
>> If it's possible to capture different line in my code with joinpoint,
>> please tell me how can I do it.
>> Thanks.
>>
>> Best Regards.
>>
>>
>> _______________________________________________
>> aspectc-user mailing list
>> aspectc-user at aspectc.org
>> http://www.aspectc.org/mailman/listinfo/aspectc-user
>>
>
> --
> Stefan Marr
> Programming Technology Lab
> Vrije Universiteit Brussel
> Pleinlaan 2 / B-1050 Brussels / Belgium
> http://prog.vub.ac.be/~smarr <http://prog.vub.ac.be/%7Esmarr>
>
>


-- 
Mohamed Emir BACCARI
Stagiare en mastere de recherche informatique
(TELECOM & Management SudParis)
e-mail : mohamed_emir.baccari at it-sudparis.eu
tel      : 00 33 6 69 96 77 47
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.aspectc.org/pipermail/aspectc-user/attachments/20090309/03dc4142/attachment.html>


More information about the aspectc-user mailing list