[compiler-rt] r231975 - Be nicer to C90 environments and avoid the declaration of variables in for

Joerg Sonnenberger joerg at bec.de
Wed Mar 11 15:06:53 PDT 2015


Author: joerg
Date: Wed Mar 11 17:06:53 2015
New Revision: 231975

URL: http://llvm.org/viewvc/llvm-project?rev=231975&view=rev
Log:
Be nicer to C90 environments and avoid the declaration of variables in for
header.

>From Alexander Esilevich.

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=231975&r1=231974&r2=231975&view=diff
==============================================================================
--- compiler-rt/trunk/lib/builtins/clear_cache.c (original)
+++ compiler-rt/trunk/lib/builtins/clear_cache.c Wed Mar 11 17:06:53 2015
@@ -128,6 +128,7 @@ void __clear_cache(void *start, void *en
 #elif defined(__aarch64__) && !defined(__APPLE__)
   uint64_t xstart = (uint64_t)(uintptr_t) start;
   uint64_t xend = (uint64_t)(uintptr_t) end;
+  uint64_t addr;
 
   // Get Cache Type Info
   uint64_t ctr_el0;
@@ -138,12 +139,12 @@ void __clear_cache(void *start, void *en
    * uintptr_t in case this runs in an IPL32 environment.
    */
   const size_t dcache_line_size = 4 << ((ctr_el0 >> 16) & 15);
-  for (uint64_t addr = xstart; addr < xend; addr += dcache_line_size)
+  for (addr = xstart; addr < xend; addr += dcache_line_size)
     __asm __volatile("dc cvau, %0" :: "r"(addr));
   __asm __volatile("dsb ish");
 
   const size_t icache_line_size = 4 << ((ctr_el0 >> 0) & 15);
-  for (uint64_t addr = xstart; addr < xend; addr += icache_line_size)
+  for (addr = xstart; addr < xend; addr += icache_line_size)
     __asm __volatile("ic ivau, %0" :: "r"(addr));
   __asm __volatile("isb sy");
 #else





More information about the llvm-commits mailing list