- yreflect has the objective to extract memory layout of variables
- yextractmp has the objective of extracing the OpenMP statements
Tested clangs: 3.5 3.7 3.9 under OSX (for OpenMP clang 3.7+ is needed)
cmake .. -DLLVM_CONFIG=/opt/local/bin/llvm-config-mp-3.5
cmake .. -DLLVM_CONFIG=/opt/local/bin/llvm-config-mp-3.7
cmake .. -DLLVM_CONFIG=/opt/local/bin/llvm-config-mp-3.9
port installed | grep clang port search clang | grep clang- port install clang-3.9
For the example test.cpp produces:
result: created 4 types record n:Pippo q:cff::Pippo s:84 sub: array n: q: s:20 sub: enum n:PippoEnum q:cff::Pippo::PippoEnum s:0 sub: record n:Pippo2 q:cff::Pippo::Pippo2 s:4 sub:
./yextractmp ../example/testmp.cpp --
OMPTaskwaitDirectiveClass - omptaskwait OMPTaskyieldDirectiveClass - omptaskyield OMPTaskgroupDirectiveClass - omptaskgroup OMPTaskLoopDirectiveClass - omptaskloop OMPTaskDirectiveClass - omptask OMPSingleDirectiveClass - ompsingle OMPSectionDirectiveClass - ompsection OMPSectionsDirectiveClass - ompsections OMPParallelForDirectiveClass - ompparallelfor OMPParallelDirectiveClass - ompparallel
The following pubblication is associated to the work discussed here. In particular the SOMA framework was aimed at static multicore partioning of the execution of multicore algorithms.
Ruffaldi E., Dabisias G., Brizzi F. & Buttazzo G. (2016). SOMA: An OpenMP Toolchain For Multicore Partitioning. In 31st ACM/SIGAPP Symposium on Applied Computing . ACM.
-
clreflection https://github.com/rpav/c2ffi Running c2ffi on this, we can get the following JSON output:
Template support is limited to instantiated templates (including both classes/structs/unions and functions). c2ffi can output a new .hpp file using the -T parameter with explicit instantiations for those it finds declared but not instantiated. E.g.,
-
lldb dump
-
libclang