[LLVMdev] Target Specific Parsing API

Philip Reames listmail at philipreames.com
Mon Aug 18 09:53:24 PDT 2014


Renato,

Could you give a couple of examples where this would be useful?  I find 
myself without the context to really understand your proposal. Are we 
discussing target specific language extensions?  Assembly parsing?  
Something else entirely?

Philip

On 08/16/2014 05:43 AM, Renato Golin wrote:
> Folks,
>
> Following the discussion with Nico and others, I've created PR20683 to
> discuss about the implementation of a generic and externalised target
> specific parsing API for LLVM, Clang and others.
>
> I have a vague plan involving a generic class (say TargetParser) in
> lib/Target that is accessible as an API to any tool that needs target
> specific parsing. The idea is then to let targets implement their own
> versions of it on a generic part of the code (still lib/Target) so
> that we don't break tools if we don't build every back-end (or any
> back-end) with LLVM. Maybe this could be fixed on CMake, maybe not.
>
> This class should also allow for customization from the part of the
> tools, to either add functionality to existing functions (like
> pre-parsing, post-parsing, de-mangling etc) or adding completely new
> functions.
>
> Also, since a common side effect of parsing architectural parameters
> is to set flags in specific classes, we should expect that every tool
> will *have* to override the "updateFlags" method inside the tool
> (including LLVM's integrated assembler) to use their own
> target-specific structures.
>
> I'm hoping that this makes sense. Please let me know if there's any
> major flaw, or existing infrastructure that we could be re-using. But
> from the looks of target parsing in both LLVM and Clang, there
> isn't... :/
>
> cheers,
> --renato
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list