Index: lib/Analysis/CFLGraph.h =================================================================== --- lib/Analysis/CFLGraph.h +++ lib/Analysis/CFLGraph.h @@ -515,11 +515,11 @@ visitGEP(*GEPOp); break; } - case Instruction::PtrToInt: { - auto *Ptr = CE->getOperand(0); - addNode(Ptr, getAttrEscaped()); + + case Instruction::PtrToInt: + addNode(CE->getOperand(0), getAttrEscaped()); break; - } + case Instruction::IntToPtr: addNode(CE, getAttrUnknown()); break; @@ -534,49 +534,22 @@ case Instruction::UIToFP: case Instruction::SIToFP: case Instruction::FPToUI: - case Instruction::FPToSI: { - auto *Src = CE->getOperand(0); - addAssignEdge(Src, CE); - break; - } - case Instruction::Select: { - auto *TrueVal = CE->getOperand(0); - auto *FalseVal = CE->getOperand(1); - addAssignEdge(TrueVal, CE); - addAssignEdge(FalseVal, CE); - break; - } - case Instruction::InsertElement: { - auto *Vec = CE->getOperand(0); - auto *Val = CE->getOperand(1); - addAssignEdge(Vec, CE); - addStoreEdge(Val, CE); - break; - } - case Instruction::ExtractElement: { - auto *Ptr = CE->getOperand(0); - addLoadEdge(Ptr, CE); + case Instruction::FPToSI: + addAssignEdge(CE->getOperand(0), CE); break; - } + + case Instruction::InsertElement: case Instruction::InsertValue: { - auto *Agg = CE->getOperand(0); - auto *Val = CE->getOperand(1); - addAssignEdge(Agg, CE); - addStoreEdge(Val, CE); - break; - } - case Instruction::ExtractValue: { - auto *Ptr = CE->getOperand(0); - addLoadEdge(Ptr, CE); + addAssignEdge(CE->getOperand(0), CE); + addStoreEdge(CE->getOperand(1), CE); break; } - case Instruction::ShuffleVector: { - auto *From1 = CE->getOperand(0); - auto *From2 = CE->getOperand(1); - addAssignEdge(From1, CE); - addAssignEdge(From2, CE); + + case Instruction::ExtractElement: + case Instruction::ExtractValue: + addLoadEdge(CE->getOperand(0), CE); break; - } + case Instruction::Add: case Instruction::Sub: case Instruction::FSub: @@ -596,9 +569,12 @@ case Instruction::AShr: case Instruction::ICmp: case Instruction::FCmp: + case Instruction::Select: + case Instruction::ShuffleVector: { addAssignEdge(CE->getOperand(0), CE); addAssignEdge(CE->getOperand(1), CE); break; + } default: llvm_unreachable("Unknown instruction type encountered!");