-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Reduce/improve includes usage in ROOT header files #5535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Starting build on |
|
Build failed on ROOT-fedora31/noimt. Failing tests: |
core/base/inc/TError.h
Outdated
|
|
||
| #include "RtypesCore.h" | ||
| #include <stdarg.h> | ||
| #include "Rtypes.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is incorrect. RtypesCore.h allows us to include this header in -fno-rtti context.
In general, I am not quite sure if we should be doing such a header cleanup...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put here Rtypes.h to also access RConfigure.h immediately, but ok - one can do it explicitly. I will change it.
| // // | ||
| ////////////////////////////////////////////////////////////////////////// | ||
|
|
||
| #include "Rtypes.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise.
|
Starting build on |
|
Build failed on ROOT-debian10-i386/cxx14. Failing tests: |
|
Starting build on |
|
Build failed on ROOT-fedora31/noimt. Errors:
|
|
Build failed on ROOT-fedora30/cxx14. Errors:
|
|
@linev |
|
@hageboeck Do you want to rebase PR against master? If yes, I can do it |
|
@hageboeck Lets do better. I can apply roofit changes as separate PR. And then rebase this one |
|
Build failed on windows10/cxx14. Errors:
|
|
Build failed on ROOT-fedora29/python3. Failing tests: |
|
Starting build on |
|
Build failed on ROOT-fedora29/python3. Failing tests: |
|
Starting build on |
|
Build failed on ROOT-fedora30/cxx14. Failing tests: |
|
Build failed on ROOT-fedora29/python3. Failing tests: |
|
Build failed on ROOT-debian10-i386/cxx14. Failing tests: |
|
@phsft-bot build |
|
Starting build on |
|
Starting build on |
| #include "TDirectory.h" | ||
| #include "TList.h" | ||
| #include "RConfigure.h" | ||
| // #include "TList.h" // included in TDirectory.h |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it is just directly here, so we ought to keep it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See TDirectory.h - "TList.h" included only without R__LESS_INCLUDES. Means in the dev build TList is just forward declarations. I just want to avoid same construct here.
| TVirtualPad *GetSelectedPad() const { return fSelectPad; } | ||
| Int_t GetNclasses() const { return fClasses->GetSize(); } | ||
| Int_t GetNtypes() const { return fTypes->GetSize(); } | ||
| Int_t GetNclasses() const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why make that change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because TList.h is not included with R__LESS_INLCUDES - see my previous comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. This illustrate a trade off: small speedup at parsing time (removing the the include of TList.h for the (rare?) file that uses TROOT but not TList) vs a small performance increase (for the code that uses GetNclasses and GetNtypes).
Whether one is better than the other is .. well .. hard to know (and in probably in both case the actual performance change is likely indistinguishable) .. I would probably not have made that change but reverting it is also probably not worth it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pcanal Should I revert these changes in TROOT.h?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Up to you in the end. I slightly lean for revert but not if it is too much hassle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to keep changes. These methods are not crucial for performance.
Replace includes by forward declarations were class definitions not required.
In places where includes may be required by user code keep it under
R__LESS_INCLUDESdefinition.RooFit changes extracted into #5542 - there was need for rebase after recent changes