From 5bfc8ebfa312a2142b66f715db7dd83c90b9b25a Mon Sep 17 00:00:00 2001 From: wejoncy Date: Tue, 10 Dec 2024 18:28:00 +0800 Subject: [PATCH] pass static anaysis --- onnxruntime/core/providers/coreml/model/model.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/onnxruntime/core/providers/coreml/model/model.mm b/onnxruntime/core/providers/coreml/model/model.mm index 23de66073c928..cccc7fa14550e 100644 --- a/onnxruntime/core/providers/coreml/model/model.mm +++ b/onnxruntime/core/providers/coreml/model/model.mm @@ -306,6 +306,7 @@ Status GetMLMultiArrayCopyInfo(const MLMultiArray* _Nonnull array, // we define __clang_analyzer__ here is for bypass static analysis API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4), watchos(10.4)) void ProfileBlock(MLComputePlan* _Nullable computePlan, MLModelStructureProgramBlock* block) { +#if !defined(__clang_analyzer__) for (MLModelStructureProgramOperation* operation in block.operations) { for (size_t i = 0; i < operation.blocks.count; ++i) { ProfileBlock(computePlan, operation.blocks[i]); @@ -319,6 +320,7 @@ void ProfileBlock(MLComputePlan* _Nullable computePlan, MLModelStructureProgramB NSLog(@"Operation: %@, Device Usage: %@, Estimated Cost: %f", operation.operatorName, preferredDevice, estimatedCost.weight); } } +#endif } // since macos(14.4), ios(17.4), MLComputePlan is introduced in // Otherwise, the compiler will complain `MLComputePlan` is not defined.