[compiler-rt] r348338 - [XRay] Use uptr instead of uintptr_t

Dean Michael Berris via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 4 23:14:07 PST 2018


Author: dberris
Date: Tue Dec  4 23:14:06 2018
New Revision: 348338

URL: http://llvm.org/viewvc/llvm-project?rev=348338&view=rev
Log:
[XRay] Use uptr instead of uintptr_t

Follow-up to D54989.

Modified:
    compiler-rt/trunk/lib/xray/xray_profiling.cc

Modified: compiler-rt/trunk/lib/xray/xray_profiling.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/xray/xray_profiling.cc?rev=348338&r1=348337&r2=348338&view=diff
==============================================================================
--- compiler-rt/trunk/lib/xray/xray_profiling.cc (original)
+++ compiler-rt/trunk/lib/xray/xray_profiling.cc Tue Dec  4 23:14:06 2018
@@ -78,21 +78,21 @@ static ProfilingData *getThreadLocalData
   if (atomic_load_relaxed(&ThreadExitingLatch))
     return nullptr;
 
-  uintptr_t Allocators = 0;
+  uptr Allocators = 0;
   if (atomic_compare_exchange_strong(&TLD.Allocators, &Allocators, 1,
                                      memory_order_acq_rel)) {
     new (&AllocatorsStorage)
         FunctionCallTrie::Allocators(FunctionCallTrie::InitAllocators());
-    Allocators = reinterpret_cast<uintptr_t>(
+    Allocators = reinterpret_cast<uptr>(
         reinterpret_cast<FunctionCallTrie::Allocators *>(&AllocatorsStorage));
     atomic_store(&TLD.Allocators, Allocators, memory_order_release);
   }
 
-  uintptr_t FCT = 0;
+  uptr FCT = 0;
   if (atomic_compare_exchange_strong(&TLD.FCT, &FCT, 1, memory_order_acq_rel)) {
     new (&FunctionCallTrieStorage) FunctionCallTrie(
         *reinterpret_cast<FunctionCallTrie::Allocators *>(Allocators));
-    FCT = reinterpret_cast<uintptr_t>(
+    FCT = reinterpret_cast<uptr>(
         reinterpret_cast<FunctionCallTrie *>(&FunctionCallTrieStorage));
     atomic_store(&TLD.FCT, FCT, memory_order_release);
   }
@@ -109,13 +109,13 @@ static void cleanupTLD() XRAY_NEVER_INST
     return;
 
   auto FCT = atomic_exchange(&TLD.FCT, 0, memory_order_acq_rel);
-  if (FCT == reinterpret_cast<uintptr_t>(reinterpret_cast<FunctionCallTrie *>(
+  if (FCT == reinterpret_cast<uptr>(reinterpret_cast<FunctionCallTrie *>(
                  &FunctionCallTrieStorage)))
     reinterpret_cast<FunctionCallTrie *>(FCT)->~FunctionCallTrie();
 
   auto Allocators = atomic_exchange(&TLD.Allocators, 0, memory_order_acq_rel);
   if (Allocators ==
-      reinterpret_cast<uintptr_t>(
+      reinterpret_cast<uptr>(
           reinterpret_cast<FunctionCallTrie::Allocators *>(&AllocatorsStorage)))
     reinterpret_cast<FunctionCallTrie::Allocators *>(Allocators)->~Allocators();
 }
@@ -125,8 +125,8 @@ static void postCurrentThreadFCT(Profili
   if (!TLDInit)
     return;
 
-  uintptr_t P = atomic_load(&T.FCT, memory_order_acquire);
-  if (P != reinterpret_cast<uintptr_t>(
+  uptr P = atomic_load(&T.FCT, memory_order_acquire);
+  if (P != reinterpret_cast<uptr>(
                reinterpret_cast<FunctionCallTrie *>(&FunctionCallTrieStorage)))
     return;
 




More information about the llvm-commits mailing list