summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-04-09 19:39:35 +0000
committerChris Lattner <sabre@nondot.org>2002-04-09 19:39:35 +0000
commitd255ae24db15bd6b44f486d6dc7ad4c7fa3193ab (patch)
tree8b595421cc0ca5dcf10f0c6d0cbf56a2c6e8013e
parent34c925e22a3354031ead95821223200014681e1b (diff)
downloadbcm5719-llvm-d255ae24db15bd6b44f486d6dc7ad4c7fa3193ab.tar.gz
bcm5719-llvm-d255ae24db15bd6b44f486d6dc7ad4c7fa3193ab.zip
Move FunctionArgument out of iOther.h into Argument.h and rename class to
be 'Argument' instead of FunctionArgument. Move Argument implementation to Function.cpp llvm-svn: 2211
-rw-r--r--llvm/lib/VMCore/Function.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/llvm/lib/VMCore/Function.cpp b/llvm/lib/VMCore/Function.cpp
index f2e6bd5c64e..598f9fd0c24 100644
--- a/llvm/lib/VMCore/Function.cpp
+++ b/llvm/lib/VMCore/Function.cpp
@@ -12,9 +12,26 @@
#include "llvm/GlobalVariable.h"
#include "llvm/BasicBlock.h"
#include "llvm/iOther.h"
+#include "llvm/Argument.h"
#include "ValueHolderImpl.h"
//===----------------------------------------------------------------------===//
+// Argument Implementation
+//===----------------------------------------------------------------------===//
+
+// Specialize setName to take care of symbol table majik
+void Argument::setName(const std::string &name, SymbolTable *ST) {
+ Function *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);
+}
+
+
+
+//===----------------------------------------------------------------------===//
// Function Implementation
//===----------------------------------------------------------------------===//
@@ -22,8 +39,8 @@
// Instantiate Templates - This ugliness is the price we have to pay
// for having a ValueHolderImpl.h file seperate from ValueHolder.h! :(
//
-template class ValueHolder<FunctionArgument, Function, Function>;
-template class ValueHolder<BasicBlock , Function, Function>;
+template class ValueHolder<Argument , Function, Function>;
+template class ValueHolder<BasicBlock, Function, Function>;
Function::Function(const FunctionType *Ty, bool isInternal,
const std::string &name)
OpenPOWER on IntegriCloud