diff --git a/compiler-rt/lib/tsan/rtl/tsan_platform.h b/compiler-rt/lib/tsan/rtl/tsan_platform.h --- a/compiler-rt/lib/tsan/rtl/tsan_platform.h +++ b/compiler-rt/lib/tsan/rtl/tsan_platform.h @@ -705,21 +705,21 @@ } enum MappingType { - MAPPING_LO_APP_BEG, - MAPPING_LO_APP_END, - MAPPING_HI_APP_BEG, - MAPPING_HI_APP_END, - MAPPING_MID_APP_BEG, - MAPPING_MID_APP_END, - MAPPING_HEAP_BEG, - MAPPING_HEAP_END, - MAPPING_SHADOW_BEG, - MAPPING_SHADOW_END, - MAPPING_META_SHADOW_BEG, - MAPPING_META_SHADOW_END, - MAPPING_TRACE_BEG, - MAPPING_TRACE_END, - MAPPING_VDSO_BEG, + kLoAppMemBeg, + kLoAppMemEnd, + kHiAppMemBeg, + kHiAppMemEnd, + kMidAppMemBeg, + kMidAppMemEnd, + kHeapMemBeg, + kHeapMemEnd, + kShadowBeg, + kShadowEnd, + kMetaShadowBeg, + kMetaShadowEnd, + kTraceMemBeg, + kTraceMemEnd, + kVdsoBeg, }; struct MappingField { @@ -727,21 +727,36 @@ template static Result Apply(uptr type) { switch (type) { - case MAPPING_LO_APP_BEG: return Mapping::kLoAppMemBeg; - case MAPPING_LO_APP_END: return Mapping::kLoAppMemEnd; - case MAPPING_MID_APP_BEG: return Mapping::kMidAppMemBeg; - case MAPPING_MID_APP_END: return Mapping::kMidAppMemEnd; - case MAPPING_HI_APP_BEG: return Mapping::kHiAppMemBeg; - case MAPPING_HI_APP_END: return Mapping::kHiAppMemEnd; - case MAPPING_HEAP_BEG: return Mapping::kHeapMemBeg; - case MAPPING_HEAP_END: return Mapping::kHeapMemEnd; - case MAPPING_VDSO_BEG: return Mapping::kVdsoBeg; - case MAPPING_SHADOW_BEG: return Mapping::kShadowBeg; - case MAPPING_SHADOW_END: return Mapping::kShadowEnd; - case MAPPING_META_SHADOW_BEG: return Mapping::kMetaShadowBeg; - case MAPPING_META_SHADOW_END: return Mapping::kMetaShadowEnd; - case MAPPING_TRACE_BEG: return Mapping::kTraceMemBeg; - case MAPPING_TRACE_END: return Mapping::kTraceMemEnd; + case kLoAppMemBeg: + return Mapping::kLoAppMemBeg; + case kLoAppMemEnd: + return Mapping::kLoAppMemEnd; + case kMidAppMemBeg: + return Mapping::kMidAppMemBeg; + case kMidAppMemEnd: + return Mapping::kMidAppMemEnd; + case kHiAppMemBeg: + return Mapping::kHiAppMemBeg; + case kHiAppMemEnd: + return Mapping::kHiAppMemEnd; + case kHeapMemBeg: + return Mapping::kHeapMemBeg; + case kHeapMemEnd: + return Mapping::kHeapMemEnd; + case kVdsoBeg: + return Mapping::kVdsoBeg; + case kShadowBeg: + return Mapping::kShadowBeg; + case kShadowEnd: + return Mapping::kShadowEnd; + case kMetaShadowBeg: + return Mapping::kMetaShadowBeg; + case kMetaShadowEnd: + return Mapping::kMetaShadowEnd; + case kTraceMemBeg: + return Mapping::kTraceMemBeg; + case kTraceMemEnd: + return Mapping::kTraceMemEnd; } DCHECK(0); return 0; @@ -749,62 +764,42 @@ }; ALWAYS_INLINE -uptr LoAppMemBeg(void) { - return SelectMapping(MAPPING_LO_APP_BEG); -} +uptr LoAppMemBeg(void) { return SelectMapping(kLoAppMemBeg); } ALWAYS_INLINE -uptr LoAppMemEnd(void) { - return SelectMapping(MAPPING_LO_APP_END); -} +uptr LoAppMemEnd(void) { return SelectMapping(kLoAppMemEnd); } ALWAYS_INLINE -uptr MidAppMemBeg(void) { - return SelectMapping(MAPPING_MID_APP_BEG); -} +uptr MidAppMemBeg(void) { return SelectMapping(kMidAppMemBeg); } ALWAYS_INLINE -uptr MidAppMemEnd(void) { - return SelectMapping(MAPPING_MID_APP_END); -} +uptr MidAppMemEnd(void) { return SelectMapping(kMidAppMemEnd); } ALWAYS_INLINE -uptr HeapMemBeg(void) { return SelectMapping(MAPPING_HEAP_BEG); } +uptr HeapMemBeg(void) { return SelectMapping(kHeapMemBeg); } ALWAYS_INLINE -uptr HeapMemEnd(void) { return SelectMapping(MAPPING_HEAP_END); } +uptr HeapMemEnd(void) { return SelectMapping(kHeapMemEnd); } ALWAYS_INLINE -uptr HiAppMemBeg(void) { - return SelectMapping(MAPPING_HI_APP_BEG); -} +uptr HiAppMemBeg(void) { return SelectMapping(kHiAppMemBeg); } ALWAYS_INLINE -uptr HiAppMemEnd(void) { - return SelectMapping(MAPPING_HI_APP_END); -} +uptr HiAppMemEnd(void) { return SelectMapping(kHiAppMemEnd); } ALWAYS_INLINE -uptr VdsoBeg(void) { return SelectMapping(MAPPING_VDSO_BEG); } +uptr VdsoBeg(void) { return SelectMapping(kVdsoBeg); } ALWAYS_INLINE -uptr ShadowBeg(void) { return SelectMapping(MAPPING_SHADOW_BEG); } +uptr ShadowBeg(void) { return SelectMapping(kShadowBeg); } ALWAYS_INLINE -uptr ShadowEnd(void) { return SelectMapping(MAPPING_SHADOW_END); } +uptr ShadowEnd(void) { return SelectMapping(kShadowEnd); } ALWAYS_INLINE -uptr MetaShadowBeg(void) { - return SelectMapping(MAPPING_META_SHADOW_BEG); -} +uptr MetaShadowBeg(void) { return SelectMapping(kMetaShadowBeg); } ALWAYS_INLINE -uptr MetaShadowEnd(void) { - return SelectMapping(MAPPING_META_SHADOW_END); -} +uptr MetaShadowEnd(void) { return SelectMapping(kMetaShadowEnd); } ALWAYS_INLINE -uptr TraceMemBeg(void) { - return SelectMapping(MAPPING_TRACE_BEG); -} +uptr TraceMemBeg(void) { return SelectMapping(kTraceMemBeg); } ALWAYS_INLINE -uptr TraceMemEnd(void) { - return SelectMapping(MAPPING_TRACE_END); -} +uptr TraceMemEnd(void) { return SelectMapping(kTraceMemEnd); } struct IsAppMemImpl { typedef bool Result;