blob: 8cc36df79468e4998e5a8b0861dc52ddcbaf6a2f [file] [log] [blame]
Dean Michael Berris488f7c22018-04-13 02:31:58 +00001//===--- XRayInstr.cpp ------------------------------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This is part of XRay, a function call instrumentation system.
11//
12//===----------------------------------------------------------------------===//
13
14#include "clang/Basic/XRayInstr.h"
15#include "llvm/ADT/StringSwitch.h"
16
17namespace clang {
18
19XRayInstrMask parseXRayInstrValue(StringRef Value) {
20 XRayInstrMask ParsedKind = llvm::StringSwitch<XRayInstrMask>(Value)
21 .Case("all", XRayInstrKind::All)
22 .Case("custom", XRayInstrKind::Custom)
23 .Case("function", XRayInstrKind::Function)
Keith Wyssf437e352018-04-17 21:32:43 +000024 .Case("typed", XRayInstrKind::Typed)
Dean Michael Berris488f7c22018-04-13 02:31:58 +000025 .Case("none", XRayInstrKind::None)
26 .Default(XRayInstrKind::None);
27 return ParsedKind;
28}
29
30} // namespace clang