mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-29 11:56:07 +00:00

Summary: A clang builtin for xray typed events. Differs from __xray_customevent(...) by the presence of a type tag that is vended by compiler-rt in typical usage. This allows xray handlers to expand logged events with their type description and plugins to process traced events based on type. This change depends on D45633 for the intrinsic definition. Reviewers: dberris, pelikan, rnk, eizan Subscribers: cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D45716 llvm-svn: 330220
31 lines
1.1 KiB
C++
31 lines
1.1 KiB
C++
//===--- 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("typed", XRayInstrKind::Typed)
|
|
.Case("none", XRayInstrKind::None)
|
|
.Default(XRayInstrKind::None);
|
|
return ParsedKind;
|
|
}
|
|
|
|
} // namespace clang
|