@@ -5837,6 +5837,30 @@ static void fillMatrixTypeLoc(MatrixTypeLoc MTL,
5837
5837
llvm_unreachable (" no matrix_type attribute found at the expected location!" );
5838
5838
}
5839
5839
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
+
5840
5864
namespace {
5841
5865
class TypeSpecLocFiller : public TypeLocVisitor <TypeSpecLocFiller> {
5842
5866
Sema &SemaRef;
@@ -6223,6 +6247,9 @@ namespace {
6223
6247
void VisitExtVectorTypeLoc (ExtVectorTypeLoc TL) {
6224
6248
TL.setNameLoc (Chunk.Loc );
6225
6249
}
6250
+ void VisitAtomicTypeLoc (AtomicTypeLoc TL) {
6251
+ fillAtomicQualLoc (TL, Chunk);
6252
+ }
6226
6253
void
6227
6254
VisitDependentSizedExtVectorTypeLoc (DependentSizedExtVectorTypeLoc TL) {
6228
6255
TL.setNameLoc (Chunk.Loc );
@@ -6237,30 +6264,6 @@ namespace {
6237
6264
};
6238
6265
} // end anonymous namespace
6239
6266
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
-
6264
6267
static void
6265
6268
fillDependentAddressSpaceTypeLoc (DependentAddressSpaceTypeLoc DASTL,
6266
6269
const ParsedAttributesView &Attrs) {
0 commit comments