mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Use V for values, not D.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8848 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a983359f59
commit
51ca860bda
@ -192,29 +192,28 @@ Constant *BytecodeParser::getConstantValue(const Type *Ty, unsigned Slot) {
|
|||||||
|
|
||||||
void BytecodeParser::postResolveValues(ValueTable &ValTab) {
|
void BytecodeParser::postResolveValues(ValueTable &ValTab) {
|
||||||
while (!ValTab.empty()) {
|
while (!ValTab.empty()) {
|
||||||
ValueList &DL = *ValTab.back();
|
ValueList &VL = *ValTab.back();
|
||||||
ValTab.pop_back();
|
ValTab.pop_back();
|
||||||
|
|
||||||
while (!DL.empty()) {
|
while (!VL.empty()) {
|
||||||
Value *D = DL.back();
|
Value *V = VL.back();
|
||||||
unsigned IDNumber = getValueIDNumberFromPlaceHolder(D);
|
unsigned IDNumber = getValueIDNumberFromPlaceHolder(V);
|
||||||
DL.pop_back();
|
VL.pop_back();
|
||||||
|
|
||||||
Value *NewDef = getValue(D->getType(), IDNumber, false);
|
Value *NewVal = getValue(V->getType(), IDNumber, false);
|
||||||
if (NewDef == 0) {
|
if (NewVal == 0)
|
||||||
throw std::string("Unresolvable reference found: <" +
|
throw std::string("Unresolvable reference found: <" +
|
||||||
D->getType()->getDescription() + ">:" +
|
V->getType()->getDescription() + ">:" +
|
||||||
utostr(IDNumber) + ".");
|
utostr(IDNumber) + ".");
|
||||||
} else {
|
|
||||||
// Fixup all of the uses of this placeholder def...
|
// Fixup all of the uses of this placeholder def...
|
||||||
D->replaceAllUsesWith(NewDef);
|
V->replaceAllUsesWith(NewVal);
|
||||||
|
|
||||||
// Now that all the uses are gone, delete the placeholder...
|
// Now that all the uses are gone, delete the placeholder...
|
||||||
// If we couldn't find a def (error case), then leak a little
|
// If we couldn't find a def (error case), then leak a little
|
||||||
delete D; // memory, 'cause otherwise we can't remove all uses!
|
delete V; // memory, 'cause otherwise we can't remove all uses!
|
||||||
}
|
}
|
||||||
}
|
delete &VL;
|
||||||
delete &DL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user