@@ -5837,6 +5837,30 @@ static void fillMatrixTypeLoc(MatrixTypeLoc MTL,
58375837 llvm_unreachable (" no matrix_type attribute found at the expected location!" );
58385838}
58395839
5840+ static void fillAtomicQualLoc (AtomicTypeLoc ATL, const DeclaratorChunk &Chunk) {
5841+ SourceLocation Loc;
5842+ switch (Chunk.Kind ) {
5843+ case DeclaratorChunk::Function:
5844+ case DeclaratorChunk::Array:
5845+ case DeclaratorChunk::Paren:
5846+ case DeclaratorChunk::Pipe:
5847+ llvm_unreachable (" cannot be _Atomic qualified" );
5848+
5849+ case DeclaratorChunk::Pointer:
5850+ Loc = Chunk.Ptr .AtomicQualLoc ;
5851+ break ;
5852+
5853+ case DeclaratorChunk::BlockPointer:
5854+ case DeclaratorChunk::Reference:
5855+ case DeclaratorChunk::MemberPointer:
5856+ // FIXME: Provide a source location for the _Atomic keyword.
5857+ break ;
5858+ }
5859+
5860+ ATL.setKWLoc (Loc);
5861+ ATL.setParensRange (SourceRange ());
5862+ }
5863+
58405864namespace {
58415865 class TypeSpecLocFiller : public TypeLocVisitor <TypeSpecLocFiller> {
58425866 Sema &SemaRef;
@@ -6223,6 +6247,9 @@ namespace {
62236247 void VisitExtVectorTypeLoc (ExtVectorTypeLoc TL) {
62246248 TL.setNameLoc (Chunk.Loc );
62256249 }
6250+ void VisitAtomicTypeLoc (AtomicTypeLoc TL) {
6251+ fillAtomicQualLoc (TL, Chunk);
6252+ }
62266253 void
62276254 VisitDependentSizedExtVectorTypeLoc (DependentSizedExtVectorTypeLoc TL) {
62286255 TL.setNameLoc (Chunk.Loc );
@@ -6237,30 +6264,6 @@ namespace {
62376264 };
62386265} // end anonymous namespace
62396266
6240- static void fillAtomicQualLoc (AtomicTypeLoc ATL, const DeclaratorChunk &Chunk) {
6241- SourceLocation Loc;
6242- switch (Chunk.Kind ) {
6243- case DeclaratorChunk::Function:
6244- case DeclaratorChunk::Array:
6245- case DeclaratorChunk::Paren:
6246- case DeclaratorChunk::Pipe:
6247- llvm_unreachable (" cannot be _Atomic qualified" );
6248-
6249- case DeclaratorChunk::Pointer:
6250- Loc = Chunk.Ptr .AtomicQualLoc ;
6251- break ;
6252-
6253- case DeclaratorChunk::BlockPointer:
6254- case DeclaratorChunk::Reference:
6255- case DeclaratorChunk::MemberPointer:
6256- // FIXME: Provide a source location for the _Atomic keyword.
6257- break ;
6258- }
6259-
6260- ATL.setKWLoc (Loc);
6261- ATL.setParensRange (SourceRange ());
6262- }
6263-
62646267static void
62656268fillDependentAddressSpaceTypeLoc (DependentAddressSpaceTypeLoc DASTL,
62666269 const ParsedAttributesView &Attrs) {
0 commit comments