|
OpenADFortTk (basic)
|
#include <PUXlationContext.h>

PUXlationContext for xaif2whirl: Represents information about a XAIF->WHIRL translation context. Designed to convey information about a parent context to children contexts.
PUXlationContext maintains an internal stack of XlationContexts, allowing users to 1) create new child contexts (push), 2) destroy and return to parent contexts (pop) and 3) query the current context. The current translation context provides information about the containing WHIRL context. There should always be at least one context on the stack. (Upon creation, one context exists on the stack.) Because this class is designed to represent information about one procedure (WHIRL PU) at a time, information that applies for a whole PU is located outside instead of inside the stack.
For xaif2whirl, a translation context for an XAIF construct corresponds to its parent construct. Thus there will be one translation context on the stack for every 'indendation' level. Context flags indicate significant facts about the parent construct and will typically correspond to XAIF concepts (as opposed to WHIRL).
Definition at line 43 of file PUXlationContext.h.
typedef std::list<XlationContext> xaif2whirl::PUXlationContext::XlationContextStack [private] |
Use a list instead a stack so that we can easily examine contents. The top of the stack will be the *front* of the list. (push_front, pop_front).
Definition at line 160 of file PUXlationContext.h.
| xaif2whirl::PUXlationContext::PUXlationContext | ( | const std::string & | anOriginator, |
| PU_Info * | pu_forest | ||
| ) |
the originator is some name that we can use for debugging purposes
Definition at line 14 of file PUXlationContext.cxx.
References myXlationContextStack.
Definition at line 25 of file PUXlationContext.cxx.
References myXlationContextStack.
| xaif2whirl::PUXlationContext::PUXlationContext | ( | const XlationContext & | x | ) | [private] |
no def
| xaif2whirl::PUXlationContext::PUXlationContext | ( | ) | [private] |
no def
Create a new child context and make it the current context.
Definition at line 30 of file PUXlationContext.cxx.
References xaif2whirl::XlationContext::NOFLAG, and PushNewXlationContext().
Referenced by xaif2whirl::XlateStmt::translateAssignmentSimple(), xaif2whirl::XlateExpression::translateExpressionSimple(), xaif2whirl::XlateExpression::translateVarRef(), xaif2whirl::XlateExpression::translateVarRefSimple(), xaif2whirl::XlateExpression::xlate_ArrayElementReference(), xaif2whirl::XlateStmt::xlate_Assignment(), xaif2whirl::XlateStmt::xlate_AssignmentLHS(), xaif2whirl::XlateStmt::xlate_AssignmentRHS(), xaif2whirl::XlateStmt::xlate_DecDeriv(), xaif2whirl::XlateStmt::xlate_IncDeriv(), xaif2whirl::XlateStmt::xlate_InlinableSubroutineCall(), xaif2whirl::XlateStmt::xlate_Saxpy(), xaif2whirl::XlateStmt::xlate_SetDeriv(), xaif2whirl::XlateStmt::xlate_SetNegDeriv(), and xaif2whirl::XlateStmt::xlate_SubroutineCall().

Create a new child context and make it the current context. We pass flags that should apply to the new context. Note that that these flags *do not* override any inherited flags.
Definition at line 34 of file PUXlationContext.cxx.
References PushNewXlationContext().

Returns the current context
Definition at line 56 of file PUXlationContext.cxx.
References myXlationContextStack.
Referenced by PushNewXlationContext(), xaif2whirl::XlateExpression::translateConstant(), xaif2whirl::XlateExpression::translateVarRef(), xaif2whirl::XlateStmt::xlate_AssignmentLHS(), xaif2whirl::XlateExpression::xlate_Intrinsic(), xaif2whirl::XlateExpression::xlate_SymbolReference(), and xaif2whirl::XlateExpression::xlate_SymbolReferenceCollapsedPath().
| void xaif2whirl::PUXlationContext::ddump | ( | ) | const |
Definition at line 196 of file PUXlationContext.cxx.
References dump().

Delete the current context and make its parent the current context. Everything (including memory) associated with the old context will be deleted.
Definition at line 48 of file PUXlationContext.cxx.
References myXlationContextStack.
Referenced by xaif2whirl::XlateStmt::translateAssignmentSimple(), xaif2whirl::XlateExpression::translateExpressionSimple(), xaif2whirl::XlateExpression::translateVarRef(), xaif2whirl::XlateExpression::translateVarRefSimple(), xaif2whirl::XlateExpression::xlate_ArrayElementReference(), xaif2whirl::XlateStmt::xlate_Assignment(), xaif2whirl::XlateStmt::xlate_AssignmentLHS(), xaif2whirl::XlateStmt::xlate_AssignmentRHS(), xaif2whirl::XlateStmt::xlate_DecDeriv(), xaif2whirl::XlateStmt::xlate_IncDeriv(), xaif2whirl::XlateStmt::xlate_InlinableSubroutineCall(), xaif2whirl::XlateStmt::xlate_Saxpy(), xaif2whirl::XlateStmt::xlate_SetDeriv(), xaif2whirl::XlateStmt::xlate_SetNegDeriv(), and xaif2whirl::XlateStmt::xlate_SubroutineCall().
| void xaif2whirl::PUXlationContext::dump | ( | std::ostream & | o, |
| const std::string & | indent | ||
| ) | const |
Definition at line 187 of file PUXlationContext.cxx.
References myOriginator, and myXlationContextStack.
Referenced by ddump().
| WN * xaif2whirl::PUXlationContext::findParentBlockWN | ( | WN * | wn | ) |
Definition at line 68 of file PUXlationContext.cxx.
References fortTkSupport::WhirlParentMap::FindBlock(), FORTTK_DIE, and myWNParentMapP.
Referenced by xaif2whirl::FindWNBlock().

| WN * xaif2whirl::PUXlationContext::findParentWN | ( | WN * | wn | ) |
Definition at line 60 of file PUXlationContext.cxx.
References fortTkSupport::WhirlParentMap::Find(), FORTTK_DIE, and myWNParentMapP.

| PU_Info * xaif2whirl::PUXlationContext::findPU | ( | fortTkSupport::PUId | aPUid | ) |
Definition at line 104 of file PUXlationContext.cxx.
References fortTkSupport::BaseMap< FromTy, ToTy >::Find(), and myPUIdToPUMap.
Referenced by xaif2whirl::TranslateCFG().

| fortTkSupport::Symbol * xaif2whirl::PUXlationContext::findSym | ( | const std::string & | scopeid, |
| const std::string & | symid | ||
| ) |
Definition at line 170 of file PUXlationContext.cxx.
References fortTkSupport::XAIFSymToSymbolMap::Find(), and myXAIFSymToSymbolMap.
Referenced by xaif2whirl::GetSymbol().

| std::pair< ST_TAB *, PU_Info * > xaif2whirl::PUXlationContext::findSymTab | ( | fortTkSupport::SymTabId | stabId | ) |
Definition at line 100 of file PUXlationContext.cxx.
References fortTkSupport::SymTabIdToSymTabMap::Find(), and mySymTabIdToSymTabMap.
Referenced by xaif2whirl::xlate_Scope().

| WN * xaif2whirl::PUXlationContext::findWN | ( | fortTkSupport::WNId | aWNId, |
| bool | mustFind = false |
||
| ) |
Definition at line 140 of file PUXlationContext.cxx.
References fortTkSupport::BaseMap< FromTy, ToTy >::Find(), FORTTK_DIE, and myWNIdToWNMapP.
Referenced by xaif2whirl::FindWNBlock(), xaif2whirl::TranslateBasicBlock(), xaif2whirl::TranslateCFG(), xaif2whirl::xlate_BasicBlock_OLD(), xaif2whirl::xlate_BBCond_OLD(), xaif2whirl::xlate_Symbol(), and xaif2whirl::XlateExpression::xlate_SymbolReference().

Definition at line 108 of file PUXlationContext.cxx.
References fortTkSupport::BaseMap< FromTy, ToTy >::Find(), FORTTK_DIE, and myWNToWNIdMapP.

| const std::string & xaif2whirl::PUXlationContext::getPrefix | ( | ) | [static] |
Definition at line 183 of file PUXlationContext.cxx.
References ourPrefix.
Referenced by xaif2whirl::CreateST().
Definition at line 146 of file PUXlationContext.cxx.
References FORTTK_DIE, and myWNIdToWNMapP.
Referenced by xaif2whirl::xlate_BasicBlock_OLD().
Definition at line 76 of file PUXlationContext.cxx.
References FORTTK_DIE, and myWNParentMapP.
Definition at line 116 of file PUXlationContext.cxx.
References FORTTK_DIE, and myWNToWNIdMapP.
Referenced by xaif2whirl::xlate_BasicBlock_OLD().
Definition at line 175 of file PUXlationContext.cxx.
References myXAIFSymToSymbolMap.
Referenced by xaif2whirl::GetOrCreateSymbol(), and xaif2whirl::xlate_Symbol().
| PUXlationContext& xaif2whirl::PUXlationContext::operator= | ( | const PUXlationContext & | x | ) | [private] |
no def
| void xaif2whirl::PUXlationContext::PushNewXlationContext | ( | XlationContext::Flags_E | f | ) | [private] |
this makes a new XlationContext and pushes it on top
Definition at line 38 of file PUXlationContext.cxx.
References currentXlationContext(), FORTTK_DIE, xaif2whirl::XlationContext::inheritFlagsDown(), myXlationContextStack, and xaif2whirl::XlationContext::setFlag().
Referenced by createXlationContext().

| void xaif2whirl::PUXlationContext::setPrefix | ( | const std::string & | aPrefix | ) | [static] |
Definition at line 179 of file PUXlationContext.cxx.
References ourPrefix.
Referenced by xaif2whirl::XAIF_SAXHandler::startElement().
| void xaif2whirl::PUXlationContext::setWNIdToWNMap | ( | fortTkSupport::WNIdToWNMap * | aWNIdToWNMapP | ) |
Definition at line 152 of file PUXlationContext.cxx.
References FORTTK_DIE, FORTTK_MSG, and myWNIdToWNMapP.
Referenced by xaif2whirl::TranslateCFG(), and xaif2whirl::xlate_Scope().
| void xaif2whirl::PUXlationContext::setWNParentMap | ( | fortTkSupport::WhirlParentMap * | aWhirlParentMapP | ) |
Definition at line 82 of file PUXlationContext.cxx.
References FORTTK_DIE, FORTTK_MSG, and myWNParentMapP.
Referenced by xaif2whirl::TranslateCFG().
| void xaif2whirl::PUXlationContext::setWNToWNIdMap | ( | fortTkSupport::WNToWNIdMap * | aWNToWNIdMapP | ) |
Definition at line 122 of file PUXlationContext.cxx.
References FORTTK_DIE, FORTTK_MSG, and myWNToWNIdMapP.
Referenced by xaif2whirl::TranslateCFG().
std::string xaif2whirl::PUXlationContext::myOriginator [private] |
some string passed to the ctor to indicate who created this
Definition at line 176 of file PUXlationContext.h.
Referenced by dump().
Definition at line 134 of file PUXlationContext.h.
Referenced by findPU().
Definition at line 132 of file PUXlationContext.h.
Referenced by findSymTab().
we don't own this
Definition at line 151 of file PUXlationContext.h.
Referenced by findWN(), getWNIdToWNMap(), and setWNIdToWNMap().
we don't own this
Definition at line 141 of file PUXlationContext.h.
Referenced by findParentBlockWN(), findParentWN(), getWNParentMap(), and setWNParentMap().
we don't own this
Definition at line 146 of file PUXlationContext.h.
Referenced by findWNId(), getWNToWNIdMap(), and setWNToWNIdMap().
Definition at line 136 of file PUXlationContext.h.
Referenced by findSym(), and getXAIFSymToSymbolMap().
the context stack, we own all the entries in it
Definition at line 165 of file PUXlationContext.h.
Referenced by currentXlationContext(), deleteXlationContext(), dump(), PushNewXlationContext(), PUXlationContext(), and ~PUXlationContext().
std::string xaif2whirl::PUXlationContext::ourPrefix [static, private] |
Definition at line 154 of file PUXlationContext.h.
Referenced by getPrefix(), and setPrefix().