Introudce a IsTopLevelFunction() API on Language and Function
This is meant to support languages that have a scripting mode with top-level code that acts as global
For now, this flag only controls whether 'frame variable' will attempt to treat globals as locals when within such a function
llvm-svn: 248960
diff --git a/lldb/source/Symbol/Function.cpp b/lldb/source/Symbol/Function.cpp
index 69f8996..33cc0c4 100644
--- a/lldb/source/Symbol/Function.cpp
+++ b/lldb/source/Symbol/Function.cpp
@@ -17,6 +17,7 @@
#include "lldb/Symbol/LineTable.h"
#include "lldb/Symbol/SymbolFile.h"
#include "lldb/Symbol/SymbolVendor.h"
+#include "lldb/Target/Language.h"
#include "llvm/Support/Casting.h"
using namespace lldb;
@@ -481,6 +482,17 @@
return result;
}
+bool
+Function::IsTopLevelFunction ()
+{
+ bool result = false;
+
+ if (Language* language = Language::FindPlugin(GetLanguage()))
+ result = language->IsTopLevelFunction(*this);
+
+ return result;
+}
+
ConstString
Function::GetDisplayName () const
{