Mike Noakes was working on pushing the creation of module initialization 
functions later in the translation.  This is a case he (we, since I reviewed) 
overlooked.

The extern block implementation formerly had to accommodate the 
implementation's early rewriting that placed global (i.e. module-level) 
declarations into the corresponding module initialization function.  So this 
change should result in the extern block implementation becoming simpler: 
Inserting the global declaration anywhere in the enclosing module block should 
"just work".

THH
________________________________________
From: Michael Ferguson [[email protected]]
Sent: Thursday, August 07, 2014 8:41 AM
To: chapel-developers
Subject: [Chapel-developers] module init functions

Hi -

I've noticed that
  chpl --print-passes test/extern/ferguson/externblock/define.chpl
now core dumps in the compiler because
the extern block support tries to do
  module->initFn->insertAtHead(result);
when trying to add a global variable,
but module->initFn is NULL.

This used to work but I recall seeing some recent
changes to module initialization.

Since readExternC runs fairly early on
(so that it can happen before scopeResolve),
it sometimes changes the AST in odd ways.
How should it add a global variable?
(Is there a way to request that the module's
  init function be created, for example? Or
  should it be doing something else?)

Thanks,

-michael

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls.
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers

Reply via email to