diff options
| author | Enrico Granata <egranata@apple.com> | 2015-09-30 23:12:22 +0000 |
|---|---|---|
| committer | Enrico Granata <egranata@apple.com> | 2015-09-30 23:12:22 +0000 |
| commit | 6754e04f6d9474c918371982e4c88d987adc9ff4 (patch) | |
| tree | a5fce8bb9166e79da25bc5e03f51e308a3eba156 /lldb/source/Symbol/Function.cpp | |
| parent | 6dec87a8a08b715a63347f595ecab0318b6564ea (diff) | |
| download | bcm5719-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.cpp | 12 |
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 { |

