blob: ef2470f672001582efc1ae36e1b1fef264935632 [file] [log] [blame]
Dean Michael Berris488f7c22018-04-13 02:31:58 +00001//===--- XRayInstr.cpp ------------------------------------------*- C++ -*-===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// 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
Dean Michael Berris488f7c22018-04-13 02:31:58 +00006//
7//===----------------------------------------------------------------------===//
8//
9// This is part of XRay, a function call instrumentation system.
10//
11//===----------------------------------------------------------------------===//
12
13#include "clang/Basic/XRayInstr.h"
14#include "llvm/ADT/StringSwitch.h"
15
16namespace clang {
17
18XRayInstrMask parseXRayInstrValue(StringRef Value) {
19 XRayInstrMask ParsedKind = llvm::StringSwitch<XRayInstrMask>(Value)
20 .Case("all", XRayInstrKind::All)
21 .Case("custom", XRayInstrKind::Custom)
22 .Case("function", XRayInstrKind::Function)
Keith Wyssf437e352018-04-17 21:32:43 +000023 .Case("typed", XRayInstrKind::Typed)
Dean Michael Berris488f7c22018-04-13 02:31:58 +000024 .Case("none", XRayInstrKind::None)
25 .Default(XRayInstrKind::None);
26 return ParsedKind;
27}
28
29} // namespace clang