diff options
author | David Blaikie <dblaikie@gmail.com> | 2017-08-09 18:34:18 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2017-08-09 18:34:18 +0000 |
commit | 76fb649b0d354e9044bcc75d2bbe363b3c26cab2 (patch) | |
tree | f6cad61f7c09c8685b752ad8789d27c8afa9f114 /llvm/lib | |
parent | 9d652e9294f47175cf9b77fe6b290ddc150e7f89 (diff) | |
download | bcm5719-llvm-76fb649b0d354e9044bcc75d2bbe363b3c26cab2.tar.gz bcm5719-llvm-76fb649b0d354e9044bcc75d2bbe363b3c26cab2.zip |
Reduce variable scope by moving declaration into if clause
llvm-svn: 310506
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index e90db4803ee..c7da2460356 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -5104,17 +5104,17 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) { // Static allocas are handled more efficiently in the variable frame index // side table. - const auto *AI = - dyn_cast<AllocaInst>(Address->stripInBoundsConstantOffsets()); - if (AI && AI->isStaticAlloca() && FuncInfo.StaticAllocaMap.count(AI)) - return nullptr; + if (const auto *AI = + dyn_cast<AllocaInst>(Address->stripInBoundsConstantOffsets())) + if (AI->isStaticAlloca() && FuncInfo.StaticAllocaMap.count(AI)) + return nullptr; // Byval arguments with frame indices were already handled after argument // lowering and before isel. - const auto *Arg = - dyn_cast<Argument>(Address->stripInBoundsConstantOffsets()); - if (Arg && FuncInfo.getArgumentFrameIndex(Arg) != INT_MAX) - return nullptr; + if (const auto *Arg = + dyn_cast<Argument>(Address->stripInBoundsConstantOffsets())) + if (FuncInfo.getArgumentFrameIndex(Arg) != INT_MAX) + return nullptr; SDValue &N = NodeMap[Address]; if (!N.getNode() && isa<Argument>(Address)) |