mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
enumerate BB's separately from other function values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36467 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -178,11 +178,12 @@ void ValueEnumerator::incorporateFunction(const Function &F) {
|
||||
isa<InlineAsm>(*OI))
|
||||
EnumerateValue(*OI);
|
||||
}
|
||||
ValueMap[BB] = BasicBlocks.size();
|
||||
BasicBlocks.push_back(BB);
|
||||
}
|
||||
|
||||
// Add all of the instructions.
|
||||
for (Function::const_iterator BB = F.begin(), E = F.end(); BB != E; ++BB) {
|
||||
EnumerateValue(BB);
|
||||
for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I!=E; ++I) {
|
||||
if (I->getType() != Type::VoidTy)
|
||||
EnumerateValue(I);
|
||||
@ -194,6 +195,10 @@ void ValueEnumerator::purgeFunction() {
|
||||
/// Remove purged values from the ValueMap.
|
||||
for (unsigned i = ModuleLevel, e = Values.size(); i != e; ++i)
|
||||
ValueMap.erase(Values[i].first);
|
||||
for (unsigned i = 0, e = BasicBlocks.size(); i != e; ++i)
|
||||
ValueMap.erase(BasicBlocks[i]);
|
||||
|
||||
Values.resize(ModuleLevel);
|
||||
BasicBlocks.clear();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user