mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-19 08:35:45 +00:00
Start using the new and improve interface to FunctionType arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11224 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -58,7 +58,7 @@ static bool ResolveFunctions(Module &M, std::vector<GlobalValue*> &Globals,
|
||||
const FunctionType *OldMT = Old->getFunctionType();
|
||||
const FunctionType *ConcreteMT = Concrete->getFunctionType();
|
||||
|
||||
if (OldMT->getParamTypes().size() > ConcreteMT->getParamTypes().size() &&
|
||||
if (OldMT->getNumParams() > ConcreteMT->getNumParams() &&
|
||||
!ConcreteMT->isVarArg())
|
||||
if (!Old->use_empty()) {
|
||||
std::cerr << "WARNING: Linking function '" << Old->getName()
|
||||
@@ -73,14 +73,14 @@ 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->getParamTypes().size(),
|
||||
ConcreteMT->getParamTypes().size());
|
||||
unsigned NumArguments = std::min(OldMT->getNumParams(),
|
||||
ConcreteMT->getNumParams());
|
||||
|
||||
if (!Old->use_empty() && !Concrete->use_empty())
|
||||
for (unsigned i = 0; i < NumArguments; ++i)
|
||||
if (OldMT->getParamTypes()[i] != ConcreteMT->getParamTypes()[i])
|
||||
if (OldMT->getParamTypes()[i]->getPrimitiveID() !=
|
||||
ConcreteMT->getParamTypes()[i]->getPrimitiveID()) {
|
||||
if (OldMT->getParamType(i) != ConcreteMT->getParamType(i))
|
||||
if (OldMT->getParamType(i)->getPrimitiveID() !=
|
||||
ConcreteMT->getParamType(i)->getPrimitiveID()) {
|
||||
std::cerr << "WARNING: Function [" << Old->getName()
|
||||
<< "]: Parameter types conflict for: '";
|
||||
WriteTypeSymbolic(std::cerr, OldMT, &M);
|
||||
@@ -231,7 +231,7 @@ static bool ProcessGlobalsWithSameName(Module &M, TargetData &TD,
|
||||
if ((ConcreteF->getReturnType() == OtherF->getReturnType() ||
|
||||
CallersAllIgnoreReturnValue(*OtherF)) &&
|
||||
OtherF->getFunctionType()->isVarArg() &&
|
||||
OtherF->getFunctionType()->getParamTypes().empty())
|
||||
OtherF->getFunctionType()->getNumParams() == 0)
|
||||
DontPrintWarning = true;
|
||||
|
||||
// Otherwise, if the non-concrete global is a global array variable with a
|
||||
|
||||
Reference in New Issue
Block a user