Skip to content

Commit

Permalink
Remove and replace legacy MemoryReference constructor
Browse files Browse the repository at this point in the history
Previously, there were two MemoryReference constructors that accepted a
displacement as one of its parameters: one that took it as an int32_t
(a legacy constructor) and one that took it as an int64_t. To ensure
that a call to either one of these constructors was never ambiguous,
an extra int parameter was added at the end of the int64_t constructor.
With this commit, the legacy constructor has been removed and replaced
with the int64_t one, and the extra int parameter has been removed

Signed-off-by: Jackie Midroni <jackie.midroni@mail.utoronto.ca>
  • Loading branch information
Jackie Midroni committed Sep 11, 2020
1 parent b6ac934 commit d82b6ef
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 26 deletions.
9 changes: 1 addition & 8 deletions compiler/p/codegen/MemoryReference.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ class OMR_EXTENSIBLE MemoryReference : public OMR::MemoryReferenceConnector
MemoryReference(TR::Register *br,
int64_t disp,
uint8_t len,
TR::CodeGenerator *cg,
int) :
TR::CodeGenerator *cg) :
OMR::MemoryReferenceConnector(br, disp, len, cg, 0) {}

MemoryReference(TR::LabelSymbol *label, int64_t disp, int8_t len, TR::CodeGenerator *cg) :
Expand All @@ -59,12 +58,6 @@ class OMR_EXTENSIBLE MemoryReference : public OMR::MemoryReferenceConnector
TR::CodeGenerator *cg) :
OMR::MemoryReferenceConnector(br, ir, len, cg) {}

MemoryReference(TR::Register *br,
int32_t disp,
uint8_t len,
TR::CodeGenerator *cg) :
OMR::MemoryReferenceConnector(br, disp, len, cg) {}

MemoryReference(TR::Node *rootLoadOrStore, uint32_t len, TR::CodeGenerator *cg):
OMR::MemoryReferenceConnector(rootLoadOrStore, len, cg) {}

Expand Down
12 changes: 2 additions & 10 deletions compiler/p/codegen/OMRMemoryReference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ TR::MemoryReference *TR::MemoryReference::createWithIndexReg(TR::CodeGenerator *

TR::MemoryReference *TR::MemoryReference::createWithDisplacement(TR::CodeGenerator *cg, TR::Register *baseReg, int64_t displacement, int8_t length)
{
return new (cg->trHeapMemory()) TR::MemoryReference(baseReg, displacement, length, cg, 0);
return new (cg->trHeapMemory()) TR::MemoryReference(baseReg, displacement, length, cg);
}

TR::MemoryReference *TR::MemoryReference::createWithRootLoadOrStore(TR::CodeGenerator *cg, TR::Node *rootLoadOrStore, uint32_t length)
Expand Down Expand Up @@ -169,19 +169,11 @@ OMR::Power::MemoryReference::MemoryReference(
_offset = _symbolReference->getOffset();
}

OMR::Power::MemoryReference::MemoryReference(
TR::Register *br,
int32_t disp,
uint8_t len,
TR::CodeGenerator *cg) :
OMR::Power::MemoryReference(br, static_cast<int64_t>(disp), len, cg, 0) {}

OMR::Power::MemoryReference::MemoryReference(
TR::Register *br,
int64_t disp,
uint8_t len,
TR::CodeGenerator *cg,
int) :
TR::CodeGenerator *cg) :
_baseRegister(br),
_baseNode(NULL),
_indexRegister(NULL),
Expand Down
9 changes: 1 addition & 8 deletions compiler/p/codegen/OMRMemoryReference.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ class OMR_EXTENSIBLE MemoryReference : public OMR::MemoryReference
TR::Register *br,
int64_t disp,
uint8_t len,
TR::CodeGenerator *cg,
int);
TR::CodeGenerator *cg);

MemoryReference(
TR::LabelSymbol *label,
Expand Down Expand Up @@ -119,12 +118,6 @@ class OMR_EXTENSIBLE MemoryReference : public OMR::MemoryReference
uint8_t len,
TR::CodeGenerator *cg);

MemoryReference(
TR::Register *br,
int32_t disp,
uint8_t len,
TR::CodeGenerator *cg);

virtual TR::RegisterDependencyConditions *getConditions() { return _conditions; }

TR::SymbolReference *getSymbolReference() {return _symbolReference;}
Expand Down

0 comments on commit d82b6ef

Please sign in to comment.