[cfe-dev] How to implement new pragma within clang

Richard Smith via cfe-dev cfe-dev at lists.llvm.org
Mon Jun 26 12:30:06 PDT 2017


On 26 June 2017 at 09:25, Zbigniew Sarbinowski via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

>
> Hello,
>
> I'm trying to fix, redesign, current implementation of the following
> pragma.
>
> #pragma map(identifier, "new name")
>
> The pragma can appear before or after 'identifier' is defined.
> The current implementation works only on simple identifiers in global
> scope.
>
> I need to fix the cases when 'identifier' is a nested specifier. For
> example:
> ::i or ns::i, where ns is a namespace or a class. The 'identifier' can be
> an object or function with external linkage. It can also be a function with
>  optionally specified parameters to distinguish overloaded functions.
>
> The 'identifier' should be lookup first at the point of the pragma and if
> not resolved once again at the end of compilation and let the back-end know
> its new name.
>
> Are there any similar pragmas which can help me out? Any advice you can
> offer is appreciated.
>

This sounds quite similar to the existing "#pragma redefine_extname"
(except for the C++ support); you could look at that for inspiration.


> Regards, ______________________________________
> Zbigniew Sarbinowski (Zibi) C++ FE development
> IBM z Systems Software, IBM Systems Unit
> 8200 Warden Ave. Markham ON, L6G 1C7
> C2/712/8200/MKM Tel: 905-413-6071 <(905)%20413-6071>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170626/102e6098/attachment.html>


More information about the cfe-dev mailing list