[libc-commits] [PATCH] D84848: [libc] Add a tool called WrapperGen.

Alex Brachet via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Jul 29 09:34:54 PDT 2020


abrachet added a comment.

This looks good. I wonder though how we will deal with global variables. Those can't be easily wrapped like functions can.



================
Comment at: libc/utils/tools/WrapperGen/Main.cpp:19-21
+llvm::cl::opt<std::string>
+    FunctionName("name", llvm::cl::desc("Name of the function to be wrapped."),
+                 llvm::cl::value_desc("<function name>"), llvm::cl::Required);
----------------
How do you imagine we will invoke this tool? Our list of function names is in TableGen so it wouldn't be easy to run this over every function name. Will this be called from `add_entrypoint_object` then?


================
Comment at: libc/utils/tools/WrapperGen/Main.cpp:58
+
+  // TODO: Arg types of the C++ implementation functions need not
+  // match the standard types. Either handle such differences here, or
----------------
I think this should be fine because all we care about it ABI compatibility, and we're only including the src/ headers not the include/ ones so the compiler wont complain there.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84848/new/

https://reviews.llvm.org/D84848



More information about the libc-commits mailing list