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

PUXlationContext for whirl2xaif: Represents information about a WHIRL->XAIF 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 whirl2xaif, 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 46 of file PUXlationContext.h.
typedef std::list<XlationContext> whirl2xaif::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 225 of file PUXlationContext.h.
| whirl2xaif::PUXlationContext::PUXlationContext | ( | const std::string & | anOriginator, |
| Open64IRInterface & | anIrInterface | ||
| ) |
the originator is some name that we can use for debugging purposes
Definition at line 10 of file PUXlationContext.cxx.
References myXlationContextStack.
Definition at line 22 of file PUXlationContext.cxx.
References myXlationContextStack.
| whirl2xaif::PUXlationContext::PUXlationContext | ( | const XlationContext & | x | ) | [private] |
no def
| whirl2xaif::PUXlationContext::PUXlationContext | ( | ) | [private] |
no def
Create a new child context and make it the current context.
Definition at line 27 of file PUXlationContext.cxx.
References whirl2xaif::XlationContext::NOFLAG, and PushNewXlationContext().
Referenced by whirl2xaif::WN2F_arrsection(), whirl2xaif::WN2F_Arrsection_Slots(), whirl2xaif::WN2F_src_triplet(), whirl2xaif::WN2F_String_Argument(), whirl2xaif::WN2F_Substring(), whirl2xaif::xlate_ARRAY(), whirl2xaif::xlate_ArrayIndices(), whirl2xaif::xlate_CALL(), whirl2xaif::xlate_CFCondition(), whirl2xaif::xlate_FUNC_ENTRY(), xlate_IOControlList(), xlate_IOList(), whirl2xaif::xlate_ISTORE(), whirl2xaif::xlate_LoopInitialization(), whirl2xaif::xlate_LoopUpdate(), whirl2xaif::xlate_MemRef(), whirl2xaif::xlate_STID(), and whirl2xaif::xlate_SymRef().

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 31 of file PUXlationContext.cxx.
References PushNewXlationContext().

| void whirl2xaif::PUXlationContext::createXlationContext | ( | XlationContext::Flags_E | f, |
| WN * | aWNp | ||
| ) |
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. Also pass along a whirl node.
Definition at line 35 of file PUXlationContext.cxx.
References PushNewXlationContext().

Returns the current context
Definition at line 58 of file PUXlationContext.cxx.
References myXlationContextStack.
Referenced by PushNewXlationContext(), whirl2xaif::Whirl2Xaif::translateScopeHierarchyPU(), whirl2xaif::TranslateWN(), whirl2xaif::TY2F_Append_ARB(), whirl2xaif::TY2F_array(), whirl2xaif::TY2F_scalar(), whirl2xaif::WN2F_arrsection(), whirl2xaif::WN2F_Arrsection_Slots(), whirl2xaif::WN2F_implied_do(), WN2F_Intr_Funcall(), WN2F_ios_cr(), WN2F_ios_decode(), WN2F_ios_definefile(), WN2F_ios_encode(), WN2F_ios_inquire(), WN2F_ios_read(), whirl2xaif::WN2F_parm(), whirl2xaif::WN2F_pstid(), whirl2xaif::WN2F_pstore(), whirl2xaif::WN2F_src_triplet(), whirl2xaif::WN2F_String_Argument(), whirl2xaif::WN2F_Substring(), whirl2xaif::xlate_ARRAY(), whirl2xaif::xlate_ArrayIndices(), whirl2xaif::xlate_BinaryOp(), xlate_BinaryOpUsingIntrinsicTable(), whirl2xaif::xlate_CALL(), whirl2xaif::xlate_CONST(), whirl2xaif::xlate_FUNC_ENTRY(), whirl2xaif::xlate_ILOAD(), whirl2xaif::xlate_INTCONST(), whirl2xaif::xlate_IO(), whirl2xaif::xlate_IO_ITEM(), xlate_IO_ITEM_control(), xlate_IO_ITEM_format(), xlate_IO_ITEM_list(), xlate_IO_ITEM_unit(), whirl2xaif::xlate_ISTORE(), whirl2xaif::xlate_LDA(), whirl2xaif::xlate_LDID(), whirl2xaif::xlate_MemRef(), whirl2xaif::xlate_PregRef(), whirl2xaif::xlate_STID(), whirl2xaif::xlate_STUse_BLOCK(), whirl2xaif::xlate_STUse_CONST(), whirl2xaif::xlate_STUse_VAR(), and whirl2xaif::xlate_SymRef().
| void whirl2xaif::PUXlationContext::ddump | ( | ) | const |
Definition at line 520 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 51 of file PUXlationContext.cxx.
References myXlationContextStack.
Referenced by whirl2xaif::WN2F_arrsection(), whirl2xaif::WN2F_Arrsection_Slots(), whirl2xaif::WN2F_src_triplet(), whirl2xaif::WN2F_String_Argument(), whirl2xaif::WN2F_Substring(), whirl2xaif::xlate_ARRAY(), whirl2xaif::xlate_ArrayIndices(), whirl2xaif::xlate_CALL(), whirl2xaif::xlate_CFCondition(), whirl2xaif::xlate_FUNC_ENTRY(), xlate_IOControlList(), xlate_IOList(), whirl2xaif::xlate_ISTORE(), whirl2xaif::xlate_LoopInitialization(), whirl2xaif::xlate_LoopUpdate(), whirl2xaif::xlate_MemRef(), whirl2xaif::xlate_STID(), and whirl2xaif::xlate_SymRef().
| void whirl2xaif::PUXlationContext::dump | ( | std::ostream & | o, |
| const std::string & | indent | ||
| ) | const |
Definition at line 511 of file PUXlationContext.cxx.
References myOriginator, and myXlationContextStack.
Referenced by ddump().
| int whirl2xaif::PUXlationContext::findDoChainId | ( | WN * | wn | ) |
Definition at line 331 of file PUXlationContext.cxx.
References whirl2sexp::DumpWN(), FORTTK_DIE, FORTTK_MSG, and myDoChains.
Referenced by whirl2xaif::xlate_ISTORE(), whirl2xaif::xlate_LoopInitialization(), whirl2xaif::xlate_LoopUpdate(), and whirl2xaif::xlate_STID().

| WN * whirl2xaif::PUXlationContext::findParentBlockWN | ( | WN * | wn | ) |
Definition at line 85 of file PUXlationContext.cxx.
References fortTkSupport::WhirlParentMap::FindBlock(), FORTTK_DIE, and myWNParentMapP.
Referenced by whirl2xaif::xlate_PassiveStmt().

| WN * whirl2xaif::PUXlationContext::findParentWN | ( | WN * | wn | ) |
Definition at line 77 of file PUXlationContext.cxx.
References fortTkSupport::WhirlParentMap::Find(), FORTTK_DIE, and myWNParentMapP.
Referenced by findUDDUChainId(), getAliasMapKey(), whirl2xaif::xlate_CALL(), and whirl2xaif::xlate_PassiveStmt().

| fortTkSupport::PUId whirl2xaif::PUXlationContext::findPUId | ( | PU_Info * | pu | ) |
Definition at line 138 of file PUXlationContext.cxx.
References fortTkSupport::BaseMap< FromTy, ToTy >::Find(), FORTTK_DIE, and myPU2idMapP.
Referenced by whirl2xaif::Whirl2Xaif::translatePU().

Definition at line 379 of file PUXlationContext.cxx.
References fortTkSupport::ScalarizedRefTab< ScalarizedRefTab_Base::W2X >::Find(), FORTTK_DIE, and myScalarizedRefTab_W2Xp.
Referenced by whirl2xaif::xlate_MemRef(), and whirl2xaif::xlate_SymRef().

| fortTkSupport::SymTabId whirl2xaif::PUXlationContext::findSymTabId | ( | ST_TAB * | stab | ) |
Definition at line 116 of file PUXlationContext.cxx.
References fortTkSupport::BaseMap< FromTy, ToTy >::Find(), FORTTK_DIE, and myStab2idMapP.
Referenced by whirl2xaif::Whirl2Xaif::translatePU(), whirl2xaif::Whirl2Xaif::translateScopeHierarchy(), whirl2xaif::Whirl2Xaif::translateScopeHierarchyPU(), whirl2xaif::xlate_CALL(), whirl2xaif::xlate_EntryPoint(), whirl2xaif::xlate_FUNC_ENTRY(), whirl2xaif::xlate_MemRef(), whirl2xaif::xlate_PregRef(), whirl2xaif::xlate_SideEffectEntry(), whirl2xaif::xlate_SideEffectNamedLocation(), whirl2xaif::xlate_STUse_VAR(), and whirl2xaif::xlate_SymRef().

| int whirl2xaif::PUXlationContext::findUDDUChainId | ( | WN * | wnexpr | ) |
Definition at line 192 of file PUXlationContext.cxx.
References whirl2sexp::DumpWN(), findParentWN(), FORTTK_DIE, FORTTK_MSG, fortTkSupport::Diagnostics::getDiagnosticFilterLevel(), and myUdduchains.
Referenced by whirl2xaif::WN2F_arrsection(), whirl2xaif::WN2F_String_Argument(), whirl2xaif::xlate_ARRAY(), whirl2xaif::xlate_ISTORE(), whirl2xaif::xlate_MemRef(), whirl2xaif::xlate_PregRef(), whirl2xaif::xlate_STID(), and whirl2xaif::xlate_SymRef().

Definition at line 160 of file PUXlationContext.cxx.
References fortTkSupport::BaseMap< FromTy, ToTy >::Find(), FORTTK_DIE, and myWN2idMapP.
Referenced by whirl2xaif::GetIDsForStmtsInBB(), whirl2xaif::TranslateWN(), whirl2xaif::WN2F_agoto(), WN2F_ios_close(), WN2F_ios_cr(), WN2F_ios_inquire(), WN2F_ios_open(), WN2F_ios_rewind(), WN2F_ios_write(), whirl2xaif::xlate_CALL(), whirl2xaif::xlate_COMMENT(), whirl2xaif::xlate_EntryPoint(), whirl2xaif::xlate_GOTO(), whirl2xaif::xlate_INTRINSIC_CALL(), whirl2xaif::xlate_ISTORE(), whirl2xaif::xlate_LABEL(), whirl2xaif::xlate_LoopInitialization(), whirl2xaif::xlate_LoopUpdate(), whirl2xaif::xlate_PassiveStmt(), whirl2xaif::xlate_PRAGMA(), whirl2xaif::xlate_RETURN_VAL(), whirl2xaif::xlate_ScalarizedRefTab(), whirl2xaif::xlate_STID(), and whirl2xaif::xlate_USE().

| int whirl2xaif::PUXlationContext::getAliasMapKey | ( | WN * | wnexpr | ) |
Definition at line 251 of file PUXlationContext.cxx.
References whirl2sexp::DumpWN(), findParentWN(), FORTTK_DIE, FORTTK_MSG, fortTkSupport::Diagnostics::getDiagnosticFilterLevel(), and myAliasMapXAIF_p.
Referenced by whirl2xaif::WN2F_arrsection(), whirl2xaif::WN2F_String_Argument(), whirl2xaif::xlate_ARRAY(), whirl2xaif::xlate_ISTORE(), whirl2xaif::xlate_MemRef(), whirl2xaif::xlate_PregRef(), whirl2xaif::xlate_STID(), and whirl2xaif::xlate_SymRef().

| OA::OA_ptr< OA::XAIF::ReachDefsOverwriteXAIF > whirl2xaif::PUXlationContext::getDoChains | ( | ) | const |
Definition at line 355 of file PUXlationContext.cxx.
References FORTTK_DIE, and myDoChains.
Definition at line 532 of file PUXlationContext.cxx.
References myIrInterface.
Referenced by whirl2xaif::xlate_SideEffectEntry().
get WN* the most recent non-NULL WN.
Definition at line 62 of file PUXlationContext.cxx.
References FORTTK_DIE, and myXlationContextStack.
Referenced by whirl2xaif::xlate_MemRef(), whirl2xaif::xlate_PregRef(), and whirl2xaif::xlate_SymRef().
Definition at line 146 of file PUXlationContext.cxx.
References FORTTK_DIE, and myPU2idMapP.
Definition at line 405 of file PUXlationContext.cxx.
References FORTTK_DIE, and myScalarizedRefTab_W2Xp.
Definition at line 124 of file PUXlationContext.cxx.
References FORTTK_DIE, and myStab2idMapP.
| OA::OA_ptr< OA::XAIF::UDDUChainsXAIF > whirl2xaif::PUXlationContext::getUDDUChains | ( | ) | const |
Definition at line 307 of file PUXlationContext.cxx.
References FORTTK_DIE, and myUdduchains.
Definition at line 93 of file PUXlationContext.cxx.
References FORTTK_DIE, and myWNParentMapP.
Definition at line 168 of file PUXlationContext.cxx.
References FORTTK_DIE, and myWN2idMapP.
| int whirl2xaif::PUXlationContext::isActiveStmt | ( | PU_Info * | pu, |
| WN * | wn | ||
| ) |
Definition at line 459 of file PUXlationContext.cxx.
References FORTTK_DIE, and myActivity.
| int whirl2xaif::PUXlationContext::isActiveSym | ( | ST * | st | ) |
Definition at line 411 of file PUXlationContext.cxx.
References FORTTK_DIE, whirl2xaif::Whirl2Xaif::getOAAnalMap(), fortTkSupport::IntraOAInfo::isGlobalSymbolActive(), myActivity, and myAlias.
Referenced by whirl2xaif::activeInCommon(), whirl2xaif::equivalencedToActive(), whirl2xaif::equivalencedToActiveBlock(), and whirl2xaif::xlate_STDecl_VAR().

| int whirl2xaif::PUXlationContext::isActiveVarRef | ( | PU_Info * | pu, |
| WN * | wn | ||
| ) |
Definition at line 468 of file PUXlationContext.cxx.
References FORTTK_DIE, and myActivity.
| bool whirl2xaif::PUXlationContext::isF90 | ( | ) | const |
Definition at line 524 of file PUXlationContext.cxx.
References myF90Flag.
Referenced by whirl2xaif::TY2F_scalar().
| PUXlationContext& whirl2xaif::PUXlationContext::operator= | ( | const PUXlationContext & | x | ) | [private] |
no def
| void whirl2xaif::PUXlationContext::PushNewXlationContext | ( | XlationContext::Flags_E | f, |
| WN * | aWNp | ||
| ) | [private] |
this makes a new XlationContext and pushes it on top
Definition at line 39 of file PUXlationContext.cxx.
References currentXlationContext(), FORTTK_DIE, whirl2xaif::XlationContext::inheritFlags(), myXlationContextStack, whirl2xaif::XlationContext::setFlag(), and whirl2xaif::XlationContext::setWN().
Referenced by createXlationContext().

| void whirl2xaif::PUXlationContext::setActivity | ( | OA::OA_ptr< OA::Activity::InterActiveFortran > | anActivityMap | ) |
Definition at line 477 of file PUXlationContext.cxx.
References FORTTK_DIE, and myActivity.
| void whirl2xaif::PUXlationContext::setAlias | ( | OA::OA_ptr< OA::Alias::InterAliasMap > | anAliasMap | ) |
Definition at line 485 of file PUXlationContext.cxx.
References FORTTK_DIE, and myAlias.
| void whirl2xaif::PUXlationContext::setAliasMapXAIF | ( | OA::OA_ptr< OA::XAIF::AliasMapXAIF > | anAliasMapXAIF | ) |
Definition at line 493 of file PUXlationContext.cxx.
References FORTTK_DIE, FORTTK_MSG, and myAliasMapXAIF_p.
Referenced by whirl2xaif::xlate_FUNC_ENTRY().
| void whirl2xaif::PUXlationContext::setDoChains | ( | OA::OA_ptr< OA::XAIF::ReachDefsOverwriteXAIF > | x | ) |
Definition at line 361 of file PUXlationContext.cxx.
References FORTTK_DIE, FORTTK_MSG, and myDoChains.
Referenced by whirl2xaif::xlate_FUNC_ENTRY().
| void whirl2xaif::PUXlationContext::setF90 | ( | bool | aFlag | ) |
Definition at line 528 of file PUXlationContext.cxx.
References myF90Flag.
Referenced by whirl2xaif::Whirl2Xaif::translatePU().
| void whirl2xaif::PUXlationContext::setPUToIdMap | ( | fortTkSupport::PUToPUIdMap * | aPUToPUIdMapP | ) |
Definition at line 152 of file PUXlationContext.cxx.
References FORTTK_DIE, and myPU2idMapP.
| void whirl2xaif::PUXlationContext::setScalarizedRefTab | ( | fortTkSupport::ScalarizedRefTab_W2X * | aScalarizedRefTab_W2Xp | ) |
Definition at line 387 of file PUXlationContext.cxx.
References FORTTK_DIE, FORTTK_MSG, and myScalarizedRefTab_W2Xp.
Referenced by whirl2xaif::xlate_FUNC_ENTRY().
| void whirl2xaif::PUXlationContext::setSymTabToIdMap | ( | fortTkSupport::SymTabToSymTabIdMap * | aSymTabToSymTabIdMapP | ) |
Definition at line 130 of file PUXlationContext.cxx.
References FORTTK_DIE, and myStab2idMapP.
| void whirl2xaif::PUXlationContext::setUDDUChains | ( | OA::OA_ptr< OA::XAIF::UDDUChainsXAIF > | x | ) |
Definition at line 313 of file PUXlationContext.cxx.
References FORTTK_DIE, FORTTK_MSG, and myUdduchains.
Referenced by whirl2xaif::xlate_FUNC_ENTRY().
| void whirl2xaif::PUXlationContext::setWNParentMap | ( | fortTkSupport::WhirlParentMap * | aWhirlParentMapP | ) |
Definition at line 99 of file PUXlationContext.cxx.
References FORTTK_DIE, FORTTK_MSG, and myWNParentMapP.
Referenced by whirl2xaif::xlate_FUNC_ENTRY().
Definition at line 174 of file PUXlationContext.cxx.
References FORTTK_DIE, FORTTK_MSG, and myWN2idMapP.
Referenced by whirl2xaif::Whirl2Xaif::translateScopeHierarchyPU(), and whirl2xaif::xlate_FUNC_ENTRY().
OA::OA_ptr<OA::Activity::InterActiveFortran> whirl2xaif::PUXlationContext::myActivity [private] |
we don't own this
Definition at line 193 of file PUXlationContext.h.
Referenced by isActiveStmt(), isActiveSym(), isActiveVarRef(), and setActivity().
OA::OA_ptr<OA::Alias::InterAliasMap> whirl2xaif::PUXlationContext::myAlias [private] |
we don't own this
Definition at line 198 of file PUXlationContext.h.
Referenced by isActiveSym(), and setAlias().
OA::OA_ptr<OA::XAIF::AliasMapXAIF> whirl2xaif::PUXlationContext::myAliasMapXAIF_p [private] |
we don't own this
Definition at line 203 of file PUXlationContext.h.
Referenced by getAliasMapKey(), and setAliasMapXAIF().
OA::OA_ptr<OA::XAIF::ReachDefsOverwriteXAIF> whirl2xaif::PUXlationContext::myDoChains [private] |
we don't own this
Definition at line 213 of file PUXlationContext.h.
Referenced by findDoChainId(), getDoChains(), and setDoChains().
bool whirl2xaif::PUXlationContext::myF90Flag [private] |
Definition at line 243 of file PUXlationContext.h.
Definition at line 245 of file PUXlationContext.h.
Referenced by getIrInterface().
std::string whirl2xaif::PUXlationContext::myOriginator [private] |
some string passed to the ctor to indicate who created this
Definition at line 241 of file PUXlationContext.h.
Referenced by dump().
we don't own this
Definition at line 183 of file PUXlationContext.h.
Referenced by findPUId(), getPUToIdMap(), and setPUToIdMap().
fortTkSupport::ScalarizedRefTab_W2X* whirl2xaif::PUXlationContext::myScalarizedRefTab_W2Xp [private] |
we don't own this
Definition at line 218 of file PUXlationContext.h.
Referenced by findScalarizedRef(), getScalarizedRefTab(), and setScalarizedRefTab().
we don't own this
Definition at line 178 of file PUXlationContext.h.
Referenced by findSymTabId(), getSymTabToIdMap(), and setSymTabToIdMap().
OA::OA_ptr<OA::XAIF::UDDUChainsXAIF> whirl2xaif::PUXlationContext::myUdduchains [private] |
we don't own this
Definition at line 208 of file PUXlationContext.h.
Referenced by findUDDUChainId(), getUDDUChains(), and setUDDUChains().
we don't own this
Definition at line 188 of file PUXlationContext.h.
Referenced by findWNId(), getWNToIdMap(), and setWNToIdMap().
we don't own this
Definition at line 173 of file PUXlationContext.h.
Referenced by findParentBlockWN(), findParentWN(), getWNParentMap(), and setWNParentMap().
the context stack, we own all the entries in it
Definition at line 230 of file PUXlationContext.h.
Referenced by currentXlationContext(), deleteXlationContext(), dump(), getMostRecentWN(), PushNewXlationContext(), PUXlationContext(), and ~PUXlationContext().