[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:12:02 PDT 2018


dschuff added inline comments.


================
Comment at: lib/CodeGen/CGCall.cpp:1849
+      if (!AttrOnCallSite && !Fn->hasPrototype())
+        FuncAttrs.addAttribute("no-prototype");
       AddAttributesFromFunctionProtoType(
----------------
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.


Repository:
  rC Clang

https://reviews.llvm.org/D48443





More information about the cfe-commits mailing list