clang 8.0.0

Macros | Enumerations | Functions
ParsePragma.cpp File Reference
`#include "clang/AST/ASTContext.h"`
`#include "clang/Basic/PragmaKinds.h"`
`#include "clang/Basic/TargetInfo.h"`
`#include "clang/Lex/Preprocessor.h"`
`#include "clang/Parse/LoopHint.h"`
`#include "clang/Parse/ParseDiagnostic.h"`
`#include "clang/Parse/Parser.h"`
`#include "clang/Parse/RAIIObjectsForParser.h"`
`#include "clang/Sema/Scope.h"`
`#include "llvm/ADT/StringSwitch.h"`
`#include "clang/Parse/AttrSubMatchRulesParserStringSwitches.inc"`
`#include "clang/Basic/AttrSubMatchRulesList.inc"`
Include dependency graph for ParsePragma.cpp:

Go to the source code of this file.

## Macros
#define | ATTR_MATCH_RULE(Value, Spelling, IsAbstract)

## Enumerations
enum | OpenCLExtState : char
enum | MissingAttributeSubjectRulesRecoveryPoint
| Describes the stage at which attribute subject rule parsing was interrupted. More...

## Functions
static std::string | PragmaLoopHintString (Token PragmaName, Token Option)
static StringRef | getIdentifier (const Token &Tok)
static bool | isAbstractAttrMatcherRule (attr::SubjectMatchRule Rule)
static void | diagnoseExpectedAttributeSubjectSubRule (Parser &PRef, attr::SubjectMatchRule PrimaryRule, StringRef PrimaryRuleName, SourceLocation SubRuleLoc)
static void | diagnoseUnknownAttributeSubjectSubRule (Parser &PRef, attr::SubjectMatchRule PrimaryRule, StringRef PrimaryRuleName, StringRef SubRuleName, SourceLocation SubRuleLoc)
static void | ParseAlignPragma (Preprocessor &PP, Token &FirstTok, bool IsOptions)
static bool | ParseLoopHintValue (Preprocessor &PP, Token &Tok, Token PragmaName, Token Option, bool ValueInParens, PragmaLoopHintInfo &Info)
| Parses loop or unroll pragma hint value and fills in Info. More...

## Macro Definition Documentation

## ◆ ATTR_MATCH_RULE

#define ATTR_MATCH_RULE | ( |  | Value,
|  |  | Spelling,
|  |  | IsAbstract
| ) |  |

Value:
case Value: \
return IsAbstract;
Value
Value
Definition: UninitializedValues.cpp:102

## Enumeration Type Documentation

## ◆ MissingAttributeSubjectRulesRecoveryPoint

enum MissingAttributeSubjectRulesRecoveryPoint
| strong

Describes the stage at which attribute subject rule parsing was interrupted.

Definition at line 1318 of file ParsePragma.cpp.

## ◆ OpenCLExtState

enum OpenCLExtState : char

Definition at line 674 of file ParsePragma.cpp.

## Function Documentation

## ◆ diagnoseExpectedAttributeSubjectSubRule()

static void diagnoseExpectedAttributeSubjectSubRule | ( | Parser & | PRef,
|  | attr::SubjectMatchRule | PrimaryRule,
|  | StringRef | PrimaryRuleName,
|  | SourceLocation | SubRuleLoc
| ) |  |
| static

Definition at line 1181 of file ParsePragma.cpp.

References clang::Parser::Diag().

## ◆ diagnoseUnknownAttributeSubjectSubRule()

static void diagnoseUnknownAttributeSubjectSubRule | ( | Parser & | PRef,
|  | attr::SubjectMatchRule | PrimaryRule,
|  | StringRef | PrimaryRuleName,
|  | StringRef | SubRuleName,
|  | SourceLocation | SubRuleLoc
| ) |  |
| static

Definition at line 1194 of file ParsePragma.cpp.

References clang::Parser::Diag(), clang::BalancedDelimiterTracker::expectAndConsume(), and getIdentifier().

## ◆ getIdentifier()

static StringRef getIdentifier | ( | const Token & | Tok | ) |
| static

Definition at line 1160 of file ParsePragma.cpp.

References clang::Token::getIdentifierInfo(), clang::IdentifierInfo::getName(), and clang::Token::is().

Referenced by diagnoseUnknownAttributeSubjectSubRule(), clang::TemplateTypeParmType::getDecl(), clang::NamedDecl::getName(), clang::ObjCImplementationDecl::getName(), clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), clang::NamespaceDecl::isAnonymousNamespace(), clang::ObjCCategoryDecl::IsClassExtension(), and clang::DependentTemplateName::Profile().

## ◆ isAbstractAttrMatcherRule()

static bool isAbstractAttrMatcherRule | ( | attr::SubjectMatchRule | Rule | ) |
| static

Definition at line 1169 of file ParsePragma.cpp.

## ◆ ParseAlignPragma()

static void ParseAlignPragma | ( | Preprocessor & | PP,
|  | Token & | FirstTok,
|  | bool | IsOptions
| ) |  |
| static

Definition at line 1835 of file ParsePragma.cpp.

References Begin, clang::Preprocessor::Diag(), clang::Preprocessor::DiscardUntilEndOfDirective(), End, clang::Preprocessor::EnterToken(), clang::comments::tok::eof, clang::LangOptions::FPC_Fast, clang::LangOptions::FPC_Off, clang::LangOptions::FPC_On, clang::Token::getAnnotationValue(), clang::Preprocessor::getDiagnostics(), clang::Token::getIdentifierInfo(), clang::Token::getKind(), clang::Token::getLocation(), clang::IdentifierInfo::getName(), clang::Preprocessor::getPPCallbacks(), clang::Preprocessor::getPreprocessorAllocator(), clang::Preprocessor::getSpelling(), clang::Preprocessor::getTargetInfo(), clang::TargetInfo::getTriple(), clang::diag::Ignored, clang::Token::is(), clang::DiagnosticsEngine::isIgnored(), clang::Token::isNot(), clang::IdentifierInfo::isStr(), clang::SourceLocation::isValid(), clang::Preprocessor::Lex(), clang::Preprocessor::LexOnOffSwitch(), clang::Preprocessor::LexStringLiteral(), clang::Preprocessor::LexUnexpandedToken(), clang::None, clang::Preprocessor::parseSimpleIntegerLiteral(), clang::PCK_Compiler, clang::PCK_ExeStr, clang::PCK_Lib, clang::PCK_Linker, clang::PCK_Unknown, clang::PCK_User, clang::Sema::POAK_Mac68k, clang::Sema::POAK_Native, clang::Sema::POAK_Natural, clang::Sema::POAK_Packed, clang::Sema::POAK_Power, clang::Sema::POAK_Reset, clang::LangOptions::PPTMK_BestCase, clang::LangOptions::PPTMK_FullGeneralityMultipleInheritance, clang::LangOptions::PPTMK_FullGeneralitySingleInheritance, clang::LangOptions::PPTMK_FullGeneralityVirtualInheritance, clang::Pragma, clang::PPCallbacks::PragmaComment(), clang::PPCallbacks::PragmaDetectMismatch(), clang::PPCallbacks::PragmaOpenCLExtension(), clang::Sema::PSK_Pop, clang::Sema::PSK_Push, clang::Sema::PSK_Push_Set, clang::Sema::PSK_Reset, clang::Sema::PSK_Set, clang::Token::setAnnotationEndLoc(), clang::Token::setAnnotationValue(), clang::Token::setKind(), clang::Token::setLocation(), clang::DiagnosticsEngine::setSeverity(), clang::Token::startToken(), State, and clang::format::Tok.

## ◆ ParseLoopHintValue()

static bool ParseLoopHintValue | ( | Preprocessor & | PP,
|  | Token & | Tok,
|  | Token | PragmaName,
|  | Token | Option,
|  | bool | ValueInParens,
|  | PragmaLoopHintInfo & | Info
| ) |  |
| static

Parses loop or unroll pragma hint value and fills in Info.

Definition at line 2767 of file ParsePragma.cpp.

References clang::Preprocessor::Diag(), clang::comments::tok::eof, clang::IdentifierInfo::getBuiltinID(), clang::Token::getIdentifierInfo(), clang::Preprocessor::getLangOpts(), clang::Token::getLocation(), clang::IdentifierInfo::getName(), clang::Preprocessor::getPreprocessorAllocator(), clang::Preprocessor::getSpelling(), clang::if(), clang::Token::is(), clang::Preprocessor::isMacroDefined(), clang::Token::isNot(), clang::Token::isOneOf(), clang::IdentifierInfo::isStr(), clang::Preprocessor::Lex(), clang::Token::setAnnotationEndLoc(), clang::Token::setAnnotationValue(), clang::Token::setKind(), clang::Token::setLocation(), clang::Token::startToken(), and clang::format::Tok.

## ◆ PragmaLoopHintString()

static std::string PragmaLoopHintString | ( | Token | PragmaName,
|  | Token | Option
| ) |  |
| static

Definition at line 1004 of file ParsePragma.cpp.

References clang::IdentifierLoc::create(), Diag(), clang::comments::tok::eof, clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Token::getAnnotationValue(), clang::Token::getIdentifierInfo(), clang::Token::getLocation(), clang::IdentifierInfo::getName(), clang::Token::is(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::Token::isNot(), clang::LoopHint::OptionLoc, clang::LoopHint::PragmaNameLoc, clang::LoopHint::Range, clang::LoopHint::StateLoc, and clang::LoopHint::ValueExpr.