[compiler-rt] r362682 - Fixup files added in r362636 to build with gcc 5.4. NFCI

Douglas Yung via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 6 01:04:33 PDT 2019


Author: dyung
Date: Thu Jun  6 01:04:33 2019
New Revision: 362682

URL: http://llvm.org/viewvc/llvm-project?rev=362682&view=rev
Log:
Fixup files added in r362636 to build with gcc 5.4. NFCI

Modified:
    compiler-rt/trunk/lib/gwp_asan/guarded_pool_allocator.cpp
    compiler-rt/trunk/lib/gwp_asan/guarded_pool_allocator.h

Modified: compiler-rt/trunk/lib/gwp_asan/guarded_pool_allocator.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/gwp_asan/guarded_pool_allocator.cpp?rev=362682&r1=362681&r2=362682&view=diff
==============================================================================
--- compiler-rt/trunk/lib/gwp_asan/guarded_pool_allocator.cpp (original)
+++ compiler-rt/trunk/lib/gwp_asan/guarded_pool_allocator.cpp Thu Jun  6 01:04:33 2019
@@ -260,9 +260,9 @@ uintptr_t GuardedPoolAllocator::allocati
   return Offset;
 }
 
-void GuardedPoolAllocator::reportError(uintptr_t AccessPtr, Error Error) {
+void GuardedPoolAllocator::reportError(uintptr_t AccessPtr, Error E) {
   if (SingletonPtr)
-    SingletonPtr->reportErrorInternal(AccessPtr, Error);
+    SingletonPtr->reportErrorInternal(AccessPtr, E);
 }
 
 size_t GuardedPoolAllocator::getNearestSlot(uintptr_t Ptr) const {
@@ -311,9 +311,9 @@ Error GuardedPoolAllocator::diagnoseUnkn
 // Prints the provided error and metadata information. Returns true if there is
 // additional context that can be provided, false otherwise (i.e. returns false
 // if Error == {UNKNOWN, INVALID_FREE without metadata}).
-bool printErrorType(Error Error, uintptr_t AccessPtr, AllocationMetadata *Meta,
+bool printErrorType(Error E, uintptr_t AccessPtr, AllocationMetadata *Meta,
                     options::Printf_t Printf) {
-  switch (Error) {
+  switch (E) {
   case Error::UNKNOWN:
     Printf("GWP-ASan couldn't automatically determine the source of the "
            "memory error when accessing 0x%zx. It was likely caused by a wild "
@@ -361,7 +361,7 @@ bool printErrorType(Error Error, uintptr
   return true;
 }
 
-void printThreadInformation(Error Error, uintptr_t AccessPtr,
+void printThreadInformation(Error E, uintptr_t AccessPtr,
                             AllocationMetadata *Meta,
                             options::Printf_t Printf) {
   Printf("0x%zx was allocated by thread ", AccessPtr);
@@ -370,7 +370,7 @@ void printThreadInformation(Error Error,
   else
     Printf("%zu.\n", Meta->AllocationTrace.ThreadID);
 
-  if (Error == Error::USE_AFTER_FREE || Error == Error::DOUBLE_FREE) {
+  if (E == Error::USE_AFTER_FREE || E == Error::DOUBLE_FREE) {
     Printf("0x%zx was freed by thread ", AccessPtr);
     if (Meta->AllocationTrace.ThreadID == UINT64_MAX)
       Printf("UNKNOWN.\n");
@@ -386,7 +386,7 @@ struct ScopedEndOfReportDecorator {
 };
 
 void GuardedPoolAllocator::reportErrorInternal(uintptr_t AccessPtr,
-                                               Error Error) {
+                                               Error E) {
   if (!pointerIsMine(reinterpret_cast<void *>(AccessPtr))) {
     return;
   }
@@ -401,8 +401,8 @@ void GuardedPoolAllocator::reportErrorIn
 
   AllocationMetadata *Meta = nullptr;
 
-  if (Error == Error::UNKNOWN) {
-    Error = diagnoseUnknownError(AccessPtr, &Meta);
+  if (E == Error::UNKNOWN) {
+    E = diagnoseUnknownError(AccessPtr, &Meta);
   } else {
     size_t Slot = getNearestSlot(AccessPtr);
     Meta = addrToMetadata(slotToAddr(Slot));
@@ -412,7 +412,7 @@ void GuardedPoolAllocator::reportErrorIn
   }
 
   // Print the error information, and if there is no valid metadata, stop here.
-  if (!printErrorType(Error, AccessPtr, Meta, Printf)) {
+  if (!printErrorType(E, AccessPtr, Meta, Printf)) {
     return;
   }
 
@@ -422,7 +422,7 @@ void GuardedPoolAllocator::reportErrorIn
     return;
   }
 
-  printThreadInformation(Error, AccessPtr, Meta, Printf);
+  printThreadInformation(E, AccessPtr, Meta, Printf);
   // TODO(hctim): Implement stack unwinding here. Ask the caller to provide us
   // with the base pointer, and we unwind the stack to give a stack trace for
   // the access.

Modified: compiler-rt/trunk/lib/gwp_asan/guarded_pool_allocator.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/gwp_asan/guarded_pool_allocator.h?rev=362682&r1=362681&r2=362682&view=diff
==============================================================================
--- compiler-rt/trunk/lib/gwp_asan/guarded_pool_allocator.h (original)
+++ compiler-rt/trunk/lib/gwp_asan/guarded_pool_allocator.h Thu Jun  6 01:04:33 2019
@@ -135,7 +135,7 @@ public:
   // singleton pointer and call the internal version of this function. This
   // method is never thread safe, and should only be called when fatal errors
   // occur.
-  static void reportError(uintptr_t AccessPtr, Error Error = Error::UNKNOWN);
+  static void reportError(uintptr_t AccessPtr, Error E = Error::UNKNOWN);
 
 private:
   static constexpr size_t kInvalidSlotID = SIZE_MAX;
@@ -204,7 +204,7 @@ private:
   // responsible for the error is placed in *Meta.
   Error diagnoseUnknownError(uintptr_t AccessPtr, AllocationMetadata **Meta);
 
-  void reportErrorInternal(uintptr_t AccessPtr, Error Error);
+  void reportErrorInternal(uintptr_t AccessPtr, Error E);
 
   // Cached page size for this system in bytes.
   size_t PageSize = 0;




More information about the llvm-commits mailing list