/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/lib/Basic/ParsedAttrInfo.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | //===- ParsedAttrInfo.cpp - Registry for attribute plugins ------*- 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 | | // This file contains the Registry of attributes added by plugins which |
10 | | // derive the ParsedAttrInfo class. |
11 | | // |
12 | | //===----------------------------------------------------------------------===// |
13 | | |
14 | | #include "clang/Basic/ParsedAttrInfo.h" |
15 | | #include "llvm/Support/ManagedStatic.h" |
16 | | #include <list> |
17 | | #include <memory> |
18 | | |
19 | | using namespace clang; |
20 | | |
21 | | LLVM_INSTANTIATE_REGISTRY(ParsedAttrInfoRegistry) |
22 | | |
23 | | const std::list<std::unique_ptr<ParsedAttrInfo>> & |
24 | 2.75k | clang::getAttributePluginInstances() { |
25 | 2.75k | static llvm::ManagedStatic<std::list<std::unique_ptr<ParsedAttrInfo>>> |
26 | 2.75k | PluginAttrInstances; |
27 | 2.75k | if (PluginAttrInstances->empty()) |
28 | 2.75k | for (const auto &It : ParsedAttrInfoRegistry::entries()) |
29 | 0 | PluginAttrInstances->emplace_back(It.instantiate()); |
30 | | |
31 | 2.75k | return *PluginAttrInstances; |
32 | 2.75k | } |