1 //===--- LoopHint.h - Types for LoopHint ------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_CLANG_PARSE_LOOPHINT_H
10 #define LLVM_CLANG_PARSE_LOOPHINT_H
11 
12 #include "clang/Basic/IdentifierTable.h"
13 #include "clang/Basic/SourceLocation.h"
14 #include "clang/Sema/Ownership.h"
15 #include "clang/Sema/ParsedAttr.h"
16 
17 namespace clang {
18 
19 /// Loop optimization hint for loop and unroll pragmas.
20 struct LoopHint {
21   // Source range of the directive.
22   SourceRange Range;
23   // Identifier corresponding to the name of the pragma.  "loop" for
24   // "#pragma clang loop" directives and "unroll" for "#pragma unroll"
25   // hints.
26   IdentifierLoc *PragmaNameLoc = nullptr;
27   // Name of the loop hint.  Examples: "unroll", "vectorize".  In the
28   // "#pragma unroll" and "#pragma nounroll" cases, this is identical to
29   // PragmaNameLoc.
30   IdentifierLoc *OptionLoc = nullptr;
31   // Identifier for the hint state argument.  If null, then the state is
32   // default value such as for "#pragma unroll".
33   IdentifierLoc *StateLoc = nullptr;
34   // Expression for the hint argument if it exists, null otherwise.
35   Expr *ValueExpr = nullptr;
36 
37   LoopHint() = default;
38 };
39 
40 } // end namespace clang
41 
42 #endif // LLVM_CLANG_PARSE_LOOPHINT_H
43