clang  6.0.0svn
Classes | Namespaces | Functions
ParseObjc.cpp File Reference
#include "clang/Parse/Parser.h"
#include "clang/AST/ASTContext.h"
#include "clang/Basic/CharInfo.h"
#include "clang/Parse/ParseDiagnostic.h"
#include "clang/Parse/RAIIObjectsForParser.h"
#include "clang/Sema/DeclSpec.h"
#include "clang/Sema/PrettyDeclStackTrace.h"
#include "clang/Sema/Scope.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
Include dependency graph for ParseObjc.cpp:

Go to the source code of this file.

Classes

class  clang::Parser::ObjCTypeParamListScope
 Class to handle popping type parameters when leaving the scope. More...
 

Namespaces

 OBJC2
 objc-class-instance-variables: '{' objc-instance-variable-decl-list[opt] '}'
 

Functions

static void addContextSensitiveTypeNullability (Parser &P, Declarator &D, NullabilityKind nullability, SourceLocation nullabilityLoc, bool &addedToDeclSpec)
 Add an attribute for a context-sensitive type nullability to the given declarator. More...
 
static void diagnoseRedundantPropertyNullability (Parser &P, ObjCDeclSpec &DS, NullabilityKind nullability, SourceLocation nullabilityLoc)
 Diagnose redundant or conflicting nullability information. More...
 
static void takeDeclAttributes (ParsedAttributes &attrs, AttributeList *list)
 Take all the decl attributes out of the given list and add them to the given attribute set. More...
 
static void takeDeclAttributes (ParsedAttributes &attrs, Declarator &D)
 takeDeclAttributes - Take all the decl attributes from the given declarator and add them to the given list. More...
 

Function Documentation

◆ addContextSensitiveTypeNullability()

static void addContextSensitiveTypeNullability ( Parser P,
Declarator D,
NullabilityKind  nullability,
SourceLocation  nullabilityLoc,
bool addedToDeclSpec 
)
static

Add an attribute for a context-sensitive type nullability to the given declarator.

Definition at line 379 of file ParseObjc.cpp.

References clang::DeclSpec::addAttributes(), clang::AttributeList::AS_ContextSensitiveKeyword, clang::SelectorTable::constructSetterSelector(), clang::Parser::ConsumeToken(), clang::Contravariant, clang::Covariant, clang::AttributePool::create(), clang::FixItHint::CreateInsertion(), clang::Parser::Diag(), clang::ObjCDeclSpec::DQ_PR_nullability, clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::Declarator::getAttributePool(), clang::DeclaratorChunk::getAttrListRef(), clang::Parser::getCurScope(), clang::ObjCDeclSpec::getGetterName(), clang::Parser::getLangOpts(), clang::Decl::getLocStart(), clang::Declarator::getMutableDeclSpec(), clang::ObjCDeclSpec::getNullability(), clang::Parser::getNullabilityKeyword(), clang::ObjCDeclSpec::getNullabilityLoc(), clang::Declarator::getNumTypeObjects(), clang::ObjCDeclSpec::getPropertyAttributes(), clang::ObjCDeclSpec::getSetterName(), clang::Declarator::getTypeObject(), clang::Invariant, clang::format::FormatToken::is(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::format::FormatToken::isNot(), clang::format::FormatToken::isObjCAtKeyword(), clang::format::FormatToken::isOneOf(), clang::ActionResult< PtrTy, CompressInvalid >::isUsable(), clang::Parser::ParseTypeName(), clang::Sema::PCC_ObjCImplementation, clang::Sema::PCC_ObjCInterface, clang::Property, clang::SourceRange::setBegin(), clang::SourceRange::setEnd(), clang::Parser::SkipUntil(), clang::Parser::StopAtSemi, clang::Parser::StopBeforeMatch, and clang::Parser::TryConsumeToken().

Referenced by takeDeclAttributes().

◆ diagnoseRedundantPropertyNullability()

static void diagnoseRedundantPropertyNullability ( Parser P,
ObjCDeclSpec DS,
NullabilityKind  nullability,
SourceLocation  nullabilityLoc 
)
static

◆ takeDeclAttributes() [1/2]

static void takeDeclAttributes ( ParsedAttributes attrs,
AttributeList list 
)
static

Take all the decl attributes out of the given list and add them to the given attribute set.

Definition at line 1206 of file ParseObjc.cpp.

References clang::ParsedAttributes::add(), clang::AttributeList::getNext(), clang::AttributeList::isUsedAsTypeAttr(), and clang::AttributeList::setNext().

Referenced by takeDeclAttributes().

◆ takeDeclAttributes() [2/2]

static void takeDeclAttributes ( ParsedAttributes attrs,
Declarator D 
)
static

takeDeclAttributes - Take all the decl attributes from the given declarator and add them to the given list.

Definition at line 1224 of file ParseObjc.cpp.

References clang::Type::acceptsObjCTypeParams(), addContextSensitiveTypeNullability(), clang::Sema::ObjCArgInfo::ArgAttrs, clang::AS_none, clang::DeclGroupRef::begin(), clang::Scope::ClassScope, ColonLoc, clang::ParsingDeclRAIIObject::complete(), clang::BalancedDelimiterTracker::consumeClose(), clang::BalancedDelimiterTracker::consumeOpen(), clang::Parser::ConsumeToken(), clang::FixItHint::CreateInsertion(), clang::FixItHint::CreateRemoval(), clang::Scope::DeclScope, clang::Sema::ObjCArgInfo::DeclSpec, clang::Parser::Diag(), clang::ObjCDeclSpec::DQ_CSNullability, clang::DeclGroupRef::end(), clang::comments::tok::eof, clang::Scope::FunctionDeclarationScope, clang::Scope::FunctionPrototypeScope, clang::ActionResult< PtrTy, CompressInvalid >::get(), clang::DeclSpec::getAttributePool(), clang::Declarator::getAttributePool(), clang::DeclSpec::getAttributes(), clang::Declarator::getAttributes(), clang::DeclaratorChunk::getAttrs(), clang::SourceRange::getBegin(), clang::BalancedDelimiterTracker::getCloseLocation(), clang::Parser::getCurScope(), clang::Declarator::getDeclSpec(), clang::Declarator::getIdentifier(), clang::Token::getIdentifierInfo(), clang::Declarator::getIdentifierLoc(), clang::Parser::getLangOpts(), clang::ParsedAttributes::getList(), clang::Token::getLocation(), clang::ObjCDeclSpec::getNullability(), clang::ObjCDeclSpec::getNullabilityLoc(), clang::Declarator::getNumTypeObjects(), clang::ObjCDeclSpec::getObjCDeclQualifier(), clang::BalancedDelimiterTracker::getOpenLocation(), clang::ParsedAttributes::getPool(), clang::Declarator::getTypeObject(), clang::Token::is(), clang::format::FormatToken::is(), clang::ActionResult< PtrTy, CompressInvalid >::isInvalid(), clang::Declarator::isInvalidType(), clang::format::FormatToken::isNot(), clang::QualType::isNull(), clang::format::FormatToken::isObjCAtKeyword(), clang::ActionResult< PtrTy, CompressInvalid >::isUsable(), clang::SourceLocation::isValid(), clang::Sema::ObjCArgInfo::Name, clang::Sema::ObjCArgInfo::NameLoc, clang::Parser::NextToken(), clang::ParsingDeclRAIIObject::NoParent, clang::Parser::ObjCDeclContextSwitch, clang::Declarator::ObjCParameterContext, clang::Declarator::ObjCResultContext, clang::Sema::OCK_Implementation, P, clang::Parser::ParseTypeName(), clang::Sema::PCC_ObjCInstanceVariableList, clang::Sema::PCC_Type, clang::Declarator::PrototypeContext, clang::Result, clang::DeclSpec::setObjCQualifiers(), clang::DeclSpec::SetTypeSpecType(), clang::Parser::SkipUntil(), clang::Parser::StopAtSemi, clang::Parser::StopBeforeMatch, clang::T, clang::AttributePool::takeAllFrom(), takeDeclAttributes(), clang::Parser::TryConsumeToken(), clang::TST_typename, clang::Sema::ObjCArgInfo::Type, and clang::Declarator::TypeNameContext.