aaron.ballman added inline comments.

================
Comment at: clang/lib/CodeGen/CGCall.cpp:2050-2066
+static bool IsArgumentMayBeUndef(const Decl *TargetDecl, unsigned ArgNo) {
+  if (!TargetDecl)
+    return false;
+
+  bool ArgHasMayBeUndefAttr = false;
+  if (TargetDecl) {
+    if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(TargetDecl)) {
----------------
skc7 wrote:
> aaron.ballman wrote:
> > One question I have is whether you ever need to mark the variadic arguments 
> > as being maybe undef. e.g., `void func(int i, ...);` do you need to signal 
> > that arguments passed to `...` are maybe undef?
> > 
> Current change assumes variadic arguments will not have "maybe_undef" 
> attribute. If its a function attribute, variadic arguments can inherit them 
> (Have seen such cases in clang codebase). But "maybe_undef" is function 
> argument attribute and I'm not sure on how to add it to variadic arguments.
> Current change assumes variadic arguments will not have "maybe_undef" 
> attribute. If its a function attribute, variadic arguments can inherit them 
> (Have seen such cases in clang codebase). But "maybe_undef" is function 
> argument attribute and I'm not sure on how to add it to variadic arguments.

That's why I was asking if there will be a need either now or in the future -- 
is making this a parameter attribute the right design, or should this be a 
function attribute with positional arguments? (Not that I particularly love 
that design, but this isn't a user-facing attribute so if it's hard to use, I'm 
not that worried. I just want to make sure we don't need to add additional 
attributes in the future in this same space.)


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

https://reviews.llvm.org/D130224

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to