forked from OSchip/llvm-project
[DeadArgElim] Use structure bindings in foreach loops. NFC
Differential Revision: https://reviews.llvm.org/D133026
This commit is contained in:
parent
f252b8477e
commit
527b9a9d90
|
@ -238,8 +238,8 @@ bool DeadArgumentEliminationPass::deleteDeadVarargs(Function &F) {
|
||||||
// Clone metadata from the old function, including debug info descriptor.
|
// Clone metadata from the old function, including debug info descriptor.
|
||||||
SmallVector<std::pair<unsigned, MDNode *>, 1> MDs;
|
SmallVector<std::pair<unsigned, MDNode *>, 1> MDs;
|
||||||
F.getAllMetadata(MDs);
|
F.getAllMetadata(MDs);
|
||||||
for (auto MD : MDs)
|
for (auto [KindID, Node] : MDs)
|
||||||
NF->addMetadata(MD.first, *MD.second);
|
NF->addMetadata(KindID, *Node);
|
||||||
|
|
||||||
// Fix up any BlockAddresses that refer to the function.
|
// Fix up any BlockAddresses that refer to the function.
|
||||||
F.replaceAllUsesWith(ConstantExpr::getBitCast(NF, F.getType()));
|
F.replaceAllUsesWith(ConstantExpr::getBitCast(NF, F.getType()));
|
||||||
|
@ -1062,8 +1062,8 @@ bool DeadArgumentEliminationPass::removeDeadStuffFromFunction(Function *F) {
|
||||||
// Clone metadata from the old function, including debug info descriptor.
|
// Clone metadata from the old function, including debug info descriptor.
|
||||||
SmallVector<std::pair<unsigned, MDNode *>, 1> MDs;
|
SmallVector<std::pair<unsigned, MDNode *>, 1> MDs;
|
||||||
F->getAllMetadata(MDs);
|
F->getAllMetadata(MDs);
|
||||||
for (auto MD : MDs)
|
for (auto [KindID, Node] : MDs)
|
||||||
NF->addMetadata(MD.first, *MD.second);
|
NF->addMetadata(KindID, *Node);
|
||||||
|
|
||||||
// If either the return value(s) or argument(s) are removed, then probably the
|
// If either the return value(s) or argument(s) are removed, then probably the
|
||||||
// function does not follow standard calling conventions anymore. Hence, add
|
// function does not follow standard calling conventions anymore. Hence, add
|
||||||
|
|
Loading…
Reference in New Issue