[cfe-dev] Mutable AST -- Advice Needed --

steveneliuk s.eliuk at samsung.com
Tue May 28 10:57:19 PDT 2013


The WebCL Working Group (WG) is requesting input from experienced Clang/LLVM
developers and contributors concerning AST mutation. 

A little background, 

WebCL exposes parallel processing to the web. Specifically, WebCL allows web
applications to utilize GPU\s and multi-core CPU\s directly from the
web-browser. This is about the least verbose description I could produce,
more information can be found through the following  link
<http://www.khronos.org/webcl/>  .

There is a tight relationship between WebCL and OpenCL because WebCL employs
/orchestrated/ OpenCL-kernels to enable parallel processing on parallel
devices. The /orchestrated/ kernels provide a level of security/projection
that is not inherent/needed in OpenCL.

Typically, a web-developer produces a kernel and WebCL uses a Validator to
/orchestrate/ the kernel. The validator performs various checks such as
memory initialization, validity of pointers, static/dynamic analysis, etc
and outputs the new kernel that is web-safe.

One of the proposed directions of development is based on Clang, and going
against the grain, with a mutable AST. We understand the AST in Clang is
fundamentally treated as immutable and we respect this design choice. The
goal of the WebCL Validator does not rely on a later stage coupling with
LLVM or later stages of compilation where the modified AST could become

Given the above information, could those with experience and expertise
please provide feedback on the proposed implementation? We are curious the
pitfalls of modifying the AST. Eventually, if the code is stable and meets
the requirements of Clang we would like to upstream/contribute the code, but
this would be in the distant future.

There is a bug open concerning the WebCL Validator development effort that
can be accessed through the following  link
<https://www.khronos.org/bugzilla/show_bug.cgi?id=875>  ,

Thank you on behalf of the WebCL WG for considering our request,

Kindest Regards,

View this message in context: http://clang-developers.42468.n3.nabble.com/Mutable-AST-Advice-Needed-tp4032339.html
Sent from the Clang Developers mailing list archive at Nabble.com.

More information about the cfe-dev mailing list