mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 19:12:56 +02:00
Make Module::getNamedFunction prefer non-external functions if there is more than
one function of the same name llvm-svn: 7274
This commit is contained in:
parent
fc4a57d904
commit
d285263cd3
@ -172,10 +172,14 @@ Function *Module::getMainFunction() {
|
||||
///
|
||||
Function *Module::getNamedFunction(const std::string &Name) {
|
||||
// Loop over all of the functions, looking for the function desired
|
||||
Function *Found = 0;
|
||||
for (iterator I = begin(), E = end(); I != E; ++I)
|
||||
if (I->getName() == Name)
|
||||
return I;
|
||||
return 0; // function not found...
|
||||
if (I->isExternal())
|
||||
Found = I;
|
||||
else
|
||||
return I;
|
||||
return Found; // Non-external function not found...
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user