Open bgogul opened 2 years ago
Also, add ToString to Operation for ease of degubbing!!
Also, add ToString to Operation for ease of degubbing!!
Instead of adding it directly to Operation, wouldn't it be better to a IRPrinter::ToString(const Operation&, ...)
. Otherwise, don't you need to pass SsaNames
to Operation
and would introduce cyclic dependency again?
Just some thoughts based on discussion in meeting that need to be vetted further:
GetOrCreateID
and add a GetID
method.SsaNames
to be part of IrContext
.Similar to IRPrinter
related changes, datalog_lowering_visitor
used to lower datalog to facts in //src/backends/policy_engine/souffle/
should not populate ssa_names. It should be passed to it through constructor.
Other than the place where
SsaNames
is constructed, we should not have to passSsaNames
as a non-const value. The following changes should make it possible:GetOrCreateID
toGetID
that returns ID if it is available or returns an error.std::unique_ptr<SsaNames>
. Instead, it should hold aconst SsaNames*
passed to it through a constructor.Value::ToString
and replace it withIRPrinter::ToString(Value v, const SsaNames* ssa_names)
.This is just a start, but more changes may be needed.