Skip to content

Commit

Permalink
Simplifying function calls of TR_S390Peephole in OMR
Browse files Browse the repository at this point in the history
Simplifying function calls of TR_S390Peephole, TR_S390PostRAPeephole and
TR_S390RreRAPeephole by not passing paramter cg.

Issue:eclipse-omr#1855
Signed-off-by: Bohao(Aaron) Wang <[email protected]>
  • Loading branch information
wbh123456 committed Jun 3, 2019
1 parent a2c063f commit e8a7ff2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions compiler/z/codegen/OMRCodeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2039,14 +2039,14 @@ OMR::Z::CodeGenerator::deleteInst(TR::Instruction* old)
void
OMR::Z::CodeGenerator::doPreRAPeephole()
{
TR_S390PreRAPeephole ph(self()->comp(), self());
TR_S390PreRAPeephole ph(self()->comp());
ph.perform();
}

void
OMR::Z::CodeGenerator::doPostRAPeephole()
{
TR_S390PostRAPeephole ph(self()->comp(), self());
TR_S390PostRAPeephole ph(self()->comp());
ph.perform();
}

Expand Down
14 changes: 7 additions & 7 deletions compiler/z/codegen/S390Peephole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@
#include "z/codegen/S390OutOfLineCodeSection.hpp"
#include "z/codegen/SystemLinkage.hpp"

TR_S390Peephole::TR_S390Peephole(TR::Compilation* comp, TR::CodeGenerator *cg)
TR_S390Peephole::TR_S390Peephole(TR::Compilation* comp)
: _fe(comp->fe()),
_outFile(comp->getOutFile()),
_cursor(cg->getFirstInstruction()),
_cg(cg)
_cursor(comp->cg()->getFirstInstruction()),
_cg(comp->cg())
{
}

TR_S390PreRAPeephole::TR_S390PreRAPeephole(TR::Compilation* comp, TR::CodeGenerator *cg)
: TR_S390Peephole(comp, cg)
TR_S390PreRAPeephole::TR_S390PreRAPeephole(TR::Compilation* comp)
: TR_S390Peephole(comp)
{
}

Expand Down Expand Up @@ -261,8 +261,8 @@ TR::Instruction* realInstructionWithLabelsAndRET(TR::Instruction* inst, bool for

///////////////////////////////////////////////////////////////////////////////

TR_S390PostRAPeephole::TR_S390PostRAPeephole(TR::Compilation* comp, TR::CodeGenerator *cg)
: TR_S390Peephole(comp, cg)
TR_S390PostRAPeephole::TR_S390PostRAPeephole(TR::Compilation* comp)
: TR_S390Peephole(comp)
{
}

Expand Down
6 changes: 3 additions & 3 deletions compiler/z/codegen/S390Peephole.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
class TR_S390Peephole
{
public:
TR_S390Peephole(TR::Compilation* comp, TR::CodeGenerator *cg);
TR_S390Peephole(TR::Compilation* comp);

protected:
void printInfo(const char* info)
Expand Down Expand Up @@ -68,7 +68,7 @@ class TR_S390Peephole
class TR_S390PreRAPeephole : private TR_S390Peephole
{
public:
TR_S390PreRAPeephole(TR::Compilation* comp, TR::CodeGenerator *cg);
TR_S390PreRAPeephole(TR::Compilation* comp);

void perform();

Expand All @@ -92,7 +92,7 @@ class TR_S390PreRAPeephole : private TR_S390Peephole
class TR_S390PostRAPeephole : private TR_S390Peephole
{
public:
TR_S390PostRAPeephole(TR::Compilation* , TR::CodeGenerator *);
TR_S390PostRAPeephole(TR::Compilation* comp);

void perform();

Expand Down

0 comments on commit e8a7ff2

Please sign in to comment.