diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:02:28 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-04-16 16:02:28 +0000 |
commit | 7442d6faa2719e4e7d33a7021c406c5a4facd74d (patch) | |
tree | c72b9241553fc9966179aba84f90f17bfa9235c3 /include/clang/Basic/XRayLists.h | |
parent | b52119637f743680a99710ce5fdb6646da2772af (diff) |
Diffstat (limited to 'include/clang/Basic/XRayLists.h')
-rw-r--r-- | include/clang/Basic/XRayLists.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/include/clang/Basic/XRayLists.h b/include/clang/Basic/XRayLists.h new file mode 100644 index 0000000000000..fe538289c3a60 --- /dev/null +++ b/include/clang/Basic/XRayLists.h @@ -0,0 +1,54 @@ +//===--- XRayLists.h - XRay automatic attribution ---------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// User-provided filters for always/never XRay instrumenting certain functions. +// +//===----------------------------------------------------------------------===// +#ifndef LLVM_CLANG_BASIC_XRAYLISTS_H +#define LLVM_CLANG_BASIC_XRAYLISTS_H + +#include "clang/Basic/LLVM.h" +#include "clang/Basic/SourceLocation.h" +#include "clang/Basic/SourceManager.h" +#include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/StringRef.h" +#include "llvm/Support/SpecialCaseList.h" +#include <memory> + +namespace clang { + +class XRayFunctionFilter { + std::unique_ptr<llvm::SpecialCaseList> AlwaysInstrument; + std::unique_ptr<llvm::SpecialCaseList> NeverInstrument; + SourceManager &SM; + +public: + XRayFunctionFilter(ArrayRef<std::string> AlwaysInstrumentPaths, + ArrayRef<std::string> NeverInstrumentPaths, + SourceManager &SM); + + enum class ImbueAttribute { + NONE, + ALWAYS, + NEVER, + }; + + ImbueAttribute shouldImbueFunction(StringRef FunctionName) const; + + ImbueAttribute + shouldImbueFunctionsInFile(StringRef Filename, + StringRef Category = StringRef()) const; + + ImbueAttribute shouldImbueLocation(SourceLocation Loc, + StringRef Category = StringRef()) const; +}; + +} // namespace clang + +#endif |