X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FTransforms%2FUtils%2FLinker.cpp;h=086c6c6b28f062fc4b897297a6f37989ac20cbfb;hb=b9ddce65c281f023780d2b6578e7ed6d2913a2cb;hp=f3955c89b44766444999d32502e399d83be981e4;hpb=6bfd6a578a3a4fa95c585c988ee712ba880f9923;p=oota-llvm.git diff --git a/lib/Transforms/Utils/Linker.cpp b/lib/Transforms/Utils/Linker.cpp index f3955c89b44..086c6c6b28f 100644 --- a/lib/Transforms/Utils/Linker.cpp +++ b/lib/Transforms/Utils/Linker.cpp @@ -18,6 +18,7 @@ #include "llvm/DerivedTypes.h" #include "llvm/iOther.h" #include "llvm/ConstantVals.h" +#include "llvm/Argument.h" #include using std::cerr; using std::string; @@ -31,9 +32,6 @@ static inline bool Error(string *E, string Message) { return true; } -#include "llvm/Assembly/Writer.h" // TODO: REMOVE - - // LinkTypes - Go through the symbol table of the Src module and see if any // types are named in the src module that are not named in the Dst module. // Make sure there are no type name conflicts. @@ -74,8 +72,11 @@ static bool LinkTypes(Module *Dest, const Module *Src, string *Err = 0) { static void PrintMap(const map &M) { for (map::const_iterator I = M.begin(), E = M.end(); I != E; ++I) { - cerr << " Fr: " << (void*)I->first << " " << I->first - << " To: " << (void*)I->second << " " << I->second << "\n"; + cerr << " Fr: " << (void*)I->first << " "; + I->first->dump(); + cerr << " To: " << (void*)I->second << " "; + I->second->dump(); + cerr << "\n"; } } @@ -137,7 +138,9 @@ static Value *RemapOperand(const Value *In, map &LocalMap, PrintMap(*GlobalMap); } - cerr << "Couldn't remap value: " << (void*)In << " " << In << "\n"; + cerr << "Couldn't remap value: " << (void*)In << " "; + In->dump(); + cerr << "\n"; assert(0 && "Couldn't remap value!"); return 0; } @@ -299,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