[llvm-dev] Does LLVM accept using python to generate files (*.td, *.inc) in compiler build process?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] Does LLVM accept using python to generate files (*.td, *.inc) in compiler build process?

shirley breuer via cfe-dev
Hi all,

In our downstream clang build process, we use python script to generate Builtins*.td, *.BuiltinCodegen.inc and C header. (it's similar to https://repo.hca.bsc.es/gitlab/rferrer/llvm-epi/-/blob/EPI/clang/include/clang/Basic/CMakeLists.txt#L97-110)

It's a different way like ARM did (create a new option in clang-tblgen (C++ code) and generate corresponding files.)

We are planning to upstream this part and wondering if it's necessary to rewrite generator with C++ code.

--
Best regards,
Kuan-Hsu



_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Does LLVM accept using python to generate files (*.td, *.inc) in compiler build process?

shirley breuer via cfe-dev
It seems that you can write a custom TableGen backend (https://llvm.org/docs/TableGen/BackGuide.html ) to achieve your task. I don’t think LLVM/Clang accepts or has any plan using python script to generate header files from TG files.

Also, can you elaborate why existing TG backends, especially those used for generating builtins, can’t solve your problems? Is it possible to adapt your .td files to leverage existing TG backends?

-Min
On Jan 3, 2021, at 10:47 PM, Zakk via llvm-dev <[hidden email]> wrote:

Hi all,

In our downstream clang build process, we use python script to generate Builtins*.td, *.BuiltinCodegen.inc and C header. (it's similar to https://repo.hca.bsc.es/gitlab/rferrer/llvm-epi/-/blob/EPI/clang/include/clang/Basic/CMakeLists.txt#L97-110)

It's a different way like ARM did (create a new option in clang-tblgen (C++ code) and generate corresponding files.)

We are planning to upstream this part and wondering if it's necessary to rewrite generator with C++ code.

--
Best regards,
Kuan-Hsu


_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] Does LLVM accept using python to generate files (*.td, *.inc) in compiler build process?

shirley breuer via cfe-dev


Min-Yih Hsu <[hidden email]> 於 2021年1月4日 週一 下午3:03寫道:
It seems that you can write a custom TableGen backend (https://llvm.org/docs/TableGen/BackGuide.html ) to achieve your task. I don’t think LLVM/Clang accepts or has any plan using python script to generate header files from TG files.

 
Yes, I think my work can be handled in custom TableGen backend.  

Also, can you elaborate why existing TG backends, especially those used for generating builtins, can’t solve your problems? Is it possible to adapt your .td files to leverage existing TG backends?

 
I agree with your opinion. It makes sense to me.
I'm asking that just because we only have python solution now.

Thanks for your opinion.
 
-Min
On Jan 3, 2021, at 10:47 PM, Zakk via llvm-dev <[hidden email]> wrote:

Hi all,

In our downstream clang build process, we use python script to generate Builtins*.td, *.BuiltinCodegen.inc and C header. (it's similar to https://repo.hca.bsc.es/gitlab/rferrer/llvm-epi/-/blob/EPI/clang/include/clang/Basic/CMakeLists.txt#L97-110)

It's a different way like ARM did (create a new option in clang-tblgen (C++ code) and generate corresponding files.)

We are planning to upstream this part and wondering if it's necessary to rewrite generator with C++ code.

--
Best regards,
Kuan-Hsu


_______________________________________________
LLVM Developers mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



--
Best regards,
Kuan-Hsu



_______________________________________________
cfe-dev mailing list
[hidden email]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev