aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/FunctionResolution.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2005-12-13 19:56:51 +0000
committerReid Spencer <rspencer@reidspencer.com>2005-12-13 19:56:51 +0000
commit2f1890792c5da3692167050f6156f48634c2c6b8 (patch)
tree327ea736bb11ed384004211d31456ea96d42a745 /lib/Transforms/IPO/FunctionResolution.cpp
parent86cb643801be1308ba1da7db774b64852a119e94 (diff)
Improve ResolveFunctions to:
a) use better local variable names (OldMT -> OldFT) where "M" is used to mean "Function" (perhaps it was previously "Method"?) b) print out the module identifier in a warning message so that it is possible to track down in which module the error occurred. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24698 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/FunctionResolution.cpp')
-rw-r--r--lib/Transforms/IPO/FunctionResolution.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/lib/Transforms/IPO/FunctionResolution.cpp b/lib/Transforms/IPO/FunctionResolution.cpp
index 8b5019a0af..ff1a302712 100644
--- a/lib/Transforms/IPO/FunctionResolution.cpp
+++ b/lib/Transforms/IPO/FunctionResolution.cpp
@@ -55,11 +55,11 @@ static bool ResolveFunctions(Module &M, std::vector<GlobalValue*> &Globals,
for (unsigned i = 0; i != Globals.size(); ++i)
if (Globals[i] != Concrete) {
Function *Old = cast<Function>(Globals[i]);
- const FunctionType *OldMT = Old->getFunctionType();
- const FunctionType *ConcreteMT = Concrete->getFunctionType();
+ const FunctionType *OldFT = Old->getFunctionType();
+ const FunctionType *ConcreteFT = Concrete->getFunctionType();
- if (OldMT->getNumParams() > ConcreteMT->getNumParams() &&
- !ConcreteMT->isVarArg())
+ if (OldFT->getNumParams() > ConcreteFT->getNumParams() &&
+ !ConcreteFT->isVarArg())
if (!Old->use_empty()) {
std::cerr << "WARNING: Linking function '" << Old->getName()
<< "' is causing arguments to be dropped.\n";
@@ -73,20 +73,22 @@ static bool ResolveFunctions(Module &M, std::vector<GlobalValue*> &Globals,
// Check to make sure that if there are specified types, that they
// match...
//
- unsigned NumArguments = std::min(OldMT->getNumParams(),
- ConcreteMT->getNumParams());
+ unsigned NumArguments = std::min(OldFT->getNumParams(),
+ ConcreteFT->getNumParams());
if (!Old->use_empty() && !Concrete->use_empty())
for (unsigned i = 0; i < NumArguments; ++i)
- if (OldMT->getParamType(i) != ConcreteMT->getParamType(i))
- if (OldMT->getParamType(i)->getTypeID() !=
- ConcreteMT->getParamType(i)->getTypeID()) {
+ if (OldFT->getParamType(i) != ConcreteFT->getParamType(i))
+ if (OldFT->getParamType(i)->getTypeID() !=
+ ConcreteFT->getParamType(i)->getTypeID()) {
std::cerr << "WARNING: Function [" << Old->getName()
<< "]: Parameter types conflict for: '";
- WriteTypeSymbolic(std::cerr, OldMT, &M);
- std::cerr << "' and '";
- WriteTypeSymbolic(std::cerr, ConcreteMT, &M);
- std::cerr << "'\n";
+ WriteTypeSymbolic(std::cerr, OldFT, &M);
+ std::cerr << "' (in "
+ << Old->getParent()->getModuleIdentifier() << ") and '";
+ WriteTypeSymbolic(std::cerr, ConcreteFT, &M);
+ std::cerr << "'(in "
+ << Concrete->getParent()->getModuleIdentifier() << ")\n";
return Changed;
}