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.
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
Hi,
take a look at the PragmaHandler class. You can find an example here:
https://clang.llvm.org/docs/ClangPlugins.html
Marcel
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.