[PATCH] D16512: [CUDA] Make empty parameter lists in nvptx function decls easier to read.
Justin Lebar via llvm-commits
llvm-commits at lists.llvm.org
Sat Jan 23 11:28:30 PST 2016
jlebar created this revision.
jlebar added a reviewer: tra.
jlebar added subscribers: echristo, jhen, llvm-commits.
Herald added a subscriber: jholewinski.
Before:
.func (.param .b32 func_retval0) _ZL21__nvvm_reflect_anchorv(
)
{
After:
.func (.param .b32 func_retval0) _ZL21__nvvm_reflect_anchorv()
{
http://reviews.llvm.org/D16512
Files:
lib/Target/NVPTX/NVPTXAsmPrinter.cpp
Index: lib/Target/NVPTX/NVPTXAsmPrinter.cpp
===================================================================
--- lib/Target/NVPTX/NVPTXAsmPrinter.cpp
+++ lib/Target/NVPTX/NVPTXAsmPrinter.cpp
@@ -1436,6 +1436,11 @@
bool isABI = (nvptxSubtarget->getSmVersion() >= 20);
MVT thePointerTy = TLI->getPointerTy(DL);
+ if (!F->arg_size()) {
+ O << "()\n";
+ return;
+ }
+
O << "(\n";
for (I = F->arg_begin(), E = F->arg_end(); I != E; ++I, paramIndex++) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16512.45798.patch
Type: text/x-patch
Size: 475 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160123/9dcc2b6e/attachment.bin>
More information about the llvm-commits
mailing list