llvm-project
25 строк · 797.0 Байт
1//===--- SymbolOrigin.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 "SymbolOrigin.h"10
11namespace clang {12namespace clangd {13
14llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, SymbolOrigin O) {15if (O == SymbolOrigin::Unknown)16return OS << "unknown";17constexpr static char Sigils[] = "AOSMIRP7BL012345";18for (unsigned I = 0; I < sizeof(Sigils); ++I)19if (static_cast<uint16_t>(O) & 1u << I)20OS << Sigils[I];21return OS;22}
23
24} // namespace clangd25} // namespace clang26