[PATCH] D69389: [hip] Allow the declaration of functions with variadic arguments in HIP.

Michael Liao via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 24 12:48:26 PDT 2019


hliao marked an inline comment as done.
hliao added inline comments.


================
Comment at: clang/lib/CodeGen/TargetInfo.cpp:7764
+                                 QualType Ty) const {
+  llvm_unreachable("AMDGPU does not support varargs");
+}
----------------
tra wrote:
> llvm_unreachable() should be used to indicate an error in compiler's own code, not in the user code that we're compiling. 
> 
> I think what you need to do is to issue a postponed diagnostics in Sema where we're currently checking for varargs functions and materialize them if we attempt to codegen such function.
this is just a stub to assert that there won't be codegen for va_arg. the real diagnosing is @ lib/Sema/SemaExpr.cpp around L14438. I just want to add an assertion to capture them if anything goes wrong. Error on `va_arg` use is already there for a while.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69389





More information about the cfe-commits mailing list