1 //===--- XRayInstr.cpp ------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This is part of XRay, a function call instrumentation system.
12 //===----------------------------------------------------------------------===//
14 #include "clang/Basic/XRayInstr.h"
15 #include "llvm/ADT/StringSwitch.h"
19 XRayInstrMask 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)
24 .Case("typed", XRayInstrKind::Typed)
25 .Case("none", XRayInstrKind::None)
26 .Default(XRayInstrKind::None);