lib/Sema/SemaDeclAttr.cpp
static void handleObjCBoxable(Sema &S, Decl *D, const ParsedAttr &AL) {
  bool notify = false;

  auto *RD = dyn_cast<RecordDecl>(D);
  if (RD && RD->getDefinition()) {
    RD = RD->getDefinition();
    notify = true;
  }

  if (RD) {
    ObjCBoxableAttr *BoxableAttr = ::new (S.Context)
                          ObjCBoxableAttr(AL.getRange(), S.Context,
                                          AL.getAttributeSpellingListIndex());
    RD->addAttr(BoxableAttr);
    if (notify) {
      // we need to notify ASTReader/ASTWriter about
      // modification of existing declaration
      if (ASTMutationListener *L = S.getASTMutationListener())
        L->AddedAttributeToRecord(BoxableAttr, RD);
    }
  }
}
// When a user wants to use objc_boxable with a union or struct
// but they don't have access to the declaration (legacy/third-party code)
// then they can 'enable' this feature with a typedef:
// typedef struct __attribute((objc_boxable)) legacy_struct legacy_struct;
When a user wants to use objc_boxable with a union or struct
but they don't have access to the declaration (legacy/third-party code)
then they can 'enable' this feature with a typedef:
typedef struct __attribute((objc_boxable)) legacy_struct legacy_struct.
When a user wants to use objc_boxable with a union or struct but they don ' t have access to the declaration ( legacy / third - party code ) then they can ' enable ' this feature with a typedef : typedef struct __attribute (( objc_boxable )) legacy_struct legacy_struct .
static void handleObjCBoxable(Sema &S, Decl *D, const ParsedAttr &AL) {
  bool notify = false;
  auto *RD = dyn_cast<RecordDecl>(D);
  if (RD && RD->getDefinition()) {
    RD = RD->getDefinition();
    notify = true;
  }
  if (RD) {
    ObjCBoxableAttr *BoxableAttr = ::new (S.Context)
                          ObjCBoxableAttr(AL.getRange(), S.Context,
                                          AL.getAttributeSpellingListIndex());
    RD->addAttr(BoxableAttr);
    if (notify) {
      if (ASTMutationListener *L = S.getASTMutationListener())
        L->AddedAttributeToRecord(BoxableAttr, RD);
    }
  }
}
static void handleObjCBoxable ( Sema & S , Decl * D , const ParsedAttr & AL ) { bool notify = false ; auto * RD = dyn_cast < RecordDecl > ( D ) ; if ( RD && RD -> getDefinition ( ) ) { RD = RD -> getDefinition ( ) ; notify = true ; } if ( RD ) { ObjCBoxableAttr * BoxableAttr = :: new ( S . Context ) ObjCBoxableAttr ( AL . getRange ( ) , S . Context , AL . getAttributeSpellingListIndex ( ) ) ; RD -> addAttr ( BoxableAttr ) ; if ( notify ) { if ( ASTMutationListener * L = S . getASTMutationListener ( ) ) L -> AddedAttributeToRecord ( BoxableAttr , RD ) ; } } }
When a user wants to use objc_boxable with a union or struct
but they don't have access to the declaration (legacy/third-party code)
then they can 'enable' this feature with a typedef:
typedef struct __attribute((objc_boxable)) legacy_struct legacy_struct;
When a user wants to use objc_boxable with a union or struct but they don ' t have access to the declaration ( legacy / third - party code ) then they can ' enable ' this feature with a typedef : typedef struct __attribute (( objc_boxable )) legacy_struct legacy_struct ;
// we need to notify ASTReader/ASTWriter about // modification of existing declaration