OpenADFortTk (basic)
xaif2whirl::XlateExpression Class Reference

#include <XlateExpression.h>

List of all members.

Static Public Member Functions

static WN * translateExpression (const xercesc::DOMElement *elem, PUXlationContext &ctxt)
static WN * translateExpressionSimple (const xercesc::DOMElement *elem, PUXlationContext &ctxt)
static WN * translateVarRef (const xercesc::DOMElement *elem, PUXlationContext &ctxt)
static std::pair< ST *, WN_OFFSET > translateVarRefSimple (const xercesc::DOMElement *elem, PUXlationContext &ctxt)
static WN * patchWNExpr (WN *parent, INT kidno, PUXlationContext &ctxt)
static WN * translateConstant (const xercesc::DOMElement *elem, PUXlationContext &ctxt)
static WN * createValueSelector (WN *wn)

Static Private Member Functions

static bool hasActiveSymbolType (WN *aWNp)
static WN * xlate_Expression (OA::OA_ptr< OA::DGraph::DGraphImplement > g, OA::OA_ptr< MyDGNode > n, PUXlationContext &ctxt)
static WN * xlate_VarRef (const xercesc::DOMElement *elem, PUXlationContext &ctxt)
static WN * xlate_VarRef (OA::OA_ptr< OA::DGraph::DGraphImplement > g, OA::OA_ptr< MyDGNode > n, PUXlationContext &ctxt)
static WN * xlate_Intrinsic (OA::OA_ptr< OA::DGraph::DGraphImplement > g, OA::OA_ptr< MyDGNode > n, PUXlationContext &ctxt)
static WN * xlate_FunctionCall (OA::OA_ptr< OA::DGraph::DGraphImplement > g, OA::OA_ptr< MyDGNode > n, PUXlationContext &ctxt)
static WN * xlate_BooleanOperation (OA::OA_ptr< OA::DGraph::DGraphImplement > g, OA::OA_ptr< MyDGNode > n, PUXlationContext &ctxt)
static WN * xlate_ExprOpUsingIntrinsicTable (fortTkSupport::IntrinsicXlationTable::XAIFOpr xopr, const char *xoprNm, const char *xIntrinKey, OA::OA_ptr< OA::DGraph::DGraphImplement > g, OA::OA_ptr< MyDGNode > n, PUXlationContext &ctxt)
static WN * xlate_SymbolReference (const xercesc::DOMElement *elem, PUXlationContext &ctxt)
static pair< ST *, WN_OFFSET > xlate_SymbolReferenceSimple (const xercesc::DOMElement *elem, PUXlationContext &ctxt)
static WN * xlate_SymbolReferenceCollapsedPath (const xercesc::DOMElement *elem, WN *pathVorlageWN, PUXlationContext &ctxt)
static WN * xlate_ArrayElementReference (OA::OA_ptr< OA::DGraph::DGraphImplement > g, OA::OA_ptr< MyDGNode > n, PUXlationContext &ctxt)
static OA::OA_ptr
< OA::DGraph::DGraphImplement > 
createExpressionGraph (const xercesc::DOMElement *elem, bool varRef=false)
static WN * createDerivSelector (WN *wn)
static TYPE_ID getRType (WN *wn)
static TYPE_ID getRTypeFromOpands (vector< WN * > &opands)
static TYPE_ID getRTypeFromOpands (TYPE_ID ty1, TYPE_ID ty2)
static TYPE_ID getMType (unsigned int cl, unsigned int bytesz)
static OPCODE getWNExprOpcode (OPERATOR opr, vector< WN * > &opands)
static INTRINSIC getWNIntrinsic (const char *intrnNm, vector< WN * > &opands, TYPE_ID *dtype)

Detailed Description

Definition at line 25 of file XlateExpression.h.


Member Function Documentation

WN * xaif2whirl::XlateExpression::createDerivSelector ( WN *  wn) [static, private]

createDerivSelector: Select the deriv portion of 'wn', by wrapping a dummy intrinsic call around it N.B.: This creates a OPR_CALL node, which is not an expression.

Definition at line 930 of file XlateExpression.cxx.

References xaif2whirl::CreateCallToIntrin(), xaif2whirl::CreateParm(), and getRType().

Referenced by translateVarRef().

Here is the call graph for this function:

OA::OA_ptr< OA::DGraph::DGraphImplement > xaif2whirl::XlateExpression::createExpressionGraph ( const xercesc::DOMElement *  elem,
bool  varRef = false 
) [static, private]

createExpressionGraph: Given the first element in an XAIF expression or variable reference graph, returns a DGraph where where graph nodes point to nodes in the DOM tree. Variable reference graphs are special cases of an expression graph.

When walking a top-down graph from root to children, one descends *incoming* edges. Here is an example expression:

mult <== x * (y + z) ^ ^ / \ x plus ^ ^ / \ y z

Here is an example variable reference:

ArrayElementReference <== A[1, i] Index: Constant: 1 Index: SymbolReference: i ^ | SymbolReference: A

Definition at line 876 of file XlateExpression.cxx.

References XAIFStringRepository::attr_source_x(), XAIFStringRepository::attr_target_x(), XAIFStringRepository::attr_Vid_x(), xaif2whirl::XercesStrX::c_str(), XAIFStringRepository::elem_ExprEdge_x(), XAIFStringRepository::elem_VarRefEdge_x(), FORTTK_ASSERT, xaif2whirl::GetNextSiblingElement(), xaif2whirl::MyDGNode::resetIds(), and XAIFStrings.

Referenced by translateExpression(), and translateVarRef().

Here is the call graph for this function:

createValueSelector: Select the value portion of 'wn', by wrapping a dummy intrinsic call around it N.B.: This creates a OPR_CALL node, which is not an expression.

Definition at line 923 of file XlateExpression.cxx.

References xaif2whirl::CreateCallToIntrin(), xaif2whirl::CreateParm(), and getRType().

Referenced by xaif2whirl::AdjustFunctions::forSubTree(), patchWNExpr(), and translateVarRef().

Here is the call graph for this function:

TYPE_ID xaif2whirl::XlateExpression::getMType ( unsigned int  cl,
unsigned int  bytesz 
) [static, private]

Scan Machine_Types table for the right type.

Definition at line 1020 of file XlateExpression.cxx.

Referenced by getRTypeFromOpands(), getWNExprOpcode(), and xlate_ExprOpUsingIntrinsicTable().

TYPE_ID xaif2whirl::XlateExpression::getRType ( WN *  wn) [static, private]

Definition at line 937 of file XlateExpression.cxx.

References FORTTK_ASSERT, and WN_Tree_Type().

Referenced by createDerivSelector(), and createValueSelector().

Here is the call graph for this function:

TYPE_ID xaif2whirl::XlateExpression::getRTypeFromOpands ( vector< WN * > &  opands) [static, private]

Definition at line 956 of file XlateExpression.cxx.

References FORTTK_ASSERT, fortTkSupport::Diagnostics::UnexpectedInput, and WN_Tree_Type().

Referenced by getWNExprOpcode(), and getWNIntrinsic().

Here is the call graph for this function:

TYPE_ID xaif2whirl::XlateExpression::getRTypeFromOpands ( TYPE_ID  ty1,
TYPE_ID  ty2 
) [static, private]

Definition at line 980 of file XlateExpression.cxx.

References getMType().

Here is the call graph for this function:

OPCODE xaif2whirl::XlateExpression::getWNExprOpcode ( OPERATOR  opr,
vector< WN * > &  opands 
) [static, private]

Definition at line 1031 of file XlateExpression.cxx.

References getMType(), and getRTypeFromOpands().

Referenced by xlate_ExprOpUsingIntrinsicTable().

Here is the call graph for this function:

INTRINSIC xaif2whirl::XlateExpression::getWNIntrinsic ( const char *  intrnNm,
vector< WN * > &  opands,
TYPE_ID *  dtype 
) [static, private]

Definition at line 1064 of file XlateExpression.cxx.

References FORTTK_ASSERT, and getRTypeFromOpands().

Referenced by xlate_ExprOpUsingIntrinsicTable().

Here is the call graph for this function:

bool xaif2whirl::XlateExpression::hasActiveSymbolType ( WN *  aWNp) [static, private]

Definition at line 121 of file XlateExpression.cxx.

References xaif2whirl::ActiveTypeInitializedTyIdx, xaif2whirl::ActiveTypeTyIdx, SexpTags::ST, and WN_GetBaseObjType().

Referenced by patchWNExpr().

Here is the call graph for this function:

WN * xaif2whirl::XlateExpression::patchWNExpr ( WN *  parent,
INT  kidno,
PUXlationContext ctxt 
) [static]

FIXME: this can use the parent map that is in ctxt now. The new signature could be: PatchWNExpr(WN* wn, PUXlationContext& ctxt)

PatchWNExpr: Descends through the expression rooted at WN_kid(parent, kidno), modifying variable references with a value-component selector.

This function purposefully only operates on expressions (as opposed to arbitrary WHIRL trees) because statements have to be processed specially.

Definition at line 96 of file XlateExpression.cxx.

References createValueSelector(), hasActiveSymbolType(), and fortTkSupport::ScalarizedRef::isRefTranslatableToXAIF().

Referenced by xaif2whirl::XlateStmt::patchWN_IO_ITEM_list(), xaif2whirl::XlateStmt::patchWNStmt(), and xaif2whirl::xlate_BBCond_OLD().

Here is the call graph for this function:

WN * xaif2whirl::XlateExpression::translateExpressionSimple ( const xercesc::DOMElement *  elem,
PUXlationContext ctxt 
) [static]

TranslateExpressionSimple: Translates certain XAIF expressions into special WHIRL expressions in order to conform to WHIRL requirements.

Definition at line 44 of file XlateExpression.cxx.

References xaif2whirl::PUXlationContext::createXlationContext(), xaif2whirl::PUXlationContext::deleteXlationContext(), xaif2whirl::XlationContext::EXPRSIMPLE, and translateExpression().

Referenced by xaif2whirl::xlate_CFGstruct(), and xaif2whirl::xlate_CFGunstruct().

Here is the call graph for this function:

std::pair< ST *, WN_OFFSET > xaif2whirl::XlateExpression::translateVarRefSimple ( const xercesc::DOMElement *  elem,
PUXlationContext ctxt 
) [static]

TranslateSimpleVarRef: Given the first node in a simple variable reference graph, create a variable reference. No value/deriv selector can be created.

Definition at line 81 of file XlateExpression.cxx.

References xaif2whirl::PUXlationContext::createXlationContext(), xaif2whirl::PUXlationContext::deleteXlationContext(), XAIFStringRepository::elem_SymRef_x(), FORTTK_ASSERT, FORTTK_DIE, xaif2whirl::GetNextSiblingElement(), xaif2whirl::XlationContext::NOFLAG, fortTkSupport::Diagnostics::UnexpectedInput, XAIFStrings, and xlate_SymbolReferenceSimple().

Referenced by xaif2whirl::XlateStmt::translateAssignmentSimple().

Here is the call graph for this function:

WN * xaif2whirl::XlateExpression::xlate_BooleanOperation ( OA::OA_ptr< OA::DGraph::DGraphImplement >  g,
OA::OA_ptr< MyDGNode n,
PUXlationContext ctxt 
) [static, private]
WN * xaif2whirl::XlateExpression::xlate_ExprOpUsingIntrinsicTable ( fortTkSupport::IntrinsicXlationTable::XAIFOpr  xopr,
const char *  xoprNm,
const char *  xIntrinKey,
OA::OA_ptr< OA::DGraph::DGraphImplement >  g,
OA::OA_ptr< MyDGNode n,
PUXlationContext ctxt 
) [static, private]
WN * xaif2whirl::XlateExpression::xlate_FunctionCall ( OA::OA_ptr< OA::DGraph::DGraphImplement >  g,
OA::OA_ptr< MyDGNode n,
PUXlationContext ctxt 
) [static, private]
std::pair< ST *, WN_OFFSET > xaif2whirl::XlateExpression::xlate_SymbolReferenceSimple ( const xercesc::DOMElement *  elem,
PUXlationContext ctxt 
) [static, private]

xlate_SymbolReferenceSimple: Translate a simple symbol reference. For pregs, also return the PREG_IDX as an WN_OFFSET. Do not set an active flag.

Definition at line 651 of file XlateExpression.cxx.

References xaif2whirl::GetPregId(), fortTkSupport::Symbol::GetST(), xaif2whirl::GetSymbol(), and SexpTags::ST.

Referenced by translateVarRefSimple().

Here is the call graph for this function:

static WN* xaif2whirl::XlateExpression::xlate_VarRef ( const xercesc::DOMElement *  elem,
PUXlationContext ctxt 
) [static, private]
WN * xaif2whirl::XlateExpression::xlate_VarRef ( OA::OA_ptr< OA::DGraph::DGraphImplement >  g,
OA::OA_ptr< MyDGNode n,
PUXlationContext ctxt 
) [static, private]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines