| 1 | //===- SerializationFormat.cpp ----------------------------------*- 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 | #include "clang/Analysis/Scalable/Serialization/SerializationFormat.h" |
| 10 | #include "clang/Analysis/Scalable/Model/BuildNamespace.h" |
| 11 | #include "clang/Analysis/Scalable/Model/EntityId.h" |
| 12 | #include "clang/Analysis/Scalable/Model/EntityName.h" |
| 13 | #include "clang/Analysis/Scalable/TUSummary/TUSummary.h" |
| 14 | |
| 15 | using namespace clang::ssaf; |
| 16 | |
| 17 | EntityIdTable &SerializationFormat::getIdTableForDeserialization(TUSummary &S) { |
| 18 | return S.IdTable; |
| 19 | } |
| 20 | |
| 21 | BuildNamespace & |
| 22 | SerializationFormat::getTUNamespaceForDeserialization(TUSummary &S) { |
| 23 | return S.TUNamespace; |
| 24 | } |
| 25 | |
| 26 | const EntityIdTable &SerializationFormat::getIdTable(const TUSummary &S) { |
| 27 | return S.IdTable; |
| 28 | } |
| 29 | |
| 30 | const BuildNamespace &SerializationFormat::getTUNamespace(const TUSummary &S) { |
| 31 | return S.TUNamespace; |
| 32 | } |
| 33 | |
| 34 | BuildNamespaceKind |
| 35 | SerializationFormat::getBuildNamespaceKind(const BuildNamespace &BN) { |
| 36 | return BN.Kind; |
| 37 | } |
| 38 | |
| 39 | llvm::StringRef |
| 40 | SerializationFormat::getBuildNamespaceName(const BuildNamespace &BN) { |
| 41 | return BN.Name; |
| 42 | } |
| 43 | |
| 44 | const std::vector<BuildNamespace> & |
| 45 | SerializationFormat::getNestedBuildNamespaces(const NestedBuildNamespace &NBN) { |
| 46 | return NBN.Namespaces; |
| 47 | } |
| 48 | |
| 49 | llvm::StringRef SerializationFormat::getEntityNameUSR(const EntityName &EN) { |
| 50 | return EN.USR; |
| 51 | } |
| 52 | |
| 53 | const llvm::SmallString<16> & |
| 54 | SerializationFormat::getEntityNameSuffix(const EntityName &EN) { |
| 55 | return EN.Suffix; |
| 56 | } |
| 57 | |
| 58 | const NestedBuildNamespace & |
| 59 | SerializationFormat::getEntityNameNamespace(const EntityName &EN) { |
| 60 | return EN.Namespace; |
| 61 | } |
| 62 |