diff options
author | Keno Fischer <kfischer@college.harvard.edu> | 2015-01-27 19:29:00 +0000 |
---|---|---|
committer | Keno Fischer <kfischer@college.harvard.edu> | 2015-01-27 19:29:00 +0000 |
commit | 5f92a08fc051d921f75af0cab01ce6a5b255b9c4 (patch) | |
tree | 73c7be64de5fffb63c8af12ee74ffacb2b106f01 /llvm/lib | |
parent | b1e72eca0caf9bb10d66577573d4845557e61c25 (diff) | |
download | bcm5719-llvm-5f92a08fc051d921f75af0cab01ce6a5b255b9c4.tar.gz bcm5719-llvm-5f92a08fc051d921f75af0cab01ce6a5b255b9c4.zip |
[ExecutionEngine] FindFunctionNamed: Skip declarations
Summary:
Basically all other methods that look up functions by name skip them if they are mere declarations.
Do the same in FindFunctionNamed.
Reviewers: lhames
Reviewed By: lhames
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D7068
llvm-svn: 227227
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/ExecutionEngine/ExecutionEngine.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp index 8be399e510e..12e0e6aee6e 100644 --- a/llvm/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/llvm/lib/ExecutionEngine/ExecutionEngine.cpp @@ -142,7 +142,8 @@ bool ExecutionEngine::removeModule(Module *M) { Function *ExecutionEngine::FindFunctionNamed(const char *FnName) { for (unsigned i = 0, e = Modules.size(); i != e; ++i) { - if (Function *F = Modules[i]->getFunction(FnName)) + Function *F = Modules[i]->getFunction(FnName); + if (F && !F->isDeclaration()) return F; } return nullptr; diff --git a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp index f41f6b4fcf6..b0cfb2c827f 100644 --- a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp +++ b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp @@ -408,7 +408,8 @@ Function *MCJIT::FindFunctionNamedInModulePtrSet(const char *FnName, ModulePtrSet::iterator I, ModulePtrSet::iterator E) { for (; I != E; ++I) { - if (Function *F = (*I)->getFunction(FnName)) + Function *F = (*I)->getFunction(FnName); + if (F && !F->isDeclaration()) return F; } return nullptr; |