summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/XRayInstr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Basic/XRayInstr.cpp')
-rw-r--r--clang/lib/Basic/XRayInstr.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/clang/lib/Basic/XRayInstr.cpp b/clang/lib/Basic/XRayInstr.cpp
new file mode 100644
index 00000000000..42f9038890a
--- /dev/null
+++ b/clang/lib/Basic/XRayInstr.cpp
@@ -0,0 +1,29 @@
+//===--- XRayInstr.cpp ------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This is part of XRay, a function call instrumentation system.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/Basic/XRayInstr.h"
+#include "llvm/ADT/StringSwitch.h"
+
+namespace clang {
+
+XRayInstrMask parseXRayInstrValue(StringRef Value) {
+ XRayInstrMask ParsedKind = llvm::StringSwitch<XRayInstrMask>(Value)
+ .Case("all", XRayInstrKind::All)
+ .Case("custom", XRayInstrKind::Custom)
+ .Case("function", XRayInstrKind::Function)
+ .Case("none", XRayInstrKind::None)
+ .Default(XRayInstrKind::None);
+ return ParsedKind;
+}
+
+} // namespace clang
OpenPOWER on IntegriCloud