Path: blob/main/contrib/llvm-project/clang/lib/Basic/ParsedAttrInfo.cpp
35234 views
//===- ParsedAttrInfo.cpp - Registry for attribute plugins ------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file contains the Registry of attributes added by plugins which9// derive the ParsedAttrInfo class.10//11//===----------------------------------------------------------------------===//1213#include "clang/Basic/ParsedAttrInfo.h"14#include "llvm/Support/ManagedStatic.h"15#include <list>16#include <memory>1718using namespace clang;1920LLVM_INSTANTIATE_REGISTRY(ParsedAttrInfoRegistry)2122const std::list<std::unique_ptr<ParsedAttrInfo>> &23clang::getAttributePluginInstances() {24static llvm::ManagedStatic<std::list<std::unique_ptr<ParsedAttrInfo>>>25PluginAttrInstances;26if (PluginAttrInstances->empty())27for (const auto &It : ParsedAttrInfoRegistry::entries())28PluginAttrInstances->emplace_back(It.instantiate());2930return *PluginAttrInstances;31}323334