[compiler-rt] r314322 - [ARM] builtins: Replace abort by assert in clear_cache.

Manoj Gupta via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 27 10:36:25 PDT 2017


Author: manojgupta
Date: Wed Sep 27 10:36:25 2017
New Revision: 314322

URL: http://llvm.org/viewvc/llvm-project?rev=314322&view=rev
Log:
[ARM] builtins: Replace abort by assert in clear_cache.

Summary:
__builtion___clear_cache maps to clear_cache function. On Linux,
clear_cache functions makes a syscall and does an abort if syscall fails.
Replace the abort by an assert so that non-debug builds do not abort
if the syscall fails.

Fixes PR34588.

Reviewers: rengolin, compnerd, srhines, peter.smith, joerg

Reviewed By: rengolin

Subscribers: aemerson, kristof.beyls, llvm-commits

Differential Revision: https://reviews.llvm.org/D37788

Modified:
    compiler-rt/trunk/lib/builtins/clear_cache.c

Modified: compiler-rt/trunk/lib/builtins/clear_cache.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/builtins/clear_cache.c?rev=314322&r1=314321&r2=314322&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/clear_cache.c (original)
+++ compiler-rt/trunk/lib/builtins/clear_cache.c Wed Sep 27 10:36:25 2017
@@ -9,6 +9,7 @@
  */
 
 #include "int_lib.h"
+#include <assert.h>
 #include <stddef.h>
 
 #if __APPLE__
@@ -121,9 +122,7 @@ void __clear_cache(void *start, void *en
                           : "=r"(start_reg)
                           : "r"(syscall_nr), "r"(start_reg), "r"(end_reg),
                             "r"(flags));
-         if (start_reg != 0) {
-             compilerrt_abort();
-         }
+         assert(start_reg == 0 && "Cache flush syscall failed.");
     #elif defined(_WIN32)
         FlushInstructionCache(GetCurrentProcess(), start, end - start);
     #else




More information about the llvm-commits mailing list