Skip to content
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

_STL_VERIFY shouldn't emit long strings for function names #2054

Merged
merged 4 commits into from
Jul 30, 2021

Conversation

fsb4000
Copy link
Contributor

@fsb4000 fsb4000 commented Jul 10, 2021

Fixes #1956

Before the changes I had

C:\Dev\STL\out\build\x64\out\inc\ranges(1627): fatal error C1091: compiler limit: string exceeds 65535 bytes in length
C:\Dev\STL\out\build\x64\out\inc\ranges(1623): note: while compiling class template member function 'double std::ranges::transform_view<std::ranges::transform_view<std::ranges::transform_view<std::ranges::transform_view<std::ranges::filter_view<std::ranges::filter_view<std::ranges::filter_view<std::ranges::ref_view<std::vector<myVeryLongNamespace::D,std::allocator<myVeryLongNamespace::D>>>,_Ty>,_Ty>,_Ty>,myVeryLongNamespace::D::getFirstValue::<lambda_1>>,myVeryLongNamespace::C::getFirstValue::<lambda_1>>,myVeryLongNamespace::B::getFirstValue::<lambda_1>>,myVeryLongNamespace::A::getFirstValue::<lambda_1>>::_Iterator<false>::operator *(void) const'
        with
        [
            _Ty=test::<lambda_1>
        ]
C:\Dev\STL\tests\std\tests\GH_001956_stl_verify_emits_long_strings\test.compile.pass.cpp(24): note: see reference to class template instantiation 'std::ranges::transform_view<std::ranges::transform_view<std::ranges::transform_view<std::ranges::transform_view<std::ranges::filter_view<std::ranges::filter_view<std::ranges::filter_view<std::ranges::ref_view<std::vector<myVeryLongNamespace::D,std::allocator<myVeryLongNamespace::D>>>,_Ty>,_Ty>,_Ty>,myVeryLongNamespace::D::getFirstValue::<lambda_1>>,myVeryLongNamespace::C::getFirstValue::<lambda_1>>,myVeryLongNamespace::B::getFirstValue::<lambda_1>>,myVeryLongNamespace::A::getFirstValue::<lambda_1>>::_Iterator<false>' being compiled
        with
        [
            _Ty=test::<lambda_1>
        ]
C:\Dev\STL\tests\std\tests\GH_001956_stl_verify_emits_long_strings\test.compile.pass.cpp(39): note: see reference to function template instantiation 'double myVeryLongNamespace::A::getFirstValue<std::ranges::transform_view<std::ranges::transform_view<std::ranges::transform_view<std::ranges::filter_view<std::ranges::filter_view<std::ranges::filter_view<std::ranges::ref_view<std::vector<myVeryLongNamespace::D,std::allocator<myVeryLongNamespace::D>>>,_Ty>,_Ty>,_Ty>,myVeryLongNamespace::D::getFirstValue::<lambda_1>>,myVeryLongNamespace::C::getFirstValue::<lambda_1>>,myVeryLongNamespace::B::getFirstValue::<lambda_1>>&>(RangeOfA)' being compiled
        with
        [
            _Ty=test::<lambda_1>,
            RangeOfA=std::ranges::transform_view<std::ranges::transform_view<std::ranges::transform_view<std::ranges::filter_view<std::ranges::filter_view<std::ranges::filter_view<std::ranges::ref_view<std::vector<myVeryLongNamespace::D,std::allocator<myVeryLongNamespace::D>>>,test::<lambda_1>>,test::<lambda_1>>,test::<lambda_1>>,myVeryLongNamespace::D::getFirstValue::<lambda_1>>,myVeryLongNamespace::C::getFirstValue::<lambda_1>>,myVeryLongNamespace::B::getFirstValue::<lambda_1>> &
        ]
C:\Dev\STL\tests\std\tests\GH_001956_stl_verify_emits_long_strings\test.compile.pass.cpp(54): note: see reference to function template instantiation 'double myVeryLongNamespace::B::getFirstValue<std::ranges::transform_view<std::ranges::transform_view<std::ranges::filter_view<std::ranges::filter_view<std::ranges::filter_view<std::ranges::ref_view<std::vector<myVeryLongNamespace::D,std::allocator<myVeryLongNamespace::D>>>,_Ty>,_Ty>,_Ty>,myVeryLongNamespace::D::getFirstValue::<lambda_1>>,myVeryLongNamespace::C::getFirstValue::<lambda_1>>&>(RangeOfB)' being compiled
        with
        [
            _Ty=test::<lambda_1>,
            RangeOfB=std::ranges::transform_view<std::ranges::transform_view<std::ranges::filter_view<std::ranges::filter_view<std::ranges::filter_view<std::ranges::ref_view<std::vector<myVeryLongNamespace::D,std::allocator<myVeryLongNamespace::D>>>,test::<lambda_1>>,test::<lambda_1>>,test::<lambda_1>>,myVeryLongNamespace::D::getFirstValue::<lambda_1>>,myVeryLongNamespace::C::getFirstValue::<lambda_1>> &
        ]
C:\Dev\STL\tests\std\tests\GH_001956_stl_verify_emits_long_strings\test.compile.pass.cpp(69): note: see reference to function template instantiation 'double myVeryLongNamespace::C::getFirstValue<std::ranges::transform_view<std::ranges::filter_view<std::ranges::filter_view<std::ranges::filter_view<std::ranges::ref_view<std::vector<myVeryLongNamespace::D,std::allocator<myVeryLongNamespace::D>>>,_Ty>,_Ty>,_Ty>,myVeryLongNamespace::D::getFirstValue::<lambda_1>>&>(RangeOfC)' being compiled
        with
        [
            _Ty=test::<lambda_1>,
            RangeOfC=std::ranges::transform_view<std::ranges::filter_view<std::ranges::filter_view<std::ranges::filter_view<std::ranges::ref_view<std::vector<myVeryLongNamespace::D,std::allocator<myVeryLongNamespace::D>>>,test::<lambda_1>>,test::<lambda_1>>,test::<lambda_1>>,myVeryLongNamespace::D::getFirstValue::<lambda_1>> &
        ]
C:\Dev\STL\tests\std\tests\GH_001956_stl_verify_emits_long_strings\test.compile.pass.cpp(93): note: see reference to function template instantiation 'double myVeryLongNamespace::D::getFirstValue<std::ranges::filter_view<std::ranges::filter_view<std::ranges::filter_view<std::ranges::ref_view<std::vector<myVeryLongNamespace::D,std::allocator<myVeryLongNamespace::D>>>,_Ty>,_Ty>,_Ty>&>(RangeOfD)' being compiled
        with
        [
            _Ty=test::<lambda_1>,
            RangeOfD=std::ranges::filter_view<std::ranges::filter_view<std::ranges::filter_view<std::ranges::ref_view<std::vector<myVeryLongNamespace::D,std::allocator<myVeryLongNamespace::D>>>,test::<lambda_1>>,test::<lambda_1>>,test::<lambda_1>> &
        ]

@fsb4000 fsb4000 requested a review from a team as a code owner July 10, 2021 08:47
@fsb4000 fsb4000 changed the title _STL_VERIFY doesn't emit long strings for function names _STL_VERIFY shouldn't emit long strings for function names Jul 10, 2021
@fsb4000
Copy link
Contributor Author

fsb4000 commented Jul 10, 2021

second test:

#include <iostream>

int main() {
    _STL_VERIFY (false, "just a test");
}
cl /nologo /EHsc /W4 /WX /MDd /std:c++latest test.cpp

изображение

@StephanTLavavej StephanTLavavej added the performance Must go faster label Jul 13, 2021
Copy link
Member

@StephanTLavavej StephanTLavavej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - I'll push comment changes.

stl/inc/yvals.h Outdated Show resolved Hide resolved
stl/inc/yvals.h Outdated Show resolved Hide resolved
@fsb4000
Copy link
Contributor Author

fsb4000 commented Jul 14, 2021

I knew that these comments were needed, but I had not write them for an unknown reason. Sorry :(

@CaseyCarter CaseyCarter changed the title _STL_VERIFY shouldn't emit long strings for function names _STL_VERIFY shouldn't emit long strings for function names Jul 14, 2021
@StephanTLavavej StephanTLavavej self-assigned this Jul 29, 2021
@StephanTLavavej
Copy link
Member

I'm going to add this to the next batch of changes to merge - please notify me if any further commits are pushed.

@StephanTLavavej StephanTLavavej merged commit 8897850 into microsoft:main Jul 30, 2021
@StephanTLavavej
Copy link
Member

Thanks for reducing debug codegen size! 🔬 😸 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Must go faster
Projects
None yet
Development

Successfully merging this pull request may close these issues.

<yvals.h>: _STL_VERIFY emits long strings for function names, apparently unused
5 participants