1349cc55cSDimitry Andric //===--- CLWarnings.h - Maps some cl.exe warning ids -----------*- C++ -*-===// 2349cc55cSDimitry Andric // 3349cc55cSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4349cc55cSDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 5349cc55cSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6349cc55cSDimitry Andric // 7349cc55cSDimitry Andric //===----------------------------------------------------------------------===// 8349cc55cSDimitry Andric // 9349cc55cSDimitry Andric // This file implements the Diagnostic-related interfaces. 10349cc55cSDimitry Andric // 11349cc55cSDimitry Andric //===----------------------------------------------------------------------===// 12349cc55cSDimitry Andric 13349cc55cSDimitry Andric #include "clang/Basic/CLWarnings.h" 14349cc55cSDimitry Andric #include "clang/Basic/DiagnosticCategories.h" 15*bdd1243dSDimitry Andric #include <optional> 16349cc55cSDimitry Andric 17349cc55cSDimitry Andric using namespace clang; 18349cc55cSDimitry Andric 19*bdd1243dSDimitry Andric std::optional<diag::Group> diagGroupFromCLWarningID(unsigned CLWarningID)20349cc55cSDimitry Andricclang::diagGroupFromCLWarningID(unsigned CLWarningID) { 21349cc55cSDimitry Andric switch (CLWarningID) { 22349cc55cSDimitry Andric case 4005: return diag::Group::MacroRedefined; 23349cc55cSDimitry Andric case 4018: return diag::Group::SignCompare; 24349cc55cSDimitry Andric case 4100: return diag::Group::UnusedParameter; 25349cc55cSDimitry Andric case 4910: return diag::Group::DllexportExplicitInstantiationDecl; 26349cc55cSDimitry Andric case 4996: return diag::Group::DeprecatedDeclarations; 27349cc55cSDimitry Andric } 28349cc55cSDimitry Andric return {}; 29349cc55cSDimitry Andric } 30