• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/llvm-project/clang/lib/Sema/

Lines Matching refs:declarator

49 /// isOmittedBlockReturnType - Return true if this declarator is missing a
157 /// The declarator being processed.
158 Declarator &declarator;
160 /// The index of the declarator chunk we're currently processing.
197 TypeProcessingState(Sema &sema, Declarator &declarator)
198 : sema(sema), declarator(declarator),
199 chunkIndex(declarator.getNumTypeObjects()), trivial(true),
207 return declarator;
211 return chunkIndex == declarator.getNumTypeObjects();
219 assert(idx <= declarator.getNumTypeObjects());
226 return declarator.getTypeObject(chunkIndex).getAttrs();
248 /// declarator worked out to the given type.
330 return const_cast<DeclSpec&>(declarator.getDeclSpec());
383 /// Given the index of a declarator chunk, check whether that chunk
392 static DeclaratorChunk *maybeMovePastReturnType(Declarator &declarator,
395 assert(i <= declarator.getNumTypeObjects());
399 // First, look inwards past parens for a function declarator.
401 DeclaratorChunk &fnChunk = declarator.getTypeObject(i-1);
415 // If we do find a function declarator, scan inwards from that,
416 // looking for a (block-)pointer declarator.
419 DeclaratorChunk &ptrChunk = declarator.getTypeObject(i-1);
439 llvm_unreachable("bad declarator chunk kind");
445 llvm_unreachable("bad declarator chunk kind");
456 /// declaration *other* than on the declarator itself (for which, use
462 Declarator &declarator = state.getDeclarator();
464 // Move it to the outermost normal or block pointer declarator.
466 DeclaratorChunk &chunk = declarator.getTypeObject(i-1);
475 destChunk = maybeMovePastReturnType(declarator, i - 1,
493 declarator, i,
515 /// declarator.
518 Declarator &declarator = state.getDeclarator();
524 for (unsigned i = 0, e = declarator.getNumTypeObjects(); i != e; ++i) {
525 DeclaratorChunk &chunk = declarator.getTypeObject(i);
547 // anything in the declarator.
554 declarator.getMutableDeclSpec().getAttributes().takeOneFrom(
555 declarator.getAttributes(), &attr);
563 moveAttrFromListToList(attr, declarator.getAttributes(),
564 declarator.getTypeObject(innermost).getAttrs());
569 declarator.getAttributes().remove(&attr);
574 /// *other* than on the declarator itself or in the decl spec. Given
579 Declarator &declarator = state.getDeclarator();
584 DeclaratorChunk &chunk = declarator.getTypeObject(i-1);
611 Declarator &declarator = state.getDeclarator();
614 for (unsigned i = 0, e = declarator.getNumTypeObjects(); i != e; ++i) {
615 DeclaratorChunk &chunk = declarator.getTypeObject(i);
646 // If that failed, diagnose the bad attribute when the declarator is
651 /// A function type attribute was written on the declarator. Try to
656 Declarator &declarator = state.getDeclarator();
660 state, attr, declarator.getAttributes(), declSpecType))
663 // If that failed, diagnose the bad attribute when the declarator is
665 declarator.getAttributes().remove(&attr);
669 /// Given that there are attributes written on the declarator
671 /// declarator chunk.
680 // Collect all the type attributes from the declarator itself.
682 "declarator has no attrs!");
703 // Microsoft type attributes cannot go after the declarator-id.
707 // Nullability specifiers cannot go after the declarator-id.
719 /// Add a synthetic '()' to a block-literal declarator if it is
723 Declarator &declarator = state.getDeclarator();
725 // First, check whether the declarator would produce a function,
727 if (declarator.isFunctionDeclarator()) {
728 // If so, make that declarator a prototyped declarator.
729 declarator.getFunctionTypeInfo().hasPrototype = true;
735 // block signature declarator is always an abstract-declarator, and
739 if (!declarator.getNumTypeObjects() && declSpecType->isFunctionType())
747 // Otherwise, we need to fake up a function declarator.
748 SourceLocation loc = declarator.getBeginLoc();
750 // ...and *prepend* it to the declarator.
752 declarator.AddInnermostTypeInfo(DeclaratorChunk::getFunction(
769 /*DeclsInPrototype=*/None, loc, loc, declarator));
773 assert(state.getCurrentChunkIndex() == declarator.getNumTypeObjects() - 1);
774 state.setCurrentChunkIndex(declarator.getNumTypeObjects());
805 static bool checkOmittedBlockReturnType(Sema &S, Declarator &declarator,
807 if (!isOmittedBlockReturnType(declarator))
812 for (ParsedAttr &AL : declarator.getMutableDeclSpec().getAttributes()) {
822 declarator.getMutableDeclSpec().getAttributes().remove(AL);
825 const DeclSpec &DS = declarator.getDeclSpec();
829 declarator.getMutableDeclSpec().ClearTypeQualifiers();
1279 /// \param state Specifies the declarator containing the declaration specifier
1288 Declarator &declarator = state.getDeclarator();
1289 DeclSpec &DS = declarator.getMutableDeclSpec();
1290 SourceLocation DeclLoc = declarator.getIdentifierLoc();
1350 declarator.getContext() == DeclaratorContext::LambdaExprContext) {
1354 } else if (declarator.getContext() ==
1356 checkOmittedBlockReturnType(S, declarator,
1389 declarator.setInvalidType(true);
1395 declarator.setInvalidType(true);
1453 declarator.setInvalidType(true);
1552 declarator.setInvalidType(true);
1563 declarator.setInvalidType(true);
1589 declarator.setInvalidType(true);
1612 declarator.setInvalidType(true);
1623 declarator.setInvalidType(true);
1635 declarator.setInvalidType(true);
1673 declarator.setInvalidType(true);
1697 declarator.setInvalidType(true);
1705 declarator.setInvalidType();
1709 declarator.setInvalidType(true);
1741 // function declarator if necessary.
1742 if (declarator.getContext() == DeclaratorContext::BlockLiteralContext)
1759 // The effect of a cv-qualifier-seq in a function declarator is not the
1810 declarator.setInvalidType(true);
1998 /// Kinds of declarator that cannot contain a qualified function type.
2012 /// diagnose that it cannot be contained within the given kind of declarator.
2136 // A declarator that specifies the type "reference to cv void"
2890 Declarator &declarator = state.getDeclarator();
2894 // Check whether the declarator has the expected form. We walk
2899 for (unsigned i = 0, e = declarator.getNumTypeObjects(); i != e; ++i) {
2901 DeclaratorChunk &chunk = declarator.getTypeObject(chunkIndex);
2966 DeclaratorChunk &chunk = declarator.getTypeObject(outermostPointerIndex);
3083 llvm_unreachable("unknown declarator chunk kind");
3204 // Owned declaration is embedded in declarator.
3260 // Declared return type of a lambda-declarator is implicit and is always
3392 // In Objective-C it is an error to use 'auto' on a function declarator
3510 /// declarator and a C++ direct-initializer.
3528 // Only warn if this declarator is declaring a function at block scope, and
3607 /// Produce an appropriate diagnostic for a declarator with top-level
3724 /// Helper for figuring out the default CC for a function declarator type. If
3726 /// declarator context. If not, then this could be either a member function
3757 // member pointer type or if we're the declarator. Any type attributes
3768 // If we're not the declarator, we're a regular function type unless we're
3777 // We're the innermost decl chunk, so must be a function declarator.
3861 /// Describes the kind of a pointer a declarator describes.
3877 /// Describes a declarator chunk wrapping a pointer that marks inference as
3890 /// Classify the given declarator, whose type-specified is \c type, based on
3895 classifyPointerDeclarator(Sema &S, QualType type, Declarator &declarator,
3903 // Look through the declarator chunks to identify pointers.
3904 for (unsigned i = 0, n = declarator.getNumTypeObjects(); i != n; ++i) {
3905 DeclaratorChunk &chunk = declarator.getTypeObject(i);
4166 // If this is the first pointer declarator in the file, and the appropriate
4215 /// Returns true if any of the declarator chunks before \p endIndex include a
4218 /// Because declarator chunks are stored in outer-to-inner order, testing
4227 // Walk outwards along the declarator chunks.
4321 // and at most one function declarator if this is a function declaration.
4323 // declarator chunks at all.
4468 // Nullability inference depends on the type and declarator.
4563 // Local function that checks the nullability for a given pointer declarator.
4826 // If the function declarator has a prototype (i.e. it is not () and
5336 // See if there are any attributes on this declarator chunk.
5356 // The empty list in a function declarator that is not part of a definition
5479 // Apply any undistributed attributes from the declarator.
5499 // If there was an ellipsis in the declarator, the declaration declares a
5503 // A declarator-id or abstract-declarator containing an ellipsis shall
5513 // of the declarator-id of the function parameter pack shall contain
5589 /// declarator to Type instances.
5594 // Determine the type of the declarator. Not all forms of declarator
5774 // If we got no declarator info from previous Sema routines,
6064 llvm_unreachable("unsupported TypeLoc kind in declarator!");
6149 // declarator chunk.
6227 // Make sure there are no unused decl attributes on the declarator.
7124 /// declarator, complaining if necessary.
7130 Declarator &declarator = state.getDeclarator();
7175 // pointer declarator.
7177 DeclaratorChunk &chunk = declarator.getTypeObject(i-1);
7192 declarator, i,
7957 // A C++11 attribute on a declarator chunk must appertain to a type.