MCPcopy Create free account
hub / github.com/beefytech/Beef / EvalCondition

Method EvalCondition

IDEHelper/Compiler/CeDebugger.cpp:1989–2018  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1987}
1988
1989bool CeDebugger::EvalCondition(DebugVisualizerEntry* debugVis, BfTypedValue typedVal, CeFormatInfo& formatInfo, const StringImpl& condition, const Array<String>& dbgVisWildcardCaptures, String& errorStr)
1990{
1991 auto ceModule = mCeMachine->mCeModule;
1992
1993 CeFormatInfo displayStrFormatInfo = formatInfo;
1994 displayStrFormatInfo.mHidePointers = false;
1995 displayStrFormatInfo.mRawString = false;
1996
1997 String errors;
1998 const String conditionStr = mDebugManager->mDebugVisualizers->DoStringReplace(condition, dbgVisWildcardCaptures);
1999 BfTypedValue evalResult = EvaluateInContext(typedVal, conditionStr, &displayStrFormatInfo, NULL, &errors);
2000 if ((!evalResult) || (!evalResult.mType->IsBoolean()))
2001 {
2002 if (formatInfo.mRawString)
2003 return false;
2004
2005 errorStr += "<DbgVis Failed>";
2006 DbgVisFailed(debugVis, conditionStr, errors);
2007 return false;
2008 }
2009
2010 evalResult = ceModule->LoadValue(evalResult);
2011 if (auto constant = ceModule->mBfIRBuilder->GetConstant(evalResult.mValue))
2012 {
2013 if (constant->mTypeCode == BfTypeCode_Boolean)
2014 return constant->mBool;
2015 }
2016
2017 return false;
2018}
2019
2020String CeDebugger::GetArrayItems(DebugVisualizerEntry* debugVis, BfType* valueType, BfTypedValue& curNode, int& count, String* outContinuationData)
2021{

Callers

nothing calls this directly

Calls 4

DoStringReplaceMethod · 0.80
LoadValueMethod · 0.80
IsBooleanMethod · 0.45
GetConstantMethod · 0.45

Tested by

no test coverage detected