|
@@ -356,18 +356,23 @@ const char *OP::GetOverloadTypeName(unsigned TypeSlot) {
|
|
return m_OverloadTypeName[TypeSlot];
|
|
return m_OverloadTypeName[TypeSlot];
|
|
}
|
|
}
|
|
|
|
|
|
-const char * OP::GetTypeName(Type *Ty, std::string &str) {
|
|
|
|
|
|
+llvm::StringRef OP::GetTypeName(Type *Ty, std::string &str) {
|
|
unsigned TypeSlot = OP::GetTypeSlot(Ty);
|
|
unsigned TypeSlot = OP::GetTypeSlot(Ty);
|
|
if (TypeSlot < kUserDefineTypeSlot) {
|
|
if (TypeSlot < kUserDefineTypeSlot) {
|
|
return GetOverloadTypeName(TypeSlot);
|
|
return GetOverloadTypeName(TypeSlot);
|
|
|
|
+ } else if (TypeSlot == kUserDefineTypeSlot) {
|
|
|
|
+ if (Ty->isPointerTy())
|
|
|
|
+ Ty = Ty->getPointerElementType();
|
|
|
|
+ StructType *ST = cast<StructType>(Ty);
|
|
|
|
+ return ST->getStructName();
|
|
} else if (TypeSlot == kObjectTypeSlot) {
|
|
} else if (TypeSlot == kObjectTypeSlot) {
|
|
StructType *ST = cast<StructType>(Ty);
|
|
StructType *ST = cast<StructType>(Ty);
|
|
- return ST->getStructName().data();
|
|
|
|
|
|
+ return ST->getStructName();
|
|
} else {
|
|
} else {
|
|
raw_string_ostream os(str);
|
|
raw_string_ostream os(str);
|
|
Ty->print(os);
|
|
Ty->print(os);
|
|
os.flush();
|
|
os.flush();
|
|
- return str.c_str();
|
|
|
|
|
|
+ return str;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|