XRayArgs.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===--- XRayArgs.h - Arguments for XRay ------------------------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_CLANG_DRIVER_XRAYARGS_H
  14. #define LLVM_CLANG_DRIVER_XRAYARGS_H
  15. #include "clang/Basic/XRayInstr.h"
  16. #include "clang/Driver/Types.h"
  17. #include "llvm/Option/Arg.h"
  18. #include "llvm/Option/ArgList.h"
  19. namespace clang {
  20. namespace driver {
  21. class ToolChain;
  22. class XRayArgs {
  23. std::vector<std::string> AlwaysInstrumentFiles;
  24. std::vector<std::string> NeverInstrumentFiles;
  25. std::vector<std::string> AttrListFiles;
  26. std::vector<std::string> ExtraDeps;
  27. std::vector<std::string> Modes;
  28. XRayInstrSet InstrumentationBundle;
  29. bool XRayInstrument = false;
  30. int InstructionThreshold = 200;
  31. bool XRayAlwaysEmitCustomEvents = false;
  32. bool XRayAlwaysEmitTypedEvents = false;
  33. bool XRayRT = true;
  34. bool XRayIgnoreLoops = false;
  35. bool XRayFunctionIndex;
  36. int XRayFunctionGroups = 1;
  37. int XRaySelectedFunctionGroup = 0;
  38. public:
  39. /// Parses the XRay arguments from an argument list.
  40. XRayArgs(const ToolChain &TC, const llvm::opt::ArgList &Args);
  41. void addArgs(const ToolChain &TC, const llvm::opt::ArgList &Args,
  42. llvm::opt::ArgStringList &CmdArgs, types::ID InputType) const;
  43. bool needsXRayRt() const { return XRayInstrument && XRayRT; }
  44. llvm::ArrayRef<std::string> modeList() const { return Modes; }
  45. XRayInstrSet instrumentationBundle() const { return InstrumentationBundle; }
  46. };
  47. } // namespace driver
  48. } // namespace clang
  49. #endif // LLVM_CLANG_DRIVER_XRAYARGS_H
  50. #ifdef __GNUC__
  51. #pragma GCC diagnostic pop
  52. #endif