mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-09 03:56:28 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278756 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5912e9a50d
commit
d6a48b16f6
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user