smeenai updated this revision to Diff 69275.
smeenai added a comment.

Using attributes instead of compile flags, per compnerd's suggestion


https://reviews.llvm.org/D23878

Files:
  test/backtrace_test.pass.cpp

Index: test/backtrace_test.pass.cpp
===================================================================
--- test/backtrace_test.pass.cpp
+++ test/backtrace_test.pass.cpp
@@ -21,26 +21,30 @@
   return _URC_NO_REASON;
 }
 
+__attribute__ ((__noinline__))
 void call3_throw(size_t* ntraced) {
   try {
     _Unwind_Backtrace(trace_function, ntraced);
   } catch (...) {
     assert(false);
   }
 }
 
+__attribute__ ((__noinline__, __disable_tail_calls__))
 void call3_nothrow(size_t* ntraced) {
   _Unwind_Backtrace(trace_function, ntraced);
 }
 
+__attribute__ ((__noinline__, __disable_tail_calls__))
 void call2(size_t* ntraced, bool do_throw) {
   if (do_throw) {
     call3_throw(ntraced);
   } else {
     call3_nothrow(ntraced);
   }
 }
 
+__attribute__ ((__noinline__, __disable_tail_calls__))
 void call1(size_t* ntraced, bool do_throw) {
   call2(ntraced, do_throw);
 }


Index: test/backtrace_test.pass.cpp
===================================================================
--- test/backtrace_test.pass.cpp
+++ test/backtrace_test.pass.cpp
@@ -21,26 +21,30 @@
   return _URC_NO_REASON;
 }
 
+__attribute__ ((__noinline__))
 void call3_throw(size_t* ntraced) {
   try {
     _Unwind_Backtrace(trace_function, ntraced);
   } catch (...) {
     assert(false);
   }
 }
 
+__attribute__ ((__noinline__, __disable_tail_calls__))
 void call3_nothrow(size_t* ntraced) {
   _Unwind_Backtrace(trace_function, ntraced);
 }
 
+__attribute__ ((__noinline__, __disable_tail_calls__))
 void call2(size_t* ntraced, bool do_throw) {
   if (do_throw) {
     call3_throw(ntraced);
   } else {
     call3_nothrow(ntraced);
   }
 }
 
+__attribute__ ((__noinline__, __disable_tail_calls__))
 void call1(size_t* ntraced, bool do_throw) {
   call2(ntraced, do_throw);
 }
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to