summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/IRForTarget.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2010-09-07 21:49:41 +0000
committerSean Callanan <scallanan@apple.com>2010-09-07 21:49:41 +0000
commit3883b5ae4e08c953aa0175bd4553debb2de43a6e (patch)
treeb2db8be3ba4b5bc3d6b7f9221ab4195a60f80b10 /lldb/source/Expression/IRForTarget.cpp
parent9877af3b46d225f1d953215c316804b87b4c3de2 (diff)
downloadbcm5719-llvm-3883b5ae4e08c953aa0175bd4553debb2de43a6e.tar.gz
bcm5719-llvm-3883b5ae4e08c953aa0175bd4553debb2de43a6e.zip
Improved function lookup to avoid conflicts between
symbols with the same name and no debug information. Also improved the way functions are called so we don't automatically define them as variadic functions in the IR. llvm-svn: 113290
Diffstat (limited to 'lldb/source/Expression/IRForTarget.cpp')
-rw-r--r--lldb/source/Expression/IRForTarget.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/lldb/source/Expression/IRForTarget.cpp b/lldb/source/Expression/IRForTarget.cpp
index b76dd2c5776..6ffc7b977d8 100644
--- a/lldb/source/Expression/IRForTarget.cpp
+++ b/lldb/source/Expression/IRForTarget.cpp
@@ -558,9 +558,15 @@ IRForTarget::MaybeHandleCall(Module &M,
{
if (!m_decl_map->GetFunctionInfo(fun_decl, fun_value_ptr, fun_addr))
{
- if (log)
- log->Printf("Function %s had no address", fun_decl->getNameAsCString());
- return false;
+ fun_value_ptr = NULL;
+
+ if (!m_decl_map->GetFunctionAddress(fun->getName().str().c_str(), fun_addr))
+ {
+ if (log)
+ log->Printf("Function %s had no address", fun->getName().str().c_str());
+
+ return false;
+ }
}
}
else
@@ -580,12 +586,9 @@ IRForTarget::MaybeHandleCall(Module &M,
if (!fun_value_ptr || !*fun_value_ptr)
{
- std::vector<const Type*> params;
-
const IntegerType *intptr_ty = Type::getIntNTy(M.getContext(),
(M.getPointerSize() == Module::Pointer64) ? 64 : 32);
-
- FunctionType *fun_ty = FunctionType::get(intptr_ty, params, true);
+ const FunctionType *fun_ty = fun->getFunctionType();
PointerType *fun_ptr_ty = PointerType::getUnqual(fun_ty);
Constant *fun_addr_int = ConstantInt::get(intptr_ty, fun_addr, false);
fun_addr_ptr = ConstantExpr::getIntToPtr(fun_addr_int, fun_ptr_ty);
OpenPOWER on IntegriCloud