eugenis added inline comments. ================ Comment at: lib/CodeGen/CGClass.cpp:1373 @@ -1372,1 +1372,3 @@ +// Disables tail call elimination, to save emitted callback from +// being optimized away. static void EmitDtorSanitizerCallback(CodeGenFunction &CGF, ---------------- 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.
================ Comment at: lib/CodeGen/CGClass.cpp:1389 @@ -1386,1 +1388,3 @@ + + CGF.CurFn->addFnAttr("disable-tail-calls", "true"); CGF.EmitNounwindRuntimeCall(Fn, Args); ---------------- Why not SetTailCall() on the new call instruction? ================ Comment at: test/CodeGenCXX/sanitize-dtor-tail-call.cpp:2 @@ +1,3 @@ +// Test -fsanitize-memory-use-after-dtor +// RUN: %clang_cc1 -O1 -fsanitize=memory -fsanitize-memory-use-after-dtor -std=c++11 -triple=x86_64-pc-linux -emit-llvm -o - %s | FileCheck %s + ---------------- try adding -disable-llvm-optzns flag to avoid running any optimizations and testing the IR right out of the frontend ================ Comment at: test/CodeGenCXX/sanitize-dtor-tail-call.cpp:19 @@ +18,3 @@ +// CHECK-NOT: {{\s*}}call void @__sanitizer_dtor_callback +// CHECK-NOT: {{\s*}}tail call void @__sanitizer_dtor_callback +// CHECK: ret void ---------------- You can check the lack of a tail on an instruction like this: CHECK: {{^ *}}call ... http://reviews.llvm.org/D11613 _______________________________________________ cfe-commits mailing list cfe-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits