[PATCH] D16490: [CUDA] Die gracefully when trying to output an LLVM alias.

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 23 13:16:26 PST 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL258638: [CUDA] Die gracefully when trying to output an LLVM alias. (authored by jlebar).

Changed prior to commit:
  http://reviews.llvm.org/D16490?vs=45804&id=45806#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D16490

Files:
  llvm/trunk/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
  llvm/trunk/test/CodeGen/NVPTX/alias.ll

Index: llvm/trunk/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
===================================================================
--- llvm/trunk/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
+++ llvm/trunk/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
@@ -812,6 +812,11 @@
   const NVPTXTargetMachine &NTM = static_cast<const NVPTXTargetMachine &>(TM);
   const NVPTXSubtarget STI(TT, CPU, FS, NTM);
 
+  if (M.alias_size()) {
+    report_fatal_error("Module has aliases, which NVPTX does not support.");
+    return true; // error
+  }
+
   SmallString<128> Str1;
   raw_svector_ostream OS1(Str1);
 
Index: llvm/trunk/test/CodeGen/NVPTX/alias.ll
===================================================================
--- llvm/trunk/test/CodeGen/NVPTX/alias.ll
+++ llvm/trunk/test/CodeGen/NVPTX/alias.ll
@@ -0,0 +1,7 @@
+; RUN: not llc < %s -march=nvptx -mcpu=sm_20 2>&1 | FileCheck %s
+
+; Check that llc dies gracefully when given an alias.
+
+define i32 @a() { ret i32 0 }
+; CHECK: ERROR: Module has aliases
+ at b = internal alias i32 (), i32 ()* @a


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16490.45806.patch
Type: text/x-patch
Size: 1024 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160123/cd0ba00b/attachment.bin>


More information about the llvm-commits mailing list