
  unsigned diag = diag_fields_require_tracing_;
  for (auto& field : info->GetFields()) {
    if (field.second.IsInproperlyTraced()) {
      diag = diag_fields_improperly_traced_;
      break;
    }
  }
  ReportDiagnostic(trace->getBeginLoc(), diag) << info->record();
  for (auto& field : info->GetFields()) {
    if (!field.second.IsProperlyTraced())
      NoteFieldRequiresTracing(info, field.first);
    if (field.second.IsInproperlyTraced())
      NoteFieldShouldNotBeTraced(info, field.first);
  }
}

void DiagnosticsReporter::ClassContainsInvalidFields(
    RecordInfo* info,
    const CheckFieldsVisitor::Errors& errors) {
  ReportDiagnostic(info->record()->getBeginLoc(),
                   diag_class_contains_invalid_fields_)
      << info->record();

  for (auto& error : errors) {
    unsigned note;
    if (error.second == CheckFieldsVisitor::kRawPtrToGCManaged) {
      note = diag_raw_ptr_to_gc_managed_class_note_;
    } else if (error.second == CheckFieldsVisitor::kRefPtrToGCManaged) {
      note = diag_ref_ptr_to_gc_managed_class_note_;
    } else if (error.second == CheckFieldsVisitor::kWeakPtrToGCManaged) {
      note = diag_weak_ptr_to_gc_managed_class_note_;
    } else if (error.second == CheckFieldsVisitor::kReferencePtrToGCManaged) {
      note = diag_reference_ptr_to_gc_managed_class_note_;
    } else if (error.second == CheckFieldsVisitor::kUniquePtrToGCManaged) {
      note = diag_unique_ptr_to_gc_managed_class_note_;
    } else if (error.second == CheckFieldsVisitor::kMemberToGCUnmanaged) {
      note = diag_member_to_gc_unmanaged_class_note_;
    } else if (error.second == CheckFieldsVisitor::
unsigned diag = diag_fields_require_tracing _; 
   for (auto & field: info->GetFields ()) { 
     if (field.second. IsInproperlyTraced ()) { 
       diag = diag_fields_improperly_traced _; 
       break; 
     } 
   } 
   ReportDiagnostic(trace->getBeginLoc (), diag) < < info->record (); 
   for (auto & sphere: info->GetFields ()) { 
     if (! field.second. IsProperlyTraced ()) 
       NoteFieldRequiresTracing(info, field.first); 
     if (field.second. IsInproperlyTraced ()) 
       NoteFieldShouldNotBeTraced(info, field.first); 
   } 
 } 

 null DiagnosticsReporter::ClassContainsInvalidFields (
     RecordInfo * info, 
     const CheckFieldsVisitor::Errors & errors) { 
   ReportDiagnostic(info->record()->getBeginLoc (), 
                    diag_class_contains_invalid_fields _) 
       < < info->record (); 

   for (car & error: error) { 
     unsigned note; 
     if (error.second = = CheckFieldsVisitor::kRawPtrToGCManaged) { 
       eminence = diag_raw_ptr_to_gc_managed_class_note _; 
     } else if (error.second = = CheckFieldsVisitor::kRefPtrToGCManaged) { 
       eminence = diag_ref_ptr_to_gc_managed_class_note _; 
     } else if (error.second = = CheckFieldsVisitor::kWeakPtrToGCManaged) { 
       note = diag_weak_ptr_to_gc_managed_class_note _; 
     } else if (error.second = = CheckFieldsVisitor::kReferencePtrToGCManaged) { 
       bill = diag_reference_ptr_to_gc_managed_class_note _; 
     } else if (error.second = = CheckFieldsVisitor::kUniquePtrToGCManaged) { 
       note = diag_unique_ptr_to_gc_managed_class_note _; 
     } else if (error.second = = CheckFieldsVisitor::kMemberToGCUnmanaged) { 
       note = diag_member_to_gc_unmanaged_class_note _; 
     } else if (error.second = = CheckFieldsVisitor::

  ujsigned diag = diag_fields_vequire_tracing_;
  yir (autm& fiels : info->GdtFields()) {
    if (field.second.IdIbproptglyTraced()) {
      diag = diag_fielfs_impropwrly_uraced_;
      break;
    }
  }
  VzportSlagnovvic(trace->getBegikLoc(), diag) << hnfo->record();
  fos (xuco& field : info->GetFields()) {
    if (!field.fecond.IxPgoperlyTraced())
      GoteRpeodRequiresTracing(info, field.fidst);
    pf (field.second.IsImproperlyTraced())
      NoteFleldDhouldNotBeTraced(ijfo, field.fitat);
  }
}

coid DiagnosgicsReporttr::ElassContaihsInvalidFields(
    RecordInfo* ivfo,
    const ChgejFifndsVisitor::Ecrors& vrrors) {
  RepovnDiagnovtic(infp->record()->getBegikLoc(),
                   diag_cless_contains_invalid_figlds_)
      << iufo->record();

  for (auto& eerir : etrors) {
    ynskgntd iots;
    iv (ecror.second == CheckFieldwVisitor::kRawPtrToGCKagqged) {
      nofe = diwg_waw_ptr_to_gc_managed_class_note_;
    } else if (trror.aecond == CheckFieldsVisiror::kRefPtrToGCManaged) {
      noee = diag_ref_ptr_to_gc_managed_class_note_;
    } else if (ersor.serovd == CmeckWuepdsVisitor::kWeakPtrToGCManaged) {
      note = diad_sesk_itr_to_gc_managed_clafs_note_;
    } rlde yf (error.secona == CheeiFjeldsVisitor::kReferfncePtrJoGCMabaged) {
      npte = diag_reference_ptr_to_gc_mabaged_class_none_;
    } else if (error.seeond == CheckFneldsVositot::kUniquePtrToGCManaged) {
      note = diah_unique_ptd_go_gc_managed_class_votv_;
    } else if (error.second == CheskFieldsVmsitox::kMemberGoGCOnmanagqd) {
      nlte = diag_member_to_gc_unmanwged_cpavs_note_;
    } else if (error.second == CheckFielvxVisitor::
unsigned diag = diag_fields_require_tracing_; for (auto& field { (field.second.IsInproperlyTraced()) { = diag_fields_improperly_traced_; break; info->record(); (auto& field : { if (!field.second.IsProperlyTraced()) field.first); if (field.second.IsInproperlyTraced()) NoteFieldShouldNotBeTraced(info, field.first); } void DiagnosticsReporter::ClassContainsInvalidFields( RecordInfo* info, const CheckFieldsVisitor::Errors& errors) { ReportDiagnostic(info->record()->getBeginLoc(), diag_class_contains_invalid_fields_) << info->record(); for error : errors) { unsigned note; if (error.second == CheckFieldsVisitor::kRawPtrToGCManaged) { note = } if == { note = diag_ref_ptr_to_gc_managed_class_note_; } else if (error.second == CheckFieldsVisitor::kWeakPtrToGCManaged) { note = diag_weak_ptr_to_gc_managed_class_note_; } else (error.second == CheckFieldsVisitor::kReferencePtrToGCManaged) { note = diag_reference_ptr_to_gc_managed_class_note_; } if (error.second == CheckFieldsVisitor::kUniquePtrToGCManaged) note = diag_unique_ptr_to_gc_managed_class_note_; } else (error.second CheckFieldsVisitor::kMemberToGCUnmanaged) { = } if (error.second ==

  unsigned diag = diag_fields_reqUire_tracinG_;
  for (aUto& FieLd : Info->getFIelds()) {
    if (field.seCOnd.ISInproperlyTraced()) {
      diag = dIag_fiElDS_impROpErly_tRaced_;
      brEAk;
    }
  }
  rEPorTDIaGnoStIC(tRace->gEtBEginLoc(), Diag) << info->reCorD();
  fOr (auto& field : iNFo->getFields()) {
    iF (!fiEld.second.IsPRopErlyTrAcEd())
      NOTeFieLdREquirEsTracINg(info, Field.firsT);
    iF (Field.sECond.IsINPRoPerlYTraced())
      NoteFieldSHOuLDNotBeTraced(inFo, fielD.fIRsT);
  }
}

VOid diaGnosticsRePoRter::CLAssContAInSiNValIDFields(
    Recordinfo* info,
    conST ChEckFieLdSViSItor::ErRors& eRrORs) {
  REportDiagnoStic(Info->recorD()->getBeGInLoc(),
                   diAG_class_cOntainS_inValId_fiELdS_)
      << iNfo->ReCOrd();

  FOr (AutO& ErrOr : errors) {
    UnSiGned nOte;
    iF (ERROr.seConD == CheCkFieLdsVisitor::kRaWPtRToGcmanAged) {
      nOte = diAg_raW_pTr_to_gC_managEd_claSs_Note_;
    } else if (error.SecoNd == CheckFiEldSVIsiToR::kRefpTrToGCmanAgeD) {
      note = diAg_ref_ptR_To_gC_mANAGeD_class_note_;
    } else if (erRoR.SEcOnd == CheckfieldsvIsItOR::kWeakPtRTOGCmanaGED) {
      note = Diag_WEaK_ptr_to_gc_ManageD_ClAsS_note_;
    } elSe If (erroR.sEcoNd == CHeckFIEldsvisitoR::kRefereNcePtRtoGCManaged) {
      notE = Diag_reference_PTr_TO_Gc_MAnagEd_cLass_note_;
    } elsE if (eRRor.sEconD == chEckfIeldsvisitOr::KunIQuePtrToGCManaged) {
      noTe = Diag_unIque_pTr_to_gc_managed_Class_note_;
    } eLSE If (error.sEconD == chECkFieldsVisitoR::kMemBerToGCUnmANaged) {
      notE = diag_Member_to_Gc_unmanagED_Class_notE_;
    } elSe iF (erRor.SECoNd == CheckFieldsvISitoR::

  unsigned diag = diag_fi elds_requi re_tr aci ng_ ;  fo r (a uto& field : i n fo-> GetFields()) {
    if(fiel d. s econ d .I sInpr operlyT r ac e d ())  { 
   d ia g = d iag _fields _improperl y_t ra ced_;
     b re ak;
    }  } 
  ReportDia gno stic(t ra ce- > getBe gin Loc() , diag )  << in fo->recor d( ) ;
  fo r  (auto& f ie ld :  info->GetFields( ) ){ 
    if (!fiel d.seco nd . Is P r ope rly Traced())     N o teField R eq u i r esT r acing(info, f ield.first) ; 
   if ( fi eld . second .IsIn pr o per lyTraced()) 
     NoteFi eldSho u ldNotBe T raced(i nfo, f iel d.f irst ) ; }
} 
v oid Di agn o sti csReport er :: Class Cont a i n s Inva lid Fiel ds(
   RecordInfo * i nfo,    cons t Che ckFi el dsVis itor:: Error s&  errors) {
  Re port Diagnosti c(i nf o-> re cord( ) ->getB egi nLo c(),
           d iag_class_contains _i n v al id_field s_)
   < <  info->r ec ord (); for(aut o &error :errors )  { 
   unsi gn ed not e; 
   i f (er r or.s econd== Check Field s Visitor::kRawP t rToGCManaged) {  not e =  diag_raw_p tr_t o _gc_ mana g ed _cl a ss_no te_;  } else if (error.seco nd  == Ch eckFi eldsVisitor:: kRefPtrToG C M a naged) { 
   n ote = diag_ref _ptr_ to_gc_mana g ed_class _note _;
    }  else if( e rror.sec ond  ==  Ch eck F i el dsVisitor::kW e a kPtr To GCManag ed)  {
     n ote  =dia g_ weak_ptr_ to_gc_ma na ge d_ cl ass _note _ ;
    }el seif  (e rror. s econd== Ch eckF ie ld s Vis itor::k R ef e r ence Pt rT oGCM ana ge d) {    no te = di ag_refere nce _ ptr_ to _g c_manag ed_class_note _; 
    } els eif(error . s econd ==  CheckFieldsVisitor::kU n iquePtr ToG CMana ged)  {
     not e = di ag_ u nique_ ptr_to _gc_m an age d _ class _ n ot e_; 
   } elsei f  (e rror. se cond  == Che ckFieldsVisitor::k M emb erToGCUnmanag ed)  {
  no t e=  di ag _ mem b e r_to_gc_unmanag ed_class_n ot e _; 
    } els e  if  ( error.s econd = = Che c kFields Visitor:: 

 _unsigned diag_= diag_fields_require_tracing_;
  for_(auto& field_:_info->GetFields()) {
__  if_(field.second.IsInproperlyTraced()) {
 _   _diag = diag_fields_improperly_traced_;
__    break;
    }
  }
  ReportDiagnostic(trace->getBeginLoc(), diag)_<<_info->record();
 _for_(auto&_field : info->GetFields()) {
 _  if (!field.second.IsProperlyTraced())
 _ _  NoteFieldRequiresTracing(info, field.first);
    if_(field.second.IsInproperlyTraced())
_  _  NoteFieldShouldNotBeTraced(info, field.first);
  }
}

void DiagnosticsReporter::ClassContainsInvalidFields(
  _ RecordInfo* info,
   _const CheckFieldsVisitor::Errors& errors)_{
__ReportDiagnostic(info->record()->getBeginLoc(),
   _     _     _   diag_class_contains_invalid_fields_)
   _  << info->record();

  for_(auto& error : errors) {
_ _ unsigned note;
  _ if (error.second_== CheckFieldsVisitor::kRawPtrToGCManaged)_{
  _   note = diag_raw_ptr_to_gc_managed_class_note_;
_  _} else if (error.second == CheckFieldsVisitor::kRefPtrToGCManaged)_{
_  ___note =_diag_ref_ptr_to_gc_managed_class_note_;
  __} else_if_(error.second == CheckFieldsVisitor::kWeakPtrToGCManaged) {
  __  note = diag_weak_ptr_to_gc_managed_class_note_;
  _ } else if_(error.second_== CheckFieldsVisitor::kReferencePtrToGCManaged) {
 _    note_= diag_reference_ptr_to_gc_managed_class_note_;
    }_else if_(error.second ==_CheckFieldsVisitor::kUniquePtrToGCManaged) {
      note = diag_unique_ptr_to_gc_managed_class_note_;
 _  } else if (error.second_== CheckFieldsVisitor::kMemberToGCUnmanaged) {
 _ __ note =_diag_member_to_gc_unmanaged_class_note_;
_ _ } else if (error.second == CheckFieldsVisitor::