Home | History | Annotate | Download | only in Sema
      1 //===--- LoopHint.h - Types for LoopHint ------------------------*- C++ -*-===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is distributed under the University of Illinois Open Source
      6 // License. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 #ifndef LLVM_CLANG_SEMA_LOOPHINT_H
     11 #define LLVM_CLANG_SEMA_LOOPHINT_H
     12 
     13 #include "clang/Basic/IdentifierTable.h"
     14 #include "clang/Basic/SourceLocation.h"
     15 #include "clang/Sema/AttributeList.h"
     16 #include "clang/Sema/Ownership.h"
     17 
     18 namespace clang {
     19 
     20 /// \brief 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 
     38   LoopHint()
     39       : PragmaNameLoc(nullptr), OptionLoc(nullptr), StateLoc(nullptr),
     40         ValueExpr(nullptr) {}
     41 };
     42 
     43 } // end namespace clang
     44 
     45 #endif // LLVM_CLANG_SEMA_LOOPHINT_H
     46