mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-20 14:29:27 +00:00
Don't return bogus references, and don't add an entry to the Concrete map
unless it's not empty! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8334 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1bb626387b
commit
d8d6c76a9a
@ -39,7 +39,8 @@ void PATypeHolder::dump() const {
|
|||||||
|
|
||||||
Type::Type(const std::string &name, PrimitiveID id)
|
Type::Type(const std::string &name, PrimitiveID id)
|
||||||
: Value(Type::TypeTy, Value::TypeVal) {
|
: Value(Type::TypeTy, Value::TypeVal) {
|
||||||
ConcreteTypeDescriptions[this] = name;
|
if (!name.empty())
|
||||||
|
ConcreteTypeDescriptions[this] = name;
|
||||||
ID = id;
|
ID = id;
|
||||||
Abstract = false;
|
Abstract = false;
|
||||||
UID = CurUID++; // Assign types UID's as they are created
|
UID = CurUID++; // Assign types UID's as they are created
|
||||||
@ -202,8 +203,8 @@ static std::string getTypeDescription(const Type *Ty,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
assert(0 && "Unhandled type in getTypeDescription!");
|
|
||||||
Result = "<error>";
|
Result = "<error>";
|
||||||
|
assert(0 && "Unhandled type in getTypeDescription!");
|
||||||
}
|
}
|
||||||
|
|
||||||
TypeStack.pop_back(); // Remove self from stack...
|
TypeStack.pop_back(); // Remove self from stack...
|
||||||
@ -211,11 +212,9 @@ static std::string getTypeDescription(const Type *Ty,
|
|||||||
// In order to reduce the amount of repeated computation, we cache the
|
// In order to reduce the amount of repeated computation, we cache the
|
||||||
// computed value for later.
|
// computed value for later.
|
||||||
if (Ty->isAbstract())
|
if (Ty->isAbstract())
|
||||||
AbstractTypeDescriptions[Ty] = Result;
|
return AbstractTypeDescriptions[Ty] = Result;
|
||||||
else
|
else
|
||||||
ConcreteTypeDescriptions[Ty] = Result;
|
return ConcreteTypeDescriptions[Ty] = Result;
|
||||||
|
|
||||||
return Result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user