xref: /freebsd/contrib/llvm-project/lldb/source/Plugins/InstrumentationRuntime/Utility/Utility.h (revision 700637cbb5e582861067a11aaca4d053546871d2)
1 //===-- Utility.h -----------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_UTILITY_UTILITY_H
10 #define LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_UTILITY_UTILITY_H
11 
12 #include "lldb/lldb-forward.h"
13 
14 namespace lldb_private {
15 
16 class Target;
17 
18 /// On Darwin, if LLDB loaded libclang_rt, it's coming from a locally built
19 /// compiler-rt, and we should prefer it in favour of the system sanitizers
20 /// when running InstrumentationRuntime utility expressions that use symbols
21 /// from the sanitizer libraries. This helper searches the target for such a
22 /// dylib. Returns nullptr if no such dylib was found.
23 lldb::ModuleSP GetPreferredAsanModule(const Target &target);
24 
25 } // namespace lldb_private
26 
27 #endif // LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_UTILITY_UTILITY_H
28