Fixed the logic in IRForTarget that recognizes
externally-defined variables to match up with
the code in ClangASTSource that produces them.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@119750 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/IRForTarget.cpp b/source/Expression/IRForTarget.cpp
index c3379a1..6dd72e7 100644
--- a/source/Expression/IRForTarget.cpp
+++ b/source/Expression/IRForTarget.cpp
@@ -362,9 +362,7 @@
CFSCWB_arguments.end(),
"CFStringCreateWithBytes",
FirstEntryInstruction);
-
- Constant *initializer = NSStr->getInitializer();
-
+
if (!UnfoldConstant(NSStr, CFSCWB_call, FirstEntryInstruction))
{
if (log)
@@ -1089,11 +1087,13 @@
IRForTarget::resolveExternals(Module &M,
Function &F)
{
+ lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
+
for (Module::global_iterator global = M.global_begin(), end = M.global_end();
global != end;
++global)
{
- if ((*global).hasExternalLinkage() &&
+ if (DeclForGlobalValue(M, global) &&
!MaybeHandleVariable (M, global))
return false;
}