Skip to content

Commit

Permalink
Add TR::MemoryReference::create API with trivial implementation
Browse files Browse the repository at this point in the history
This API is meant to be overridden in downstream projects who wish to
have custom logic for generating memory references. Typical examples of
this is for handling unresolved memory references.

Signed-off-by: Filip Jeremic <fjeremic@ca.ibm.com>
  • Loading branch information
fjeremic authored and r30shah committed Dec 9, 2020
1 parent da95306 commit 2ebbeb3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions compiler/z/codegen/OMRMemoryReference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3300,6 +3300,12 @@ OMR::Z::MemoryReference::doEvaluate(TR::Node * subTree, TR::CodeGenerator * cg)
return false;
}

TR::MemoryReference*
OMR::Z::MemoryReference::create(TR::CodeGenerator* cg, TR::Node* node)
{
return generateS390MemoryReference(node, cg);
}

///////////////////////////////////////////
// Generate Routines
///////////////////////////////////////////
Expand Down
15 changes: 15 additions & 0 deletions compiler/z/codegen/OMRMemoryReference.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,21 @@ void createPatchableDataInLitpool(TR::Node * node, TR::CodeGenerator * cg, TR::R

bool symRefHasTemporaryNegativeOffset() {return false;}
void setMemRefAndGetUnresolvedData(TR::Snippet *& snippet) {}

/**
* \brief
* Create a MemoryReference from a given node.
*
* \param[in] node
* The node which describes the memory reference.
*
* \param[in] cg
* The code generator used to generate the instructions.
*
* \return
* The \c TR::MemoryReference representing this node.
*/
static TR::MemoryReference* create(TR::CodeGenerator* cg, TR::Node* node);
};
}
}
Expand Down

0 comments on commit 2ebbeb3

Please sign in to comment.