diff options
author | Chris Lattner <sabre@nondot.org> | 2002-04-09 19:48:49 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-04-09 19:48:49 +0000 |
commit | 73e214244f2403b5ba0ef81b8839600f3c8ffebc (patch) | |
tree | 245e635c686ace9b5ebbcaf39d622a92f9db594e /lib/VMCore | |
parent | b62fc4a9b11662ec2c5fa190b513eae0a0810ce1 (diff) | |
download | external_llvm-73e214244f2403b5ba0ef81b8839600f3c8ffebc.zip external_llvm-73e214244f2403b5ba0ef81b8839600f3c8ffebc.tar.gz external_llvm-73e214244f2403b5ba0ef81b8839600f3c8ffebc.tar.bz2 |
Move FunctionArgument out of iOther.h into Argument.h and rename class to
be 'Argument' instead of FunctionArgument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2216 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/AsmWriter.cpp | 17 | ||||
-rw-r--r-- | lib/VMCore/Linker.cpp | 5 | ||||
-rw-r--r-- | lib/VMCore/SlotCalculator.cpp | 1 |
3 files changed, 13 insertions, 10 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index e5f9114..6cdbf9d 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -20,6 +20,7 @@ #include "llvm/iPHINode.h" #include "llvm/iOther.h" #include "llvm/SymbolTable.h" +#include "llvm/Argument.h" #include "Support/StringExtras.h" #include "Support/STLExtras.h" #include <algorithm> @@ -30,7 +31,7 @@ using std::vector; using std::ostream; static const Module *getModuleFromVal(const Value *V) { - if (const FunctionArgument *MA = dyn_cast<const FunctionArgument>(V)) + if (const Argument *MA = dyn_cast<const Argument>(V)) return MA->getParent() ? MA->getParent()->getParent() : 0; else if (const BasicBlock *BB = dyn_cast<const BasicBlock>(V)) return BB->getParent() ? BB->getParent()->getParent() : 0; @@ -46,7 +47,7 @@ static const Module *getModuleFromVal(const Value *V) { static SlotCalculator *createSlotCalculator(const Value *V) { assert(!isa<Type>(V) && "Can't create an SC for a type!"); - if (const FunctionArgument *FA = dyn_cast<const FunctionArgument>(V)) { + if (const Argument *FA = dyn_cast<const Argument>(V)) { return new SlotCalculator(FA->getParent(), true); } else if (const Instruction *I = dyn_cast<const Instruction>(V)) { return new SlotCalculator(I->getParent()->getParent(), true); @@ -286,7 +287,7 @@ private : void printConstant(const Constant *CPV); void printGlobal(const GlobalVariable *GV); void printFunction(const Function *F); - void printFunctionArgument(const FunctionArgument *FA); + void printArgument(const Argument *FA); void printBasicBlock(const BasicBlock *BB); void printInstruction(const Instruction *I); ostream &printType(const Type *Ty); @@ -397,7 +398,7 @@ void AssemblyWriter::printFunction(const Function *M) { if (!M->isExternal()) { for_each(M->getArgumentList().begin(), M->getArgumentList().end(), - bind_obj(this, &AssemblyWriter::printFunctionArgument)); + bind_obj(this, &AssemblyWriter::printArgument)); } else { // Loop over the arguments, printing them... const FunctionType *MT = M->getFunctionType(); @@ -432,10 +433,10 @@ void AssemblyWriter::printFunction(const Function *M) { Table.purgeFunction(); } -// printFunctionArgument - This member is called for every argument that +// printArgument - This member is called for every argument that // is passed into the function. Simply print it out // -void AssemblyWriter::printFunctionArgument(const FunctionArgument *Arg) { +void AssemblyWriter::printArgument(const Argument *Arg) { // Insert commas as we go... the first arg doesn't get a comma if (Arg != Arg->getParent()->getArgumentList().front()) Out << ", "; @@ -679,7 +680,7 @@ void Type::print(std::ostream &o) const { o << getDescription(); } -void FunctionArgument::print(std::ostream &o) const { +void Argument::print(std::ostream &o) const { o << getType() << " " << getName(); } @@ -710,7 +711,7 @@ CachedWriter &CachedWriter::operator<<(const Value *V) { case Value::ConstantVal: Out << " "; AW->write(V->getType()); Out << " " << cast<Constant>(V)->getStrValue(); break; - case Value::FunctionArgumentVal: + case Value::ArgumentVal: AW->write(V->getType()); Out << " " << V->getName(); break; case Value::TypeVal: AW->write(cast<const Type>(V)); break; case Value::InstructionVal: AW->write(cast<Instruction>(V)); break; diff --git a/lib/VMCore/Linker.cpp b/lib/VMCore/Linker.cpp index 9637f74..086c6c6 100644 --- a/lib/VMCore/Linker.cpp +++ b/lib/VMCore/Linker.cpp @@ -18,6 +18,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/iOther.h" #include "llvm/ConstantVals.h" +#include "llvm/Argument.h" #include <iostream> using std::cerr; using std::string; @@ -301,10 +302,10 @@ static bool LinkFunctionBody(Function *Dest, const Function *Src, for (Function::ArgumentListType::const_iterator I = Src->getArgumentList().begin(), E = Src->getArgumentList().end(); I != E; ++I) { - const FunctionArgument *SMA = *I; + const Argument *SMA = *I; // Create the new method argument and add to the dest method... - FunctionArgument *DMA = new FunctionArgument(SMA->getType(),SMA->getName()); + Argument *DMA = new Argument(SMA->getType(), SMA->getName()); Dest->getArgumentList().push_back(DMA); // Add a mapping to our local map diff --git a/lib/VMCore/SlotCalculator.cpp b/lib/VMCore/SlotCalculator.cpp index 4a8312e..8bd0b49 100644 --- a/lib/VMCore/SlotCalculator.cpp +++ b/lib/VMCore/SlotCalculator.cpp @@ -19,6 +19,7 @@ #include "llvm/iOther.h" #include "llvm/DerivedTypes.h" #include "llvm/SymbolTable.h" +#include "llvm/Argument.h" #include "Support/DepthFirstIterator.h" #include "Support/STLExtras.h" #include <algorithm> |