diff options
author | Dean Michael Berris <dberris@google.com> | 2018-06-05 10:27:20 +0000 |
---|---|---|
committer | Dean Michael Berris <dberris@google.com> | 2018-06-05 10:27:20 +0000 |
commit | 4c1fdcfb974b8d3e1479ec3d4b0efb1bc249cf0c (patch) | |
tree | 64d25746af2793ab2b2c886488932b98a65a178b /compiler-rt/lib/xray | |
parent | 13b2fcc4e6d173b27d4cead4fd7b3f7c5fa7e91d (diff) | |
download | bcm5719-llvm-4c1fdcfb974b8d3e1479ec3d4b0efb1bc249cf0c.tar.gz bcm5719-llvm-4c1fdcfb974b8d3e1479ec3d4b0efb1bc249cf0c.zip |
[XRay][compiler-rt] Use DCHECK instead of assert(...) (NFC)
Use DCHECK instead of assert(...) in the XRay runtime.
llvm-svn: 334002
Diffstat (limited to 'compiler-rt/lib/xray')
-rw-r--r-- | compiler-rt/lib/xray/xray_fdr_logging.cc | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/compiler-rt/lib/xray/xray_fdr_logging.cc b/compiler-rt/lib/xray/xray_fdr_logging.cc index d7d73c7af2a..610689ffc16 100644 --- a/compiler-rt/lib/xray/xray_fdr_logging.cc +++ b/compiler-rt/lib/xray/xray_fdr_logging.cc @@ -15,8 +15,6 @@ // //===----------------------------------------------------------------------===// #include "xray_fdr_logging.h" - -#include <cassert> #include <errno.h> #include <limits> #include <pthread.h> @@ -363,10 +361,10 @@ static void rewindRecentCall(uint64_t TSC, uint64_t &LastTSC, decrementExtents(FunctionRecSize); FunctionRecord FuncRecord; internal_memcpy(&FuncRecord, TLD.RecordPtr, FunctionRecSize); - assert(FuncRecord.RecordKind == + DCHECK(FuncRecord.RecordKind == uint8_t(FunctionRecord::RecordKinds::FunctionEnter) && "Expected to find function entry recording when rewinding."); - assert(FuncRecord.FuncId == (FuncId & ~(0x0F << 28)) && + DCHECK(FuncRecord.FuncId == (FuncId & ~(0x0F << 28)) && "Expected matching function id when rewinding Exit"); --TLD.NumConsecutiveFnEnters; LastTSC -= FuncRecord.TSCDelta; @@ -388,7 +386,7 @@ static void rewindRecentCall(uint64_t TSC, uint64_t &LastTSC, FunctionRecord ExpectedTailExit; internal_memcpy(&ExpectedTailExit, RewindingRecordPtr, FunctionRecSize); - assert(ExpectedTailExit.RecordKind == + DCHECK(ExpectedTailExit.RecordKind == uint8_t(FunctionRecord::RecordKinds::FunctionTailExit) && "Expected to find tail exit when rewinding."); RewindingRecordPtr -= FunctionRecSize; @@ -396,10 +394,10 @@ static void rewindRecentCall(uint64_t TSC, uint64_t &LastTSC, FunctionRecord ExpectedFunctionEntry; internal_memcpy(&ExpectedFunctionEntry, RewindingRecordPtr, FunctionRecSize); - assert(ExpectedFunctionEntry.RecordKind == + DCHECK(ExpectedFunctionEntry.RecordKind == uint8_t(FunctionRecord::RecordKinds::FunctionEnter) && "Expected to find function entry when rewinding tail call."); - assert(ExpectedFunctionEntry.FuncId == ExpectedTailExit.FuncId && + DCHECK(ExpectedFunctionEntry.FuncId == ExpectedTailExit.FuncId && "Expected funcids to match when rewinding tail call."); // This tail call exceeded the threshold duration. It will not be erased. @@ -576,7 +574,7 @@ static void processFunctionHook(int32_t FuncId, XRayEntryType Entry, // handleArg0 to happen at any given time. RecursionGuard Guard{Running}; if (!Guard) { - assert(Running == true && "RecursionGuard is buggy!"); + DCHECK(Running == true && "RecursionGuard is buggy!"); return; } @@ -630,7 +628,7 @@ static void processFunctionHook(int32_t FuncId, XRayEntryType Entry, } // By this point, we are now ready to write up to 40 bytes (explained above). - assert((TLD.RecordPtr + MaxSize) - static_cast<char *>(TLD.Buffer.Data) >= + DCHECK((TLD.RecordPtr + MaxSize) - static_cast<char *>(TLD.Buffer.Data) >= static_cast<ptrdiff_t>(MetadataRecSize) && "Misconfigured BufferQueue provided; Buffer size not large enough."); @@ -859,7 +857,7 @@ XRayLogFlushStatus fdrLoggingFlush() XRAY_NEVER_INSTRUMENT { // data. MetadataRecord ExtentsRecord; auto BufferExtents = atomic_load(&B.Extents->Size, memory_order_acquire); - assert(BufferExtents <= B.Size); + DCHECK(BufferExtents <= B.Size); ExtentsRecord.Type = uint8_t(RecordType::Metadata); ExtentsRecord.RecordKind = uint8_t(MetadataRecord::RecordKinds::BufferExtents); |