-
Notifications
You must be signed in to change notification settings - Fork 27
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
Missed reduction: inlining template functions #89
Comments
Thank you very much! To be honest, I'm not C++ expect, can you please describe what does the syntax:
? Maybe @strimo378 can chime in? |
Essentially, clang crashes as long as the template function I guess there is an "inlining" pass in cvise that would resolve code like
into
? If you could point me at it, maybe I could get some inspiration from there. |
Hi, there are two things that are not correctly working here:
If you want to get your hands dirty, I suggest that you take a look at the inlining transformation and see if you can fix it. The transformation is part of the clang_delta utility and you can find it within SimpleInliner.cpp. You can manually run clang_delta for your test case using the following command line:
|
I think the inlining transformation is actually fine here. I manually removed as many templates as I could while preserving the crash and got to
When I run cvise on it, it gives
which is the smallest reproducer. I guess I should then look at the pass that is supposed to turn the function templates into normal functions and remove the |
Yes, but why is the inlining transformation not trying to inline templated functions? That would also work for you. Maybe there is a simple test that could be removed. I am not sure if there exists a transformation for removing templates from functions. I think it is currently implicitly covered by the token remover pass. There exists a transformation to remove templates from classes (class-template-to-class) but there exists also passes to remove single template parameters... |
Please take a look at |
Can you please provide an interestingness test I can use? Does it happen for stock clang as well? |
No, unfortunately the crash only happens with our internal version. But you can reproduce the same cvise behavior with
and
|
Hi!
Since I discovered cvise, I love it. Thank you very much for making this helpful tool!
I saw the following reduced code coming out of cvise 2.6.0 (9d01a9c),
but I can manually reduce it further to
How can we teach cvise to do those reductions? I'm happy to get my hands dirty (I have experience with clang),
but I would need some pointers where and how to implement this transformation to get started.
The text was updated successfully, but these errors were encountered: