mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-15 07:59:57 +00:00
2aa831120c
it is created, as part of the ctor call. Eliminate the GenericBinaryInst class git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3653 91177308-0d34-0410-b5e6-96231b3b80d8
32 lines
1.0 KiB
C++
32 lines
1.0 KiB
C++
//===-- iSwitch.cpp - Implement the Switch instruction -----------*- C++ -*--=//
|
|
//
|
|
// This file implements the Switch instruction...
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "llvm/iTerminators.h"
|
|
#include "llvm/BasicBlock.h"
|
|
|
|
SwitchInst::SwitchInst(Value *V, BasicBlock *DefaultDest,
|
|
Instruction *InsertBefore)
|
|
: TerminatorInst(Instruction::Switch, InsertBefore) {
|
|
assert(V && DefaultDest);
|
|
Operands.push_back(Use(V, this));
|
|
Operands.push_back(Use(DefaultDest, this));
|
|
}
|
|
|
|
SwitchInst::SwitchInst(const SwitchInst &SI)
|
|
: TerminatorInst(Instruction::Switch) {
|
|
Operands.reserve(SI.Operands.size());
|
|
|
|
for (unsigned i = 0, E = SI.Operands.size(); i != E; i+=2) {
|
|
Operands.push_back(Use(SI.Operands[i], this));
|
|
Operands.push_back(Use(SI.Operands[i+1], this));
|
|
}
|
|
}
|
|
|
|
void SwitchInst::dest_push_back(Constant *OnVal, BasicBlock *Dest) {
|
|
Operands.push_back(Use((Value*)OnVal, this));
|
|
Operands.push_back(Use((Value*)Dest, this));
|
|
}
|