forked from OSchip/llvm-project
Change ValueObject::IsLogicalTrue so that it starts by asking the applicable Language plugin before using the C-style rule
llvm-svn: 251838
This commit is contained in:
parent
b1d4a39990
commit
407b5c62ba
|
@ -119,6 +119,10 @@ public:
|
|||
virtual DumpValueObjectOptions::DeclPrintingHelper
|
||||
GetDeclPrintingHelper ();
|
||||
|
||||
virtual LazyBool
|
||||
IsLogicalTrue (ValueObject& valobj,
|
||||
Error& error);
|
||||
|
||||
// These are accessors for general information about the Languages lldb knows about:
|
||||
|
||||
static lldb::LanguageType
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
#include "lldb/Symbol/Type.h"
|
||||
|
||||
#include "lldb/Target/ExecutionContext.h"
|
||||
#include "lldb/Target/Language.h"
|
||||
#include "lldb/Target/LanguageRuntime.h"
|
||||
#include "lldb/Target/ObjCLanguageRuntime.h"
|
||||
#include "lldb/Target/Process.h"
|
||||
|
@ -515,6 +516,20 @@ ValueObject::ResolveValue (Scalar &scalar)
|
|||
bool
|
||||
ValueObject::IsLogicalTrue (Error& error)
|
||||
{
|
||||
if (Language *language = Language::FindPlugin(GetObjectRuntimeLanguage()))
|
||||
{
|
||||
LazyBool is_logical_true = language->IsLogicalTrue(*this, error);
|
||||
switch (is_logical_true)
|
||||
{
|
||||
case eLazyBoolYes:
|
||||
case eLazyBoolNo:
|
||||
return (is_logical_true == true);
|
||||
case eLazyBoolCalculate:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Scalar scalar_value;
|
||||
|
||||
if (!ResolveValue (scalar_value))
|
||||
|
|
|
@ -351,6 +351,13 @@ Language::GetDeclPrintingHelper ()
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
LazyBool
|
||||
Language::IsLogicalTrue (ValueObject& valobj,
|
||||
Error& error)
|
||||
{
|
||||
return eLazyBoolCalculate;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
// Constructor
|
||||
//----------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue