[compiler-rt] r256103 - [PGO] Fix build failure with MSVC

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 19 11:16:32 PST 2015


Author: davidxl
Date: Sat Dec 19 13:16:32 2015
New Revision: 256103

URL: http://llvm.org/viewvc/llvm-project?rev=256103&view=rev
Log:
[PGO] Fix build failure with MSVC

Modified:
    compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c

Modified: compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c?rev=256103&r1=256102&r2=256103&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c Sat Dec 19 13:16:32 2015
@@ -34,24 +34,22 @@ void __llvm_profile_register_function(vo
     DataFirst = Data;
     DataLast = Data + 1;
     NamesFirst = Data->NamePtr;
-    NamesLast = Data->NamePtr + Data->NameSize;
+    NamesLast = (const char *)Data->NamePtr + Data->NameSize;
     CountersFirst = Data->CounterPtr;
-    CountersLast = Data->CounterPtr + Data->NumCounters;
+    CountersLast = (uint64_t *)Data->CounterPtr + Data->NumCounters;
     return;
   }
 
-#define UPDATE_FIRST(First, New) \
-  First = New < First ? New : First
+#define UPDATE_FIRST(First, New) First = New < First ? New : First
   UPDATE_FIRST(DataFirst, Data);
-  UPDATE_FIRST(NamesFirst, Data->NamePtr);
-  UPDATE_FIRST(CountersFirst, Data->CounterPtr);
+  UPDATE_FIRST(NamesFirst, (const char *)Data->NamePtr);
+  UPDATE_FIRST(CountersFirst, (uint64_t *)Data->CounterPtr);
 #undef UPDATE_FIRST
 
-#define UPDATE_LAST(Last, New) \
-  Last = New > Last ? New : Last
+#define UPDATE_LAST(Last, New) Last = New > Last ? New : Last
   UPDATE_LAST(DataLast, Data + 1);
-  UPDATE_LAST(NamesLast, Data->NamePtr + Data->NameSize);
-  UPDATE_LAST(CountersLast, Data->CounterPtr + Data->NumCounters);
+  UPDATE_LAST(NamesLast, (const char *)Data->NamePtr + Data->NameSize);
+  UPDATE_LAST(CountersLast, (uint64_t *)Data->CounterPtr + Data->NumCounters);
 #undef UPDATE_LAST
 }
 




More information about the llvm-commits mailing list