mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-07 14:33:15 +00:00
Fix bug: test/Regression/CBackend/2002-10-15-OpaqueTypeProblem.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4190 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8371299258
commit
04b72c821e
@ -196,12 +196,12 @@ ostream &CWriter::printType(const Type *Ty, const string &NameSoFar,
|
||||
}
|
||||
|
||||
// Check to see if the type is named.
|
||||
if (!IgnoreName) {
|
||||
if (!IgnoreName || isa<OpaqueType>(Ty)) {
|
||||
map<const Type *, string>::iterator I = TypeNames.find(Ty);
|
||||
if (I != TypeNames.end()) {
|
||||
return Out << I->second << " " << NameSoFar;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (Ty->getPrimitiveID()) {
|
||||
case Type::FunctionTyID: {
|
||||
@ -257,6 +257,14 @@ ostream &CWriter::printType(const Type *Ty, const string &NameSoFar,
|
||||
return printType(ATy->getElementType(),
|
||||
NameSoFar + "[" + utostr(NumElements) + "]");
|
||||
}
|
||||
|
||||
case Type::OpaqueTyID: {
|
||||
static int Count = 0;
|
||||
string TyName = "struct opaque_" + itostr(Count++);
|
||||
assert(TypeNames.find(Ty) == TypeNames.end());
|
||||
TypeNames[Ty] = TyName;
|
||||
return Out << TyName << " " << NameSoFar;
|
||||
}
|
||||
default:
|
||||
assert(0 && "Unhandled case in getTypeProps!");
|
||||
abort();
|
||||
|
@ -196,12 +196,12 @@ ostream &CWriter::printType(const Type *Ty, const string &NameSoFar,
|
||||
}
|
||||
|
||||
// Check to see if the type is named.
|
||||
if (!IgnoreName) {
|
||||
if (!IgnoreName || isa<OpaqueType>(Ty)) {
|
||||
map<const Type *, string>::iterator I = TypeNames.find(Ty);
|
||||
if (I != TypeNames.end()) {
|
||||
return Out << I->second << " " << NameSoFar;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (Ty->getPrimitiveID()) {
|
||||
case Type::FunctionTyID: {
|
||||
@ -257,6 +257,14 @@ ostream &CWriter::printType(const Type *Ty, const string &NameSoFar,
|
||||
return printType(ATy->getElementType(),
|
||||
NameSoFar + "[" + utostr(NumElements) + "]");
|
||||
}
|
||||
|
||||
case Type::OpaqueTyID: {
|
||||
static int Count = 0;
|
||||
string TyName = "struct opaque_" + itostr(Count++);
|
||||
assert(TypeNames.find(Ty) == TypeNames.end());
|
||||
TypeNames[Ty] = TyName;
|
||||
return Out << TyName << " " << NameSoFar;
|
||||
}
|
||||
default:
|
||||
assert(0 && "Unhandled case in getTypeProps!");
|
||||
abort();
|
||||
|
Loading…
x
Reference in New Issue
Block a user