Added support for calling functions from expressions.
Right now we mock up the function as a variadic
function when generating the IR for the call; we need
to eventually make the function be the right type if
the type is available.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@109543 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/ClangExpressionDeclMap.cpp b/source/Expression/ClangExpressionDeclMap.cpp
index c26b77d..694c59d 100644
--- a/source/Expression/ClangExpressionDeclMap.cpp
+++ b/source/Expression/ClangExpressionDeclMap.cpp
@@ -182,8 +182,10 @@
return true;
}
-uint64_t
-ClangExpressionDeclMap::GetFunctionAddress (const clang::NamedDecl *decl)
+bool
+ClangExpressionDeclMap::GetFunctionInfo (const clang::NamedDecl *decl,
+ llvm::Value**& value,
+ uint64_t &ptr)
{
TupleIterator iter;
@@ -193,11 +195,13 @@
{
if (decl == iter->m_decl)
{
- return iter->m_value->GetScalar().ULongLong();
+ value = &iter->m_llvm_value;
+ ptr = iter->m_value->GetScalar().ULongLong();
+ return true;
}
}
- return 0;
+ return false;
}
// Interface for DwarfExpression
@@ -769,6 +773,7 @@
tuple.m_value = var_location;
tuple.m_user_type = ut;
tuple.m_parser_type = pt;
+ tuple.m_llvm_value = NULL;
m_tuples.push_back(tuple);
@@ -841,6 +846,7 @@
tuple.m_decl = fun_decl;
tuple.m_value = fun_location.release();
tuple.m_user_type = TypeFromUser(fun_opaque_type, fun_ast_context);
+ tuple.m_llvm_value = NULL;
m_tuples.push_back(tuple);