diff options
author | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2017-10-16 18:43:08 +0000 |
---|---|---|
committer | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2017-10-16 18:43:08 +0000 |
commit | 02893de4ef05e0580fab3d7b372bafd28fd4126a (patch) | |
tree | 215c557ab91c6df14035f7536ff0b1e18b15b355 /llvm/lib/Target/Hexagon/HexagonBitTracker.cpp | |
parent | f5ca27cc3785b3a2bf9dd3c005f3aa6a2d14fb93 (diff) | |
download | bcm5719-llvm-02893de4ef05e0580fab3d7b372bafd28fd4126a.tar.gz bcm5719-llvm-02893de4ef05e0580fab3d7b372bafd28fd4126a.zip |
[Hexagon] Rangify some loops, NFC
Recommit r315763 with a fix.
llvm-svn: 315925
Diffstat (limited to 'llvm/lib/Target/Hexagon/HexagonBitTracker.cpp')
-rw-r--r-- | llvm/lib/Target/Hexagon/HexagonBitTracker.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonBitTracker.cpp b/llvm/lib/Target/Hexagon/HexagonBitTracker.cpp index 08e08fe5087..e62e006e40c 100644 --- a/llvm/lib/Target/Hexagon/HexagonBitTracker.cpp +++ b/llvm/lib/Target/Hexagon/HexagonBitTracker.cpp @@ -60,12 +60,8 @@ HexagonEvaluator::HexagonEvaluator(const HexagonRegisterInfo &tri, // der the initial sequence of formal parameters that are known to be // passed via registers. unsigned InVirtReg, InPhysReg = 0; - const Function &F = *MF.getFunction(); - using arg_iterator = Function::const_arg_iterator; - - for (arg_iterator I = F.arg_begin(), E = F.arg_end(); I != E; ++I) { - const Argument &Arg = *I; + for (const Argument &Arg : MF.getFunction()->args()) { Type *ATy = Arg.getType(); unsigned Width = 0; if (ATy->isIntegerTy()) @@ -190,8 +186,7 @@ bool HexagonEvaluator::evaluate(const MachineInstr &MI, unsigned NumDefs = 0; // Sanity verification: there should not be any defs with subregisters. - for (unsigned i = 0, n = MI.getNumOperands(); i < n; ++i) { - const MachineOperand &MO = MI.getOperand(i); + for (const MachineOperand &MO : MI.operands()) { if (!MO.isReg() || !MO.isDef()) continue; NumDefs++; @@ -240,8 +235,7 @@ bool HexagonEvaluator::evaluate(const MachineInstr &MI, // checking what kind of operand a given instruction has individually // for each instruction, do it here. Global symbols as operands gene- // rally do not provide any useful information. - for (unsigned i = 0, n = MI.getNumOperands(); i < n; ++i) { - const MachineOperand &MO = MI.getOperand(i); + for (const MachineOperand &MO : MI.operands()) { if (MO.isGlobal() || MO.isBlockAddress() || MO.isSymbol() || MO.isJTI() || MO.isCPI()) return false; |