[IRTranslator] Add comments to explain the ordering of the switch. NFC.

Group arithmetic operations, bitwise operations, and branch operations.

llvm-svn: 276305
This commit is contained in:
Quentin Colombet 2016-07-21 17:26:41 +00:00
parent 1710e7cfa7
commit 19df8a1aba
1 changed files with 3 additions and 0 deletions

View File

@ -102,12 +102,15 @@ bool IRTranslator::translateBr(const Instruction &Inst) {
bool IRTranslator::translate(const Instruction &Inst) {
MIRBuilder.setDebugLoc(Inst.getDebugLoc());
switch(Inst.getOpcode()) {
// Arithmetic operations.
case Instruction::Add:
return translateBinaryOp(TargetOpcode::G_ADD, Inst);
// Bitwise operations.
case Instruction::And:
return translateBinaryOp(TargetOpcode::G_AND, Inst);
case Instruction::Or:
return translateBinaryOp(TargetOpcode::G_OR, Inst);
// Branch operations.
case Instruction::Br:
return translateBr(Inst);
case Instruction::Ret: