xref: /openbsd-src/gnu/llvm/clang/lib/Basic/CLWarnings.cpp (revision 12c855180aad702bbcca06e0398d774beeafb155)
1*12c85518Srobert //===--- CLWarnings.h - Maps some cl.exe warning ids  -----------*- C++ -*-===//
2*12c85518Srobert //
3*12c85518Srobert // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*12c85518Srobert // See https://llvm.org/LICENSE.txt for license information.
5*12c85518Srobert // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*12c85518Srobert //
7*12c85518Srobert //===----------------------------------------------------------------------===//
8*12c85518Srobert //
9*12c85518Srobert //  This file implements the Diagnostic-related interfaces.
10*12c85518Srobert //
11*12c85518Srobert //===----------------------------------------------------------------------===//
12*12c85518Srobert 
13*12c85518Srobert #include "clang/Basic/CLWarnings.h"
14*12c85518Srobert #include "clang/Basic/DiagnosticCategories.h"
15*12c85518Srobert #include <optional>
16*12c85518Srobert 
17*12c85518Srobert using namespace clang;
18*12c85518Srobert 
19*12c85518Srobert std::optional<diag::Group>
diagGroupFromCLWarningID(unsigned CLWarningID)20*12c85518Srobert clang::diagGroupFromCLWarningID(unsigned CLWarningID) {
21*12c85518Srobert   switch (CLWarningID) {
22*12c85518Srobert   case 4005: return diag::Group::MacroRedefined;
23*12c85518Srobert   case 4018: return diag::Group::SignCompare;
24*12c85518Srobert   case 4100: return diag::Group::UnusedParameter;
25*12c85518Srobert   case 4910: return diag::Group::DllexportExplicitInstantiationDecl;
26*12c85518Srobert   case 4996: return diag::Group::DeprecatedDeclarations;
27*12c85518Srobert   }
28*12c85518Srobert   return {};
29*12c85518Srobert }
30