[PATCH] D48443: [WIP] Add no-prototype attribute to prototype-less C functions

Derek Schuff via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 21 15:15:59 PDT 2018


dschuff added inline comments.


================
Comment at: lib/CodeGen/CGCall.cpp:1849
+      if (!AttrOnCallSite && !Fn->hasPrototype())
+        FuncAttrs.addAttribute("no-prototype");
       AddAttributesFromFunctionProtoType(
----------------
dschuff wrote:
> aheejin wrote:
> > Is there a reason why this is not something like `llvm::Attribute::NoPrototype` like other attributes?
> Target-independent attributes get enums, and target-specific attributes are just strings: https://llvm.org/docs/LangRef.html#attribute-groups 
> We could potentially make this attribute target-independent if there is wider interest in removing the reliance on bare `(...)` signatures to signify prototypeless C functions. I would like to see more details of how we plan to handle this in the backend before I have any idea about what anyone else might thing.
Actually, I just noticed that we don't appear to have made this actually target-dependent (the test uses X86). So we should either make this attribute actually wasm-only, or make it an enum.


Repository:
  rC Clang

https://reviews.llvm.org/D48443





More information about the cfe-commits mailing list