forked from OSchip/llvm-project
We have an issue where if you use a C function right now that has no prototype, it isn't marked as extern "C" and the name to lookup is some C++ mangled form of the name.
This used to be the case for "printf" before a function prototype was added to the builtin expression prefix file. This fix makes sure that if we get a mangled name that we don't find in the current target, that we only fall back to looking up function by basename if the function isn't contained in a namespace or class (no decl context). llvm-svn: 234178
This commit is contained in:
parent
936c56393c
commit
b23c24c2a8
|
@ -599,6 +599,9 @@ ClangExpressionDeclMap::GetFunctionAddress
|
|||
|
||||
CPPLanguageRuntime::MethodName method_name(mangled.GetDemangledName());
|
||||
|
||||
// the C++ context must be empty before we can think of searching for symbol by a simple basename
|
||||
if (method_name.GetContext().empty())
|
||||
{
|
||||
llvm::StringRef basename = method_name.GetBasename();
|
||||
|
||||
if (!basename.empty())
|
||||
|
@ -607,6 +610,7 @@ ClangExpressionDeclMap::GetFunctionAddress
|
|||
sc_list_size = sc_list.GetSize();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lldb::addr_t intern_callable_load_addr = LLDB_INVALID_ADDRESS;
|
||||
|
||||
|
|
Loading…
Reference in New Issue