[clang][extract-api] Emit "navigator" property of "name" in SymbolGraph
[llvm-project.git] / compiler-rt / lib / sanitizer_common / sanitizer_chained_origin_depot.h
blob2e800964a45dd83a94a354e0c8e3d420a2d37e9e
1 //===-- sanitizer_chained_origin_depot.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 // A storage for chained origins.
10 //===----------------------------------------------------------------------===//
12 #ifndef SANITIZER_CHAINED_ORIGIN_DEPOT_H
13 #define SANITIZER_CHAINED_ORIGIN_DEPOT_H
15 #include "sanitizer_common.h"
17 namespace __sanitizer {
19 class ChainedOriginDepot {
20 public:
21 ChainedOriginDepot();
23 // Gets the statistic of the origin chain storage.
24 StackDepotStats GetStats() const;
26 // Stores a chain with StackDepot ID here_id and previous chain ID prev_id.
27 // If successful, returns true and the new chain id new_id.
28 // If the same element already exists, returns false and sets new_id to the
29 // existing ID.
30 bool Put(u32 here_id, u32 prev_id, u32 *new_id);
32 // Retrieves the stored StackDepot ID for the given origin ID.
33 u32 Get(u32 id, u32 *other);
35 void LockAll();
36 void UnlockAll();
38 private:
39 ChainedOriginDepot(const ChainedOriginDepot &) = delete;
40 void operator=(const ChainedOriginDepot &) = delete;
43 } // namespace __sanitizer
45 #endif // SANITIZER_CHAINED_ORIGIN_DEPOT_H