mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-20 14:29:27 +00:00
move this out of line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20751 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
dc77036a82
commit
612f0b74d4
@ -75,6 +75,34 @@ DSNode *DSNodeHandle::HandleForwarding() const {
|
|||||||
return N;
|
return N;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
// DSScalarMap Implementation
|
||||||
|
//===----------------------------------------------------------------------===//
|
||||||
|
|
||||||
|
DSNodeHandle &DSScalarMap::AddGlobal(GlobalValue *GV) {
|
||||||
|
assert(ValueMap.count(GV) == 0 && "GV already exists!");
|
||||||
|
|
||||||
|
// If the node doesn't exist, check to see if it's a global that is
|
||||||
|
// equated to another global in the program.
|
||||||
|
EquivalenceClasses<GlobalValue*>::iterator ECI = GlobalECs.findValue(GV);
|
||||||
|
if (ECI != GlobalECs.end()) {
|
||||||
|
GlobalValue *Leader = *GlobalECs.findLeader(ECI);
|
||||||
|
if (Leader != GV) {
|
||||||
|
GV = Leader;
|
||||||
|
iterator I = ValueMap.find(GV);
|
||||||
|
if (I != ValueMap.end())
|
||||||
|
return I->second;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Okay, this is either not an equivalenced global or it is the leader, it
|
||||||
|
// will be inserted into the scalar map now.
|
||||||
|
GlobalSet.insert(GV);
|
||||||
|
|
||||||
|
return ValueMap.insert(std::make_pair(GV, DSNodeHandle())).first->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// DSNode Implementation
|
// DSNode Implementation
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user