Add notes
[oota-llvm.git] / lib / VMCore / InstrTypes.cpp
index 9d3262cbda7209a70a66be854ce93ce75f63d56e..9e49805d315b23a10aa09f8c29f604675086a9cd 100644 (file)
 #include "llvm/Type.h"
 #include <algorithm>  // find
 
-// TODO: Move to getUnaryOperator iUnary.cpp when and if it exists!
-UnaryOperator *UnaryOperator::create(UnaryOps 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);