mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-28 06:58:19 +00:00
Handle more cases in the linker
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1771 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6374a52253
commit
e0f2753bb8
@ -130,8 +130,7 @@ bool CleanupGCCOutput::PatchUpMethodReferences(Module *M) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Methods[i] && (!Methods[i]->getMethodType()->isVarArg() ||
|
if (Methods[i] && (!Methods[i]->getMethodType()->isVarArg())) {
|
||||||
Methods[i]->getMethodType()->getParamTypes().size())) {
|
|
||||||
if (Concrete) { // Found two different methods types. Can't choose
|
if (Concrete) { // Found two different methods types. Can't choose
|
||||||
Concrete = 0;
|
Concrete = 0;
|
||||||
break;
|
break;
|
||||||
@ -158,10 +157,27 @@ bool CleanupGCCOutput::PatchUpMethodReferences(Module *M) {
|
|||||||
for (unsigned i = 0; i < Methods.size(); ++i)
|
for (unsigned i = 0; i < Methods.size(); ++i)
|
||||||
if (Methods[i] != Concrete) {
|
if (Methods[i] != Concrete) {
|
||||||
Method *Old = Methods[i];
|
Method *Old = Methods[i];
|
||||||
|
const MethodType *OldMT = Old->getMethodType();
|
||||||
|
const MethodType *ConcreteMT = Concrete->getMethodType();
|
||||||
|
bool Broken = false;
|
||||||
|
|
||||||
assert(Old->getReturnType() == Concrete->getReturnType() &&
|
assert(Old->getReturnType() == Concrete->getReturnType() &&
|
||||||
"Differing return types not handled yet!");
|
"Differing return types not handled yet!");
|
||||||
assert(Old->getMethodType()->getParamTypes().size() == 0 &&
|
assert(OldMT->getParamTypes().size() <=
|
||||||
"Cannot handle varargs fn's with specified element types!");
|
ConcreteMT->getParamTypes().size() &&
|
||||||
|
"Concrete type must have more specified parameters!");
|
||||||
|
|
||||||
|
// Check to make sure that if there are specified types, that they
|
||||||
|
// match...
|
||||||
|
//
|
||||||
|
for (unsigned i = 0; i < OldMT->getParamTypes().size(); ++i)
|
||||||
|
if (OldMT->getParamTypes()[i] != ConcreteMT->getParamTypes()[i]) {
|
||||||
|
cerr << "Parameter types conflict for" << OldMT
|
||||||
|
<< " and " << ConcreteMT;
|
||||||
|
Broken = true;
|
||||||
|
}
|
||||||
|
if (Broken) break; // Can't process this one!
|
||||||
|
|
||||||
|
|
||||||
// Attempt to convert all of the uses of the old method to the
|
// Attempt to convert all of the uses of the old method to the
|
||||||
// concrete form of the method. If there is a use of the method
|
// concrete form of the method. If there is a use of the method
|
||||||
|
Loading…
Reference in New Issue
Block a user