[libc-commits] [PATCH] D94195: [libc] Switch to use a macro which does not insert a section for every libc function.

Roland McGrath via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Jan 7 16:26:09 PST 2021


mcgrathr added inline comments.


================
Comment at: libc/src/__support/common.h.def:20
+#define LLVM_LIBC_FUNCTION(type, name, arglist) \
+  type name arglist; \
+  decltype(name) __##name##_impl__ __asm__(#name); \
----------------
michaelrj wrote:
> mcgrathr wrote:
> > I'd argue for leaving this decl out just to enforce that you only use this when you've included the public API header that declares the public name.
> We don't always include the corresponding `.h` file so we don't always have the namespace-scoped name available to use with decltype. That is why I have added this declaration.
It is dangerously wrong to define the public API function without its public API declaration in scope.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94195



More information about the libc-commits mailing list