mirror of
https://github.com/RPCS3/llvm.git
synced 2025-04-17 13:30:41 +00:00

It's useless to have both. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366216 91177308-0d34-0410-b5e6-96231b3b80d8
31 lines
1.1 KiB
C++
31 lines
1.1 KiB
C++
//===- RemarkFormat.cpp --------------------------------------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// Implementation of utilities to handle the different remark formats.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "llvm/Remarks/RemarkFormat.h"
|
|
#include "llvm/ADT/StringSwitch.h"
|
|
|
|
using namespace llvm;
|
|
using namespace llvm::remarks;
|
|
|
|
Expected<Format> llvm::remarks::parseFormat(StringRef FormatStr) {
|
|
auto Result = StringSwitch<Format>(FormatStr)
|
|
.Cases("", "yaml", Format::YAML)
|
|
.Default(Format::Unknown);
|
|
|
|
if (Result == Format::Unknown)
|
|
return createStringError(std::make_error_code(std::errc::invalid_argument),
|
|
"Unknown remark serializer format: '%s'",
|
|
FormatStr.data());
|
|
|
|
return Result;
|
|
}
|