#include "llvm/DerivedTypes.h"
#include "llvm/iOther.h"
#include "llvm/ConstantVals.h"
+#include "llvm/Argument.h"
#include <iostream>
using std::cerr;
using std::string;
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.
static void PrintMap(const map<const Value*, Value*> &M) {
for (map<const Value*, Value*>::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";
}
}
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;
}
// Check to make sure the method is not defined in both modules...
if (!SM->isExternal() && !DM->isExternal())
return Error(Err, "Function '" +
- SM->getMethodType()->getDescription() + "':\"" +
+ SM->getFunctionType()->getDescription() + "':\"" +
SM->getName() + "\" - Function is already defined!");
// Otherwise, just remember this mapping...
} else {
// Function does not already exist, simply insert an external method
// signature identical to SM into the dest module...
- Function *DM = new Function(SM->getMethodType(), SM->hasInternalLinkage(),
+ Function *DM = new Function(SM->getFunctionType(),
+ SM->hasInternalLinkage(),
SM->getName());
// Add the method signature to the dest module...
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