summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorYaxun (Sam) Liu <yaxun.liu@amd.com>2015-10-29 14:03:36 -0400
committerYaxun (Sam) Liu <yaxun.liu@amd.com>2015-10-29 14:03:36 -0400
commit51715a27da7e9c30035de816cd45f2b91286c7fc (patch)
tree34e5593e479d97c5fc12d9adae2eb08a3905d95f /tools
parent1361c6ce1182a0d8bc50d794f9f9a15787e8fd3a (diff)
[SPIRV] Allow functions for extended instructions to have postfixes for decoration.
Add prefix for return type for vload/vloada since function type can differ by only return type. Set ouputing stack trace on error.
Diffstat (limited to 'tools')
-rw-r--r--tools/llvm-spirv/llvm-spirv.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/llvm-spirv/llvm-spirv.cpp b/tools/llvm-spirv/llvm-spirv.cpp
index b491c8a..604e268 100644
--- a/tools/llvm-spirv/llvm-spirv.cpp
+++ b/tools/llvm-spirv/llvm-spirv.cpp
@@ -53,7 +53,9 @@
#include "llvm/Support/DataStream.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/Signals.h"
#include "llvm/Support/ToolOutputFile.h"
#ifndef _SPIRV_SUPPORT_TEXT_FMT
@@ -125,7 +127,7 @@ convertLLVMToSPIRV() {
errs() << "Fails to load bitcode: " << EC.message();
return -1;
}
-
+
std::unique_ptr<Module> M = std::move(*MOrErr);
if (std::error_code EC = M->materializeAllPermanently()){
@@ -241,7 +243,7 @@ regularizeLLVM() {
errs() << "Fails to load bitcode: " << EC.message();
return -1;
}
-
+
std::unique_ptr<Module> M = std::move(*MOrErr);
if (std::error_code EC = M->materializeAllPermanently()){
@@ -277,6 +279,10 @@ regularizeLLVM() {
int
main(int ac, char** av) {
cl::ParseCommandLineOptions(ac, av, "LLVM/SPIR-V translator");
+#ifndef NDEBUG
+ EnablePrettyStackTrace();
+ sys::PrintStackTraceOnErrorSignal();
+#endif
#ifdef _SPIRV_SUPPORT_TEXT_FMT
if (ToText && (ToBinary || IsReverse || IsRegularization)) {