-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[cxxmodules] Fix autoloading of nested namespaces. #1337
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 |
This PR should supersede PR #1328. |
71c7b14
to
bdf6c47
Compare
Starting build on |
bdf6c47
to
e74bfdd
Compare
Starting build on |
Build failed on mac1012/native. Warnings:
And 10 more Failing tests:
And 2 more |
e74bfdd
to
5a9d4bc
Compare
Starting build on |
Build failed on slc6/gcc49. Failing tests: |
Build failed on centos7/gcc49. Failing tests: |
@phsft-bot build with -Druntime_cxxmodules=On |
Starting build on |
Build failed on centos7/gcc49. Failing tests: |
5a9d4bc
to
da3621d
Compare
Starting build on |
@phsft-bot just on slc6/gcc62 with flags -Druntime_cxxmodules=On |
@phsft-bot build just on slc6/gcc62 with flags -Druntime_cxxmodules=On |
Starting build on |
da3621d
to
b77d6c0
Compare
Starting build on |
Build failed on slc6/gcc62. Warnings:
And 7 more Failing tests:
And 37 more |
When we want to autoload contents from namespaces we end up in Sema::LookupQualifiedName; then we issue a callback to FindExternallyVisibleName which forwards to LookupObject. Lookup object takes a DeclContext as an argument. This argument is always the primary lookup context (which for a NamespaceDecl is the original namespace. Regular autoloading does not consider this (or has chosen not to) because this reduces the amount of autoloads. Such autoloads can happen when resolving template specializations when computing a decl's linkage by clang's CodeGen. This in turn loads unexpected libraries such as RooFit when trying to resolve all template specializations of __to_raw_pointer (located in <memory>), including the one taking a HistFactory::Data*. That way we end up needlessly loading RooFit and showing it's weird banner, potentially breaking a lot of tests. This behavior can be considered as broken because we hide information about possible redeclarations which can affect the linkage computation or other checks in codegen. If we fix the bug we will probably explode ROOT's memory footprint and make the gap between standard ROOT and ROOT with modules even bigger. Since it is not clear how much work and issue resolving is required for standard ROOT, we can probably only live with the workaround of the missing concept: moving entities in namespaces whose autoloading requires declarations to be in the PCH. For instance, ROOT::Experimental::TDataFrame.
b77d6c0
to
2b0e363
Compare
Starting build on |
Build failed on slc6/gcc62. Warnings:
And 7 more Failing tests:
And 37 more |
When we want to autoload contents from namespaces we end up in
Sema::LookupQualifiedName; then we issue a callback to
FindExternallyVisibleName which forwards to LookupObject. Lookup object
takes a DeclContext as an argument. This argument is always the primary
lookup context (which for a NamespaceDecl is the original namespace.
Regular autoloading does not consider this (or has chosen not to) because
this reduces the amount of autoloads. Such autoloads can happen when
resolving template specializations when computing a decl's linkage by
clang's CodeGen. This in turn loads unexpected libraries such as RooFit
when trying to resolve all template specializations of __to_raw_pointer
(located in <memory>), including the one taking a HistFactory::Data*.
The amount of deserializations might be reduced by applying D29951.
That way we end up needlessly loading RooFit and showing it's weird
banner, potentially breaking a lot of tests.
This behavior can be considered as broken because we hide information
about possible redeclarations which can affect the linkage computation or
other checks in codegen. If we fix the bug we will probably explode
ROOT's memory footprint and make the gap between standard ROOT and ROOT
with modules even bigger.
Since it is not clear how much work and issue resolving is required for
standard ROOT, we can probably only live with the workaround of the missing
concept: moving entities in namespaces whose autoloading requires declarations
to be in the PCH. For instance, ROOT::Experimental::TDataFrame.