mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 19:52:54 +01:00
f6b7da2bb5
Rename ConstPool* -> Constant* Rename ConstPoolVals.h -> ConstantVals.h llvm-svn: 1407
34 lines
980 B
C++
34 lines
980 B
C++
//===-- iSwitch.cpp - Implement the Switch instruction -----------*- C++ -*--=//
|
|
//
|
|
// This file implements the Switch instruction...
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "llvm/iTerminators.h"
|
|
#include "llvm/BasicBlock.h"
|
|
#ifndef NDEBUG
|
|
#include "llvm/Type.h"
|
|
#endif
|
|
|
|
SwitchInst::SwitchInst(Value *V, BasicBlock *DefDest)
|
|
: TerminatorInst(Instruction::Switch) {
|
|
assert(V && DefDest);
|
|
Operands.push_back(Use(V, this));
|
|
Operands.push_back(Use(DefDest, 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(OnVal, this));
|
|
Operands.push_back(Use(Dest, this));
|
|
}
|