summaryrefslogtreecommitdiff
path: root/lib/Linker
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2016-08-15 22:41:42 +0000
committerJustin Bogner <mail@justinbogner.com>2016-08-15 22:41:42 +0000
commitd6a48b16f62054094a1f0c8cc133d5a6a9a09f1f (patch)
tree188ea51bd497f4e500cba4bbcd0e0972ea796609 /lib/Linker
parent5912e9a50dc2fed7baf82cc6f15d87d61cb57df4 (diff)
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
Diffstat (limited to 'lib/Linker')
-rw-r--r--lib/Linker/IRMover.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/lib/Linker/IRMover.cpp b/lib/Linker/IRMover.cpp
index 12ceaa2d322..6def096ccd7 100644
--- a/lib/Linker/IRMover.cpp
+++ b/lib/Linker/IRMover.cpp
@@ -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);