[llvm-commits] [llvm] r49783 - /llvm/trunk/lib/CodeGen/MachineInstr.cpp

Bill Wendling isanbard at gmail.com
Wed Apr 16 11:14:07 PDT 2008


On Wed, Apr 16, 2008 at 2:41 AM, Evan Cheng <evan.cheng at apple.com> wrote:
>
>  +  // Trim unneeded kill operands.
>  +  while (!DeadOps.empty()) {
>  +    unsigned OpIdx = DeadOps.back();
>  +    if (getOperand(OpIdx).isImplicit())
>  +      RemoveOperand(OpIdx);
>  +    else
>  +      getOperand(OpIdx).setIsKill(false);
>  +    DeadOps.pop_back();
>  +  }
>  +
...
>
>  +  // Trim unneeded dead operands.
>  +  while (!DeadOps.empty()) {
>  +    unsigned OpIdx = DeadOps.back();
>  +    if (getOperand(OpIdx).isImplicit())
>  +      RemoveOperand(OpIdx);
>  +    else
>  +      getOperand(OpIdx).setIsDead(false);
>  +    DeadOps.pop_back();
>  +  }

A small point, but it seems that the idiom people use in the code is

  while (!Container.empty()) {
     Object o = Container.back();
     Container.pop_back();
     // Do stuff to "o"
  }

instead of putting the pop_back() command at the end.

-bw



More information about the llvm-commits mailing list