Add support for OpenMP pragmas using code attributes
Submitted by Adrià Arrufat
Link to original bug (#777452)
Description
As discussed on IRC, it would be an interesting addition for Vala to support some OpenMP directives in order to be able to parallellise simple loops.
One should be able to put [CCode (openmp = "#pragma omp parallel for")] or [CCode (pragma = "omp parallel for")] or [OpenMP (pragma = "parallel for")] for instance, immediately before a for loop in Vala, and the code generator would just have to place #pragma omp parallel for before the loop in C.
Then, one should build with -X -fopenmp to enable OpenMP (very much like -X -lm when using Math)
That would be an easy way for developers using Vala to parallelise their for loops without worrying about threads.
Maybe if the idea takes of, more advanced features for OpenMP could be supported.
Thanks in advance.