Linker: Avoid some ridiculous indentation by using a temporary. NFC

This was indented really awkwardly, and clang-format didn't seem to
know how to do any better. Avoid the issue with a temporary variable.

llvm-svn: 278756
This commit is contained in:
Justin Bogner 2016-08-15 22:41:42 +00:00
parent 12cd6ddef3
commit 375f71e3a3
1 changed files with 11 additions and 12 deletions

View File

@ -805,18 +805,17 @@ IRLinker::linkAppendingVarProto(GlobalVariable *DstGV,
SmallVector<Constant *, 16> SrcElements;
getArrayElements(SrcGV->getInitializer(), SrcElements);
if (IsNewStructor)
SrcElements.erase(
remove_if(SrcElements,
[this](Constant *E) {
auto *Key = dyn_cast<GlobalValue>(
E->getAggregateElement(2)->stripPointerCasts());
if (!Key)
return false;
GlobalValue *DGV = getLinkedToGlobal(Key);
return !shouldLink(DGV, *Key);
}),
SrcElements.end());
if (IsNewStructor) {
auto It = remove_if(SrcElements, [this](Constant *E) {
auto *Key =
dyn_cast<GlobalValue>(E->getAggregateElement(2)->stripPointerCasts());
if (!Key)
return false;
GlobalValue *DGV = getLinkedToGlobal(Key);
return !shouldLink(DGV, *Key);
});
SrcElements.erase(It, SrcElements.end());
}
uint64_t NewSize = DstNumElements + SrcElements.size();
ArrayType *NewType = ArrayType::get(EltTy, NewSize);