Details
Diff Detail
Event Timeline
| lib/CodeGen/CGClass.cpp | ||
|---|---|---|
| 1373 | It's not the callback that is being optimized away. The optimization avoids allocating a new frame for the callback function, making the destructor frame to disappear from the stack trace. | |
| 1389 | Why not SetTailCall() on the new call instruction? | |
| test/CodeGenCXX/sanitize-dtor-tail-call.cpp | ||
| 3 | try adding -disable-llvm-optzns flag to avoid running any optimizations and testing the IR right out of the frontend | |
| 20 | You can check the lack of a tail on an instruction like this: CHECK: {{^ *}}call ... | |
| lib/CodeGen/CGClass.cpp | ||
|---|---|---|
| 1389 | When I did that, it was still emitting tail calls | |
| cfe/trunk/test/CodeGenCXX/sanitize-dtor-tail-call.cpp | ||
|---|---|---|
| 17 ↗ | (On Diff #31053) | I don't think this check verifies what you want it to verify... you need to order it like this: // CHECK-NOT: {{\s*}}tail call void @__sanitizer_dtor_callback
// CHECK: {{\s*}}call void @__sanitizer_dtor_callback
// CHECK-NOT: {{\s*}}call void @__sanitizer_dtor_callbackor better yet: // CHECK: {{^ +}}call void @__sanitizer_dtor_callback
// CHECK-NOT: call void @__sanitizer_dtor_callback | 
| cfe/trunk/test/CodeGenCXX/sanitize-dtor-tail-call.cpp | ||
|---|---|---|
| 17 ↗ | (On Diff #31053) | The final committed version reflects your suggested changes. I'm not sure why they're not showing up here- I had some difficulty squashing my local commits into a single commit for the remote. | 
It's not the callback that is being optimized away. The optimization avoids allocating a new frame for the callback function, making the destructor frame to disappear from the stack trace.