1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

Fix const problems

llvm-svn: 2760
This commit is contained in:
Chris Lattner 2002-06-05 17:55:27 +00:00
parent 593394bb04
commit 20ab8448b0

View File

@ -17,15 +17,15 @@ string MangleTypeName(const Type *Ty) {
if (Ty->isPrimitiveType()) {
const string &longName = Ty->getDescription();
return string(longName.c_str(), (longName.length() < 2) ? 1 : 2);
} else if (PointerType *PTy = dyn_cast<PointerType>(Ty)) {
} else if (const PointerType *PTy = dyn_cast<PointerType>(Ty)) {
mangledName = string("P_" + MangleTypeName(PTy->getElementType()));
} else if (StructType *STy = dyn_cast<StructType>(Ty)) {
} else if (const StructType *STy = dyn_cast<StructType>(Ty)) {
mangledName = string("S_");
for (unsigned i=0; i < STy->getNumContainedTypes(); ++i)
mangledName += MangleTypeName(STy->getContainedType(i));
} else if (ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
} else if (const ArrayType *ATy = dyn_cast<ArrayType>(Ty)) {
mangledName = string("A_" +MangleTypeName(ATy->getElementType()));
} else if (FunctionType *FTy = dyn_cast<FunctionType>(Ty)) {
} else if (const FunctionType *FTy = dyn_cast<FunctionType>(Ty)) {
mangledName = string("M_") + MangleTypeName(FTy->getReturnType());
for (unsigned i = 1; i < FTy->getNumContainedTypes(); ++i)
mangledName += string(MangleTypeName(FTy->getContainedType(i)));