/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/lib/Basic/XRayInstr.cpp
Line | Count | Source |
1 | | //===--- XRayInstr.cpp ------------------------------------------*- C++ -*-===// |
2 | | // |
3 | | // 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 |
6 | | // |
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 | | |
16 | | namespace clang { |
17 | | |
18 | 27 | XRayInstrMask parseXRayInstrValue(StringRef Value) { |
19 | 27 | XRayInstrMask ParsedKind = |
20 | 27 | llvm::StringSwitch<XRayInstrMask>(Value) |
21 | 27 | .Case("all", XRayInstrKind::All) |
22 | 27 | .Case("custom", XRayInstrKind::Custom) |
23 | 27 | .Case("function", |
24 | 27 | XRayInstrKind::FunctionEntry | XRayInstrKind::FunctionExit) |
25 | 27 | .Case("function-entry", XRayInstrKind::FunctionEntry) |
26 | 27 | .Case("function-exit", XRayInstrKind::FunctionExit) |
27 | 27 | .Case("typed", XRayInstrKind::Typed) |
28 | 27 | .Case("none", XRayInstrKind::None) |
29 | 27 | .Default(XRayInstrKind::None); |
30 | 27 | return ParsedKind; |
31 | 27 | } |
32 | | |
33 | | } // namespace clang |