[cfe-dev] What is starting point to extend clang RTTI features ?

David Wiberg via cfe-dev cfe-dev at lists.llvm.org
Fri Dec 29 02:12:27 PST 2017


2017-12-28 22:51 GMT+01:00 mohsen via cfe-dev <cfe-dev at lists.llvm.org>:
> On Thu, 28 Dec 2017 14:17:10 +0330
> mohsen <mohsen.timar at gmail.com> wrote:
>
>> Hi
>>
>> I am working on many projects that's need RTTI for implementation; for
>> example JSON reader, writer, Database library, RESTFul and so on.
>>

Hello,

I think it would be good if you can expand the description of your
use-case a bit to help people understand what you are looking for and
why.

Are the projects you mention C++ projects? If so, can you explain why
you can't use the normal C++ RTTI support?

Best regards
David

>> For that cases I use another languages like pascal and sometimes
>> script languages like PHP.
>>
>> Now, I want to extend clang compiler RTTI to use it for that cases but
>> can't find starting point.
>>
>> Please help me to find best starting point.
>>
>
> For first try to implement RTTI, I create a plugin to visit AST nodes
> and extract functions and classes methods info to generate a header file
> based on AST nodes, This header contain a map from a function/method
> signature in string to pointer of that.
>
> To complete my idea , I need help to solve two problem :
>
> 1- How to get pointer of overloaded methods and functions ?
>
> An example:
>
> template<typename T>
> T sum(T a,T b) {
>         return a + b;
> }
>
> int main(int argc, char const *argv[])
> {
>         sum(1,2);
>         sum(1.0,2.0);
>         return 0;
> }
>
> function extraction result is :
>
> main (int argc, const char ** argv )
> sum (int a, int b )
> sum (double a, double b )
>
>
> 2- If a project contain more than one file how to generate a header for
> all files ?
>
> --
> Regards,
> Mohsen Timar
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


More information about the cfe-dev mailing list