From: Martin Storsjo Date: Fri, 19 Jan 2018 07:34:46 +0000 (+0000) Subject: [builtins] Use FlushInstructionCache on windows on aarch64 as well X-Git-Tag: llvmorg-7.0.0-rc1~14864 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fe011a6ed95c111c5c9e9915dc7176ef99f5f66a;p=platform%2Fupstream%2Fllvm.git [builtins] Use FlushInstructionCache on windows on aarch64 as well Generalize this handling to a separate toplevel ifdef (since any windows case should use the same function), instead of indenting the aarch64 case one step further. Differential Revision: https://reviews.llvm.org/D42197 llvm-svn: 322928 --- diff --git a/compiler-rt/lib/builtins/clear_cache.c b/compiler-rt/lib/builtins/clear_cache.c index 4a01cb4..3614bc9 100644 --- a/compiler-rt/lib/builtins/clear_cache.c +++ b/compiler-rt/lib/builtins/clear_cache.c @@ -96,6 +96,8 @@ void __clear_cache(void *start, void *end) { * Intel processors have a unified instruction and data cache * so there is nothing to do */ +#elif defined(_WIN32) && (defined(__arm__) || defined(__aarch64__)) + FlushInstructionCache(GetCurrentProcess(), start, end - start); #elif defined(__arm__) && !defined(__APPLE__) #if defined(__FreeBSD__) || defined(__NetBSD__) struct arm_sync_icache_args arg; @@ -123,8 +125,6 @@ void __clear_cache(void *start, void *end) { : "r"(syscall_nr), "r"(start_reg), "r"(end_reg), "r"(flags)); assert(start_reg == 0 && "Cache flush syscall failed."); - #elif defined(_WIN32) - FlushInstructionCache(GetCurrentProcess(), start, end - start); #else compilerrt_abort(); #endif