================ @@ -150,21 +151,30 @@ class MProtectHelper { namespace { -bool patchSled(const XRaySledEntry &Sled, bool Enable, - int32_t FuncId) XRAY_NEVER_INSTRUMENT { +bool isObjectLoaded(int32_t ObjId) { + SpinMutexLock Guard(&XRayInstrMapMutex); + if (ObjId < 0 || static_cast<uint32_t>(ObjId) >= + atomic_load(&XRayNumObjects, memory_order_acquire)) { + return false; + } + return XRayInstrMaps[ObjId].Loaded; +} + +bool patchSled(const XRaySledEntry &Sled, bool Enable, int32_t FuncId, + const XRayTrampolines &Trampolines) XRAY_NEVER_INSTRUMENT { bool Success = false; switch (Sled.Kind) { case XRayEntryType::ENTRY: - Success = patchFunctionEntry(Enable, FuncId, Sled, __xray_FunctionEntry); + Success = patchFunctionEntry(Enable, FuncId, Sled, Trampolines, false); ---------------- jplehr wrote:
```suggestion Success = patchFunctionEntry(Enable, FuncId, Sled, Trampolines, /* LogArgs=*/false); ``` There is some syntax like that, that is understood by clang-format and that helps to know what this is actually doing. https://github.com/llvm/llvm-project/pull/112930 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits