From d4a77e1b44392f232728ccbbe29b36189216305e Mon Sep 17 00:00:00 2001 From: evghenii Date: Tue, 27 Jan 2015 07:02:12 +0100 Subject: [PATCH] changed function mangling to be compatible with NVVM in CUDA7 --- Makefile | 2 +- type.cpp | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index f04bc3de..a3ab7f64 100644 --- a/Makefile +++ b/Makefile @@ -75,7 +75,7 @@ ARM_ENABLED=0 # Disable NVPTX by request # To enable: make NVPTX_ENABLED=1 -NVPTX_ENABLED=0 +NVPTX_ENABLED=1 # Add llvm bin to the path so any scripts run will go to the right llvm-config LLVM_BIN= $(shell $(LLVM_CONFIG) --bindir) diff --git a/type.cpp b/type.cpp index d142d92c..d03e3dbe 100644 --- a/type.cpp +++ b/type.cpp @@ -759,7 +759,8 @@ EnumType::Mangle() const { std::string ret; if (isConst) ret += "C"; ret += variability.MangleString(); - ret += std::string("enum[") + name + std::string("]"); +// ret += std::string("enum[") + name + std::string("]"); + ret += std::string("enum_5B_") + name + std::string("_5D_"); return ret; } @@ -1448,7 +1449,8 @@ ArrayType::Mangle() const { sprintf(buf, "%d", numElements); else buf[0] = '\0'; - return s + "[" + buf + "]"; +// return s + "[" + buf + "]"; + return s + "_5B_" + buf + "_5D_"; } @@ -2123,12 +2125,14 @@ lMangleStruct(Variability variability, bool isConst, const std::string &name) { Assert(variability != Variability::Unbound); std::string ret; - ret += "s["; +// ret += "s["; + ret += "s_5B_"; if (isConst) ret += "_c_"; ret += variability.MangleString(); - ret += name + std::string("]"); +// ret += name + std::string("]"); + ret += name + std::string("_5D_"); return ret; }