clang API Documentation

LoopHint.h
Go to the documentation of this file.
00001 //===--- LoopHint.h - Types for LoopHint ------------------------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 
00010 #ifndef LLVM_CLANG_SEMA_LOOPHINT_H
00011 #define LLVM_CLANG_SEMA_LOOPHINT_H
00012 
00013 #include "clang/Basic/IdentifierTable.h"
00014 #include "clang/Basic/SourceLocation.h"
00015 #include "clang/Sema/AttributeList.h"
00016 #include "clang/Sema/Ownership.h"
00017 
00018 namespace clang {
00019 
00020 /// \brief Loop optimization hint for loop and unroll pragmas.
00021 struct LoopHint {
00022   // Source range of the directive.
00023   SourceRange Range;
00024   // Identifier corresponding to the name of the pragma.  "loop" for
00025   // "#pragma clang loop" directives and "unroll" for "#pragma unroll"
00026   // hints.
00027   IdentifierLoc *PragmaNameLoc;
00028   // Name of the loop hint.  Examples: "unroll", "vectorize".  In the
00029   // "#pragma unroll" and "#pragma nounroll" cases, this is identical to
00030   // PragmaNameLoc.
00031   IdentifierLoc *OptionLoc;
00032   // Identifier for the hint state argument.  If null, then the state is
00033   // default value such as for "#pragma unroll".
00034   IdentifierLoc *StateLoc;
00035   // Expression for the hint argument if it exists, null otherwise.
00036   Expr *ValueExpr;
00037 
00038   LoopHint()
00039       : PragmaNameLoc(nullptr), OptionLoc(nullptr), StateLoc(nullptr),
00040         ValueExpr(nullptr) {}
00041 };
00042 
00043 } // end namespace clang
00044 
00045 #endif // LLVM_CLANG_SEMA_LOOPHINT_H