Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#3861 closed enhancement (fixed)

Do not use preprocessor for code generation

Reported by: Martin Sjölund Owned by: Martin Sjölund
Priority: high Milestone:
Component: Code Generation Version:
Keywords: Cc: Francesco Casella, Lennart Ochel, Willi Braun, Volker Waurich, Adrian Pop, Per Östlund

Description

The current code generator uses the pre-processor for lookup from variable name to its corresponding array and index in this array.

This is not scalable and needs to change (with 500k variables, the model.h is 400MB in size and empty files take 15 seconds to compile, prevent speed-up by splitting compilation into more files).

I see two main ways of doing this:

  1. Walk the SimCode structure, replacing any CREF expressions, etc with a CREF_CODEGEN(EnumArrayName, IntegerIndex, CREF /* for error-messages*/)
  2. Send in a hash-table to the generator

I prefer the first choice since we need less logic in the code generator, not more. We could perhaps even have special CREF structures for arrays and records, etc...

Any volunteers for implementation?

Change History (3)

comment:1 by Martin Sjölund, 9 years ago

Owner: changed from Lennart Ochel to Martin Sjölund
Status: newaccepted

comment:2 by Martin Sjölund, 9 years ago

Milestone: Future1.10.0
Resolution: fixed
Status: acceptedclosed

Fixed in PR:871

comment:3 by Martin Sjölund, 7 years ago

Milestone: 1.10.0

Milestone deleted

Note: See TracTickets for help on using tickets.