Commit Graph

6 Commits

Author SHA1 Message Date
Siva Chandra Reddy bf03eba1f9 [libc] Refactor WrapperGen to make the flow cleaner.
Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D93417
2020-12-17 08:56:45 -08:00
Siva Chandra Reddy 9ab6c1a99f [libc] Let wrappergen pick LLVM libc mangled name from aliasee file.
Along the way, made a change to run tool unittests when the target
"check-libc" is run by introducing a libc testsuite for tool unittests.

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D93142
2020-12-11 14:33:03 -08:00
Siva Chandra Reddy d50149b42e [libc] Extend WrapperGen to emit aliases.
Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D90985
2020-11-06 16:12:10 -08:00
Siva Chandra Reddy 573ade4bef [libc][WrapperGen] Replace the C _Noreturn annotation with C++ [[noreturn]].
Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D90900
2020-11-06 11:37:48 -08:00
Michael Jones 5c801de13c [libc] Fix WrapperGen seeing no arguments as a void argument.
This corrects WrapperGen generating incorrect wrappers for functions
that take no arguments. Previously it would generate a wrapper with a
single argument of type `void`.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D90800
2020-11-05 19:13:37 +00:00
Siva Chandra Reddy a32af8252f [libc] Add a tool called WrapperGen.
This tool will be used to generate C wrappers for the C++ LLVM libc
implementations. This change does not hook this tool up to anything yet.
However, it can be useful for cases where one does not want to run the
objcopy step (to insert the C symbol in the object file) but can make use
of LTO to eliminate the cost of the additional wrapper call. This can be
relevant for certain downstream platforms. If this tool can benefit other
libc platforms in general, then it can be integrated into the build system
with options to use or not use the wrappers. An example of such a
platform is CUDA.

Reviewed By: abrachet

Differential Revision: https://reviews.llvm.org/D84848
2020-07-30 16:07:26 -07:00