#include "llvm/Type.h"
#include <algorithm> // find
-// TODO: Move to getUnaryOperator iUnary.cpp when and if it exists!
-UnaryOperator *UnaryOperator::create(unsigned Op, Value *Source) {
- switch (Op) {
- default:
- cerr << "Don't know how to GetUnaryOperator " << Op << endl;
- return 0;
- }
-}
-
//===----------------------------------------------------------------------===//
// TerminatorInst Class
//===----------------------------------------------------------------------===//
-TerminatorInst::TerminatorInst(unsigned iType)
+TerminatorInst::TerminatorInst(Instruction::TermOps iType)
: Instruction(Type::VoidTy, iType, "") {
}
+TerminatorInst::TerminatorInst(const Type *Ty, Instruction::TermOps iType,
+ const string &Name = "")
+ : Instruction(Ty, iType, Name) {
+}
+
//===----------------------------------------------------------------------===//
// MethodArgument Class
//===----------------------------------------------------------------------===//
// Specialize setName to take care of symbol table majik
-void MethodArgument::setName(const string &name) {
+void MethodArgument::setName(const string &name, SymbolTable *ST) {
Method *P;
+ assert((ST == 0 || (!getParent() || ST == getParent()->getSymbolTable())) &&
+ "Invalid symtab argument!");
if ((P = getParent()) && hasName()) P->getSymbolTable()->remove(this);
Value::setName(name);
if (P && hasName()) P->getSymbolTable()->insert(this);