We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f73b344 commit f157cbeCopy full SHA for f157cbe
compiler-rt/lib/xray/xray_tsc.h
@@ -96,11 +96,11 @@ namespace __xray {
96
inline bool probeRequiredCPUFeatures() XRAY_NEVER_INSTRUMENT { return true; }
97
98
ALWAYS_INLINE uint64_t readTSC(uint8_t &CPU) XRAY_NEVER_INSTRUMENT {
99
-#if defined(__clang__)
+#if __has_builtin(__builtin_readcyclecounter)
100
return __builtin_readcyclecounter();
101
#else
102
uint64_t Cycles;
103
- asm volatile("stckf %0" : /* No output. */ : "Q"(Cycles) : "cc");
+ asm volatile("stckf %0" : : "Q"(Cycles) : "cc");
104
return Cycles;
105
#endif
106
}
0 commit comments