[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:03:34 PST 2016
jlebar updated this revision to Diff 45804.
jlebar added a comment.
Die during doInitialization instead of doFinalization.
http://reviews.llvm.org/D16490
Files:
lib/Target/NVPTX/NVPTXAsmPrinter.cpp
test/CodeGen/NVPTX/alias.ll
Index: test/CodeGen/NVPTX/alias.ll
===================================================================
--- /dev/null
+++ 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
Index: lib/Target/NVPTX/NVPTXAsmPrinter.cpp
===================================================================
--- lib/Target/NVPTX/NVPTXAsmPrinter.cpp
+++ 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);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16490.45804.patch
Type: text/x-patch
Size: 940 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160123/ee1cdeeb/attachment.bin>
More information about the llvm-commits
mailing list