Jump to content
Sign in to follow this  
dummzeuch

Compiler option Reference Info / Definitions only

Recommended Posts

(I am giving some background first, there are actually some questions at the end, so please bear with me.)

 

In older Delphi IDEs there is a compiler option called "Reference Info" with a sub option "Definitions only".

Project-Options-Compiler-Delphi6.png.253bb16f459a3ccf1e3c802f656d78d6.png

 

In newer IDEs it's called "Symbol reference Info" and can have three values "None", "Definitions Only" and "Reference Info".

Project-Options-Compiler-Delphi10.2.thumb.png.3b4ab466d56198877478980f84f405ee.png

 

I never really thought about these options but just left them at the default which is both turned on for old Delphi versions and "Reference Info" for newer ones.

 

Today I noticed that they were set differently in some of my projects and I wondered why that was and for the first time ever looked into the documentation on that topic:

Quote

When a program or unit is compiled in the {$Y-} (or {DEFINITIONINFO OFF} or {REFERENCEINFO OFF}) state, no symbol reference information is recorded. This disables code browsing and the References page of the Code Browsing feature.

 

The $Y switch is usually used in conjunction with the $D and $L switches, which control generation of debug information and local symbol information. The $Y directive has no effect unless both $D and $L are enabled.

 

Note: Generating full cross-reference information ({$Y+}) can slow the compile/link cycle, so you should not use this except when you need the Project Manager References page.

(These are just the last two paragraphs of the remarks.)

 

"Code browsing" is the Ctrl+Click (or Alt+Up or Search -> Find original symbol, which oddly enough has an additional Hotkey Ctrl+G) feature combined with the Alt+Left / Alt + Right keys and the corresponding arrow buttons in the tool bar (respectively the two menu entries in View -> History). So that probably means that Ctrl+Click only works for units that were compiled with "Reference Info" is turned on. I could not verify this though: I switched a Delphi 10.2 project to "Symbol Reference Info = None", deleted all dcus, rebuilt it and Ctrl+Click still worked for all kinds of symbols: Inside the same unit, in other units of the projects and (less surprising, because these are the debug dcus that come with Delphi) in the RTL and VCL units.

 

But what is "the References page of the Code Browsing feature"? Is that what you get when selecting "Find -> Find References" ? If yes, why is that menu item disabled most of the time, even though the default for newer Delphi versions is "Reference Info"?

 

And what is the "Project Manager References Page"?

Edited by dummzeuch

Share this post


Link to post

Add me to the interested parties list for this topic.

 

One thing I learned while reading about {$Y+} and the such is apparently the feature only works when the target is WIN32.

 

But even after switching a project from WIN64 to WIN32 I am still unable to actually find anything that I would call a symbol cross-reference listing. What's the trick?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×