changed function mangling to be compatible with NVVM in CUDA7
This commit is contained in:
2
Makefile
2
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)
|
||||
|
||||
12
type.cpp
12
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user