Like emitDataConst but returns CORINFO_FIELD_HANDLE, it's more useful in codegen. emitDataConst should probably be private.
if (*bitMask == nullptr)
{
assert(cnsAddr != nullptr);
- *bitMask = compiler->eeFindJitDataOffs(getEmitter()->emitDataConst(cnsAddr, genTypeSize(targetType), dblAlign));
+ *bitMask = getEmitter()->emitAnyConst(cnsAddr, genTypeSize(targetType), dblAlign);
}
// We need an additional register for bitmask.
}
#ifndef LEGACY_BACKEND
+
+CORINFO_FIELD_HANDLE emitter::emitAnyConst(const void* cnsAddr, unsigned cnsSize, bool dblAlign)
+{
+ UNATIVE_OFFSET cnum = emitDataConst(cnsAddr, cnsSize, dblAlign);
+ return emitComp->eeFindJitDataOffs(cnum);
+}
+
// Generates a float or double data section constant and returns field handle representing
// the data offset to access the constant. This is called by emitInsBinary() in case
// of contained float of double constants.
UNATIVE_OFFSET emitInstCodeSz(instrDesc* id);
#ifndef LEGACY_BACKEND
+ CORINFO_FIELD_HANDLE emitAnyConst(const void* cnsAddr, unsigned cnsSize, bool dblAlign);
CORINFO_FIELD_HANDLE emitFltOrDblConst(double constValue, emitAttr attr);
regNumber emitInsBinary(instruction ins, emitAttr attr, GenTree* dst, GenTree* src);
regNumber emitInsTernary(instruction ins, emitAttr attr, GenTree* dst, GenTree* src1, GenTree* src2);