Opened 9 months ago

#281 new defect

createBitwiseAssignment has an Internal Root

Reported by: ajbeach Owned by:
Priority: minor Component: cfa-cc
Version: 1.0 Keywords:
Cc:

Description

The function InitTweak::createBitwiseAssignment creates an operation, but the operation is the application of a magic function. The magic function is created the first time the function is called and stored in a reference counted pointer. This makes it a pretty well defined root for the AST system. It does however exist outside the translation unit and breaks a bunch of assumptions we can generally count on in the AST.

The usual solution for these cases is to put it in the prelude and then save a copy in the globals of the translation unit. This case has an extra problem in that it is assignment over any data (unsized) type, which although does match the operation, is far too general because it matches everything.

So it does have to say hidden, but it should probably be moved. Or we could encode primitive C operations a different way.

I believe this is actually used as a kind of optimization or escape hatch to force the generated code to use a C assignment.

Change History (0)

Note: See TracTickets for help on using tickets.