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; |
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; |
31 | // Identifier for the hint state argument. If null, then the state is |
32 | // default value such as for "#pragma unroll". |
33 | IdentifierLoc *StateLoc; |
34 | // Expression for the hint argument if it exists, null otherwise. |
35 | Expr *ValueExpr; |
36 | |
37 | LoopHint() |
38 | : PragmaNameLoc(nullptr), OptionLoc(nullptr), StateLoc(nullptr), |
39 | ValueExpr(nullptr) {} |
40 | }; |
41 | |
42 | } // end namespace clang |
43 | |
44 | #endif // LLVM_CLANG_PARSE_LOOPHINT_H |
45 |