mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-07 12:28:24 +00:00
Use range loops. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@223657 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1153,17 +1153,16 @@ void ModuleLinker::linkAppendingVarInit(const AppendingVarInfo &AVI) {
|
|||||||
/// referenced are in Dest.
|
/// referenced are in Dest.
|
||||||
void ModuleLinker::linkGlobalInits() {
|
void ModuleLinker::linkGlobalInits() {
|
||||||
// Loop over all of the globals in the src module, mapping them over as we go
|
// Loop over all of the globals in the src module, mapping them over as we go
|
||||||
for (Module::const_global_iterator I = SrcM->global_begin(),
|
for (GlobalVariable &Src : SrcM->globals()) {
|
||||||
E = SrcM->global_end(); I != E; ++I) {
|
|
||||||
|
|
||||||
// Only process initialized GV's or ones not already in dest.
|
// Only process initialized GV's or ones not already in dest.
|
||||||
if (!I->hasInitializer() || DoNotLinkFromSource.count(I)) continue;
|
if (!Src.hasInitializer() || DoNotLinkFromSource.count(&Src))
|
||||||
|
continue;
|
||||||
|
|
||||||
// Grab destination global variable.
|
// Grab destination global variable.
|
||||||
GlobalVariable *DGV = cast<GlobalVariable>(ValueMap[I]);
|
GlobalVariable *Dst = cast<GlobalVariable>(ValueMap[&Src]);
|
||||||
// Figure out what the initializer looks like in the dest module.
|
// Figure out what the initializer looks like in the dest module.
|
||||||
DGV->setInitializer(MapValue(I->getInitializer(), ValueMap,
|
Dst->setInitializer(MapValue(Src.getInitializer(), ValueMap, RF_None,
|
||||||
RF_None, &TypeMap, &ValMaterializer));
|
&TypeMap, &ValMaterializer));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1221,12 +1220,11 @@ bool ModuleLinker::linkFunctionBody(Function *Dst, Function *Src) {
|
|||||||
|
|
||||||
/// Insert all of the aliases in Src into the Dest module.
|
/// Insert all of the aliases in Src into the Dest module.
|
||||||
void ModuleLinker::linkAliasBodies() {
|
void ModuleLinker::linkAliasBodies() {
|
||||||
for (Module::alias_iterator I = SrcM->alias_begin(), E = SrcM->alias_end();
|
for (GlobalAlias &Src : SrcM->aliases()) {
|
||||||
I != E; ++I) {
|
if (DoNotLinkFromSource.count(&Src))
|
||||||
if (DoNotLinkFromSource.count(I))
|
|
||||||
continue;
|
continue;
|
||||||
if (Constant *Aliasee = I->getAliasee()) {
|
if (Constant *Aliasee = Src.getAliasee()) {
|
||||||
GlobalAlias *DA = cast<GlobalAlias>(ValueMap[I]);
|
GlobalAlias *DA = cast<GlobalAlias>(ValueMap[&Src]);
|
||||||
Constant *Val =
|
Constant *Val =
|
||||||
MapValue(Aliasee, ValueMap, RF_None, &TypeMap, &ValMaterializer);
|
MapValue(Aliasee, ValueMap, RF_None, &TypeMap, &ValMaterializer);
|
||||||
DA->setAliasee(Val);
|
DA->setAliasee(Val);
|
||||||
|
Reference in New Issue
Block a user