Skip to content

Commit

Permalink
Explicitly specify target in Compilation constructor
Browse files Browse the repository at this point in the history
This is needed so that the codegen is able to set the correct
flags when initializing.

Signed-off-by: Dhruv Chopra <Dhruv.C.Chopra@ibm.com>
  • Loading branch information
dchopra001 committed Aug 27, 2020
1 parent 1c39555 commit d0e0cc1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
6 changes: 4 additions & 2 deletions compiler/compile/Compilation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ class OMR_EXTENSIBLE Compilation : public OMR::CompilationConnector
TR::Options &options,
TR::Region &heapMemoryRegion,
TR_Memory *memory,
TR_OptimizationPlan *optimizationPlan) :
TR_OptimizationPlan *optimizationPlan,
TR::Environment *target = NULL) :
OMR::CompilationConnector(
compThreadId,
omrVMThread,
Expand All @@ -59,7 +60,8 @@ class OMR_EXTENSIBLE Compilation : public OMR::CompilationConnector
options,
heapMemoryRegion,
memory,
optimizationPlan)
optimizationPlan,
target)
{}

~Compilation() {}
Expand Down
13 changes: 11 additions & 2 deletions compiler/compile/OMRCompilation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ OMR::Compilation::Compilation(
TR::Options &options,
TR::Region &heapMemoryRegion,
TR_Memory *m,
TR_OptimizationPlan *optimizationPlan) :
TR_OptimizationPlan *optimizationPlan,
TR::Environment *target) :
_signature(compilee->signature(m)),
_options(&options),
_heapMemoryRegion(heapMemoryRegion),
Expand Down Expand Up @@ -294,9 +295,17 @@ OMR::Compilation::Compilation(
_gpuPtxCount(0),
_bitVectorPool(self()),
_typeLayoutMap((LayoutComparator()), LayoutAllocator(self()->region())),
_target(TR::Compiler->target),
_tlsManager(*self())
{
if (target != NULL)
{
_target = *target;
}
else
{
_target = TR::Compiler->target;
}

//Avoid expensive initialization and uneeded option checking if we are doing AOT Loads
if (_optimizationPlan && _optimizationPlan->getIsAotLoad())
{
Expand Down
3 changes: 2 additions & 1 deletion compiler/compile/OMRCompilation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,8 @@ class OMR_EXTENSIBLE Compilation
TR::Options &,
TR::Region &heapMemoryRegion,
TR_Memory *,
TR_OptimizationPlan *optimizationPlan
TR_OptimizationPlan *optimizationPlan,
TR::Environment *target = NULL
);

TR::SymbolReference * getSymbolReferenceByReferenceNumber(int32_t referenceNumber);
Expand Down

0 comments on commit d0e0cc1

Please sign in to comment.