LoopHint.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===--- LoopHint.h - Types for LoopHint ------------------------*- 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_PARSE_LOOPHINT_H
  14. #define LLVM_CLANG_PARSE_LOOPHINT_H
  15. #include "clang/Basic/IdentifierTable.h"
  16. #include "clang/Basic/SourceLocation.h"
  17. #include "clang/Sema/Ownership.h"
  18. #include "clang/Sema/ParsedAttr.h"
  19. namespace clang {
  20. /// Loop optimization hint for loop and unroll pragmas.
  21. struct LoopHint {
  22. // Source range of the directive.
  23. SourceRange Range;
  24. // Identifier corresponding to the name of the pragma. "loop" for
  25. // "#pragma clang loop" directives and "unroll" for "#pragma unroll"
  26. // hints.
  27. IdentifierLoc *PragmaNameLoc;
  28. // Name of the loop hint. Examples: "unroll", "vectorize". In the
  29. // "#pragma unroll" and "#pragma nounroll" cases, this is identical to
  30. // PragmaNameLoc.
  31. IdentifierLoc *OptionLoc;
  32. // Identifier for the hint state argument. If null, then the state is
  33. // default value such as for "#pragma unroll".
  34. IdentifierLoc *StateLoc;
  35. // Expression for the hint argument if it exists, null otherwise.
  36. Expr *ValueExpr;
  37. LoopHint()
  38. : PragmaNameLoc(nullptr), OptionLoc(nullptr), StateLoc(nullptr),
  39. ValueExpr(nullptr) {}
  40. };
  41. } // end namespace clang
  42. #endif // LLVM_CLANG_PARSE_LOOPHINT_H
  43. #ifdef __GNUC__
  44. #pragma GCC diagnostic pop
  45. #endif