[compiler-rt] r258890 - Sync up with master file

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 26 16:14:15 PST 2016


Author: davidxl
Date: Tue Jan 26 18:14:15 2016
New Revision: 258890

URL: http://llvm.org/viewvc/llvm-project?rev=258890&view=rev
Log:
Sync up with master file

Modified:
    compiler-rt/trunk/lib/profile/InstrProfData.inc

Modified: compiler-rt/trunk/lib/profile/InstrProfData.inc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfData.inc?rev=258890&r1=258889&r2=258890&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfData.inc (original)
+++ compiler-rt/trunk/lib/profile/InstrProfData.inc Tue Jan 26 18:14:15 2016
@@ -392,8 +392,10 @@ uint32_t getNumValueKindsRT(const void *
 #define INSTR_PROF_DATA_DEFINED
 #ifdef __cplusplus
 #define INSTR_PROF_INLINE inline
+#define INSTR_PROF_NULLPTR nullptr
 #else
 #define INSTR_PROF_INLINE
+#define INSTR_PROF_NULLPTR NULL
 #endif
 
 #ifndef offsetof
@@ -554,18 +556,19 @@ int initializeValueProfRuntimeRecord(Val
   for (I = 0; I <= IPVK_Last; I++) {
     uint16_t N = NumValueSites[I];
     if (!N) {
-      RuntimeRecord->SiteCountArray[I] = 0;
+      RuntimeRecord->SiteCountArray[I] = INSTR_PROF_NULLPTR;
       continue;
     }
     NumValueKinds++;
     RuntimeRecord->SiteCountArray[I] = (uint8_t *)calloc(N, 1);
     if (!RuntimeRecord->SiteCountArray[I])
       return 1;
-    RuntimeRecord->NodesKind[I] = Nodes ? &Nodes[S] : NULL;
+    RuntimeRecord->NodesKind[I] = Nodes ? &Nodes[S] : INSTR_PROF_NULLPTR;
     for (J = 0; J < N; J++) {
       /* Compute value count for each site. */
       uint32_t C = 0;
-      ValueProfNode *Site = Nodes ? RuntimeRecord->NodesKind[I][J] : NULL;
+      ValueProfNode *Site =
+          Nodes ? RuntimeRecord->NodesKind[I][J] : INSTR_PROF_NULLPTR;
       while (Site) {
         C++;
         Site = Site->Next;
@@ -606,7 +609,7 @@ uint32_t getNumValueDataForSiteRT(const
 uint32_t getNumValueDataRT(const void *R, uint32_t VK) {
   unsigned I, S = 0;
   const ValueProfRuntimeRecord *Record = (const ValueProfRuntimeRecord *)R;
-  if (Record->SiteCountArray[VK] == 0)
+  if (Record->SiteCountArray[VK] == INSTR_PROF_NULLPTR)
     return 0;
   for (I = 0; I < Record->NumValueSites[VK]; I++)
     S += Record->SiteCountArray[VK][I];
@@ -631,14 +634,10 @@ ValueProfData *allocValueProfDataRT(size
   return (ValueProfData *)calloc(TotalSizeInBytes, 1);
 }
 
-static ValueProfRecordClosure RTRecordClosure = {0,
-                                                 getNumValueKindsRT,
-                                                 getNumValueSitesRT,
-                                                 getNumValueDataRT,
-                                                 getNumValueDataForSiteRT,
-                                                 0,
-                                                 getValueForSiteRT,
-                                                 allocValueProfDataRT};
+static ValueProfRecordClosure RTRecordClosure = {
+    INSTR_PROF_NULLPTR, getNumValueKindsRT,       getNumValueSitesRT,
+    getNumValueDataRT,  getNumValueDataForSiteRT, INSTR_PROF_NULLPTR,
+    getValueForSiteRT,  allocValueProfDataRT};
 
 /*
  * Return the size of ValueProfData structure to store data
@@ -663,17 +662,15 @@ serializeValueProfDataFromRT(const Value
   return serializeValueProfDataFrom(&RTRecordClosure, DstData);
 }
 
-
 #undef INSTR_PROF_COMMON_API_IMPL
 #endif /* INSTR_PROF_COMMON_API_IMPL */
 
 /*============================================================================*/
 
-
 #ifndef INSTR_PROF_DATA_DEFINED
 
-#ifndef INSTR_PROF_DATA_INC_
-#define INSTR_PROF_DATA_INC_
+#ifndef INSTR_PROF_DATA_INC
+#define INSTR_PROF_DATA_INC
 
 /* Helper macros.  */
 #define INSTR_PROF_SIMPLE_QUOTE(x) #x
@@ -760,7 +757,7 @@ typedef struct ValueProfNode {
   struct ValueProfNode *Next;
 } ValueProfNode;
 
-#endif /* INSTR_PROF_DATA_INC_ */
+#endif /* INSTR_PROF_DATA_INC */
 
 #else
 #undef INSTR_PROF_DATA_DEFINED




More information about the llvm-commits mailing list