mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-21 02:25:13 +00:00
minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10612 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -111,17 +111,16 @@ void BytecodeParser::parseTypeConstants(const unsigned char *&Buf,
|
|||||||
assert(Tab.size() == 0 && "should not have read type constants in before!");
|
assert(Tab.size() == 0 && "should not have read type constants in before!");
|
||||||
|
|
||||||
// Insert a bunch of opaque types to be resolved later...
|
// Insert a bunch of opaque types to be resolved later...
|
||||||
// FIXME: this is dumb
|
|
||||||
Tab.reserve(NumEntries);
|
Tab.reserve(NumEntries);
|
||||||
for (unsigned i = 0; i < NumEntries; ++i)
|
for (unsigned i = 0; i != NumEntries; ++i)
|
||||||
Tab.push_back(OpaqueType::get());
|
Tab.push_back(OpaqueType::get());
|
||||||
|
|
||||||
// Loop through reading all of the types. Forward types will make use of the
|
// Loop through reading all of the types. Forward types will make use of the
|
||||||
// opaque types just inserted.
|
// opaque types just inserted.
|
||||||
//
|
//
|
||||||
for (unsigned i = 0; i < NumEntries; ++i) {
|
for (unsigned i = 0; i != NumEntries; ++i) {
|
||||||
const Type *NewTy = parseTypeConstant(Buf, EndBuf), *OldTy = Tab[i].get();
|
const Type *NewTy = parseTypeConstant(Buf, EndBuf), *OldTy = Tab[i].get();
|
||||||
if (NewTy == 0) throw std::string("Parsed invalid type.");
|
if (NewTy == 0) throw std::string("Couldn't parse type!");
|
||||||
BCR_TRACE(4, "#" << i << ": Read Type Constant: '" << NewTy <<
|
BCR_TRACE(4, "#" << i << ": Read Type Constant: '" << NewTy <<
|
||||||
"' Replacing: " << OldTy << "\n");
|
"' Replacing: " << OldTy << "\n");
|
||||||
|
|
||||||
@@ -130,10 +129,10 @@ void BytecodeParser::parseTypeConstants(const unsigned char *&Buf,
|
|||||||
//
|
//
|
||||||
|
|
||||||
// Refine the abstract type to the new type. This causes all uses of the
|
// Refine the abstract type to the new type. This causes all uses of the
|
||||||
// abstract type to use the newty. This also will cause the opaque type
|
// abstract type to use NewTy. This also will cause the opaque type to be
|
||||||
// to be deleted...
|
// deleted...
|
||||||
//
|
//
|
||||||
((DerivedType*)Tab[i].get())->refineAbstractTypeTo(NewTy);
|
cast<DerivedType>(const_cast<Type*>(OldTy))->refineAbstractTypeTo(NewTy);
|
||||||
|
|
||||||
// This should have replace the old opaque type with the new type in the
|
// This should have replace the old opaque type with the new type in the
|
||||||
// value table... or with a preexisting type that was already in the system
|
// value table... or with a preexisting type that was already in the system
|
||||||
|
Reference in New Issue
Block a user