summaryrefslogtreecommitdiffstats
path: root/lldb/source/Symbol/Function.cpp
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2015-09-30 23:12:22 +0000
committerEnrico Granata <egranata@apple.com>2015-09-30 23:12:22 +0000
commit6754e04f6d9474c918371982e4c88d987adc9ff4 (patch)
treea5fce8bb9166e79da25bc5e03f51e308a3eba156 /lldb/source/Symbol/Function.cpp
parent6dec87a8a08b715a63347f595ecab0318b6564ea (diff)
downloadbcm5719-llvm-6754e04f6d9474c918371982e4c88d987adc9ff4.tar.gz
bcm5719-llvm-6754e04f6d9474c918371982e4c88d987adc9ff4.zip
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
Diffstat (limited to 'lldb/source/Symbol/Function.cpp')
-rw-r--r--lldb/source/Symbol/Function.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lldb/source/Symbol/Function.cpp b/lldb/source/Symbol/Function.cpp
index 69f89968a5c..33cc0c4e264 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 @@ Function::GetIsOptimized ()
return result;
}
+bool
+Function::IsTopLevelFunction ()
+{
+ bool result = false;
+
+ if (Language* language = Language::FindPlugin(GetLanguage()))
+ result = language->IsTopLevelFunction(*this);
+
+ return result;
+}
+
ConstString
Function::GetDisplayName () const
{
OpenPOWER on IntegriCloud