xref: /llvm-project/compiler-rt/lib/dfsan/dfsan_chained_origin_depot.cpp (revision 80eea015ba4c1cf1182067579cd385dfdcb2e118)
1 //===-- dfsan_chained_origin_depot.cpp ------------------------------------===//
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 // This file is a part of DataFlowSanitizer.
10 //
11 // A storage for chained origins.
12 //===----------------------------------------------------------------------===//
13 
14 #include "dfsan_chained_origin_depot.h"
15 
16 using namespace __dfsan;
17 
18 static ChainedOriginDepot chainedOriginDepot;
19 
20 ChainedOriginDepot* __dfsan::GetChainedOriginDepot() {
21   return &chainedOriginDepot;
22 }
23 
24 void __dfsan::ChainedOriginDepotLockBeforeFork() {
25   chainedOriginDepot.LockBeforeFork();
26 }
27 
28 void __dfsan::ChainedOriginDepotUnlockAfterFork(bool fork_child) {
29   chainedOriginDepot.UnlockAfterFork(fork_child);
30 }
31