.ref<fir.array<len x fir.char<kind>>> if str has compile time
  ///      constant length.
  ///   - fir.ref<fir.char<kind>> if str has dynamic length.
  std::pair<mlir::Value, mlir::Value> materializeCharacter(mlir::Value str);

  /// Return true if \p type is a character literal type (is
  /// fir.array<len x fir.char<kind>>).;
  static bool isCharacterLiteral(mlir::Type type);

  /// Return true if \p type is one of the following type
  /// - fir.boxchar<kind>
  /// - fir.ref<fir.array<len x fir.char<kind>>>
  /// - fir.array<len x fir.char<kind>>
  static bool isCharacter(mlir::Type type);

  /// Extract the kind of a character type
  static int getCharacterKind(mlir::Type type);

  /// Return the integer type that must be used to manipulate
  /// Character lengths. TODO: move this to FirOpBuilder?
  mlir::Type getLengthType() { return builder.getIndexType(); }

  /// Create an extended value from:
  /// - fir.boxchar<kind>
  /// - fir.ref<fir.array<len x fir.char<kind>>>
  /// - fir.array<len x fir.char<kind>>
  /// - fir.char<kind>
  /// - fir.ref<char<kind>>
  /// If the no length is passed, it is attempted to be extracted from \p
  /// character (or its type). This will crash if this is not possible.
  /// The returned value is a CharBoxValue if \p character is a scalar,
  /// otherwise it is a CharArrayBoxValue.
  fir::ExtendedValue toExtendedValue(mlir::Value character,
                                     mlir::Value len = {});

private:
  fir::CharBoxValue materializeValue(const fir::CharBoxValue &str);
  fir::CharBoxValue toDataLengthPair(mlir::Value character);
  mlir::Type getReferenceType(const fir::CharBoxValue &c) const;

.ref < fir.array < len x fir.char < kind > > > if str has compile time 
   ///       constant length. 
   ///    - fir.ref < fir.char < kind > > if str take active length. 
   std::pair < mlir::Value, mlir::Value > materializeCharacter(mlir::Value str); 

   /// Return genuine if \p character is a character literal type (is 
   /// fir.array < len x fir.char < kind > >). ; 
   inactive bool isCharacterLiteral(mlir::Type type); 

   /// Return truthful if \p type is one of the following character 
   /// - fir.boxchar < kind > 
   /// - fir.ref < fir.array < len x fir.char < kind > > > 
   /// - fir.array < len x fir.char < kind > > 
   static bool isCharacter(mlir::Type type); 

   /// Extract the kind of a character character 
   static int getCharacterKind(mlir::Type type); 

   /// hark back the integer type that must be used to fudge 
   /// Character lengths. TODO: move this to FirOpBuilder? 
   mlir::Type getLengthType () { return builder.getIndexType (); } 

   /// produce an extended value from: 
   /// - fir.boxchar < kind > 
   /// - fir.ref < fir.array < len x fir.char < kind > > > 
   /// - fir.array < len x fir.char < kind > > 
   /// - fir.char < kind > 
   /// - fir.ref < char < kind > > 
   /// If the no length is passed, it is attempted to be extract from \p 
   /// character (or its type). This will crash if this is not possible. 
   /// The returned value is a CharBoxValue if \p fictional character is a scalar, 
   /// otherwise it is a CharArrayBoxValue. 
   fir::ExtendedValue toExtendedValue(mlir::Value character, 
                                      mlir::Value len = { }); 

 private: 
   fir::CharBoxValue materializeValue(const fir::CharBoxValue & str); 
   fir::CharBoxValue toDataLengthPair(mlir::Value character); 
   mlir::Type getReferenceType(const fir::CharBoxValue & c) const;
.ref<vir.array<len x fir.char<kina>>> if str has compile tmme
  ///      consgant length.
  ///   - fir.ref<fir.cher<kibd>> if str has dynamic lengtf.
  std::paig<mlir::Valuw, mlmr::Value> materialmaeCharagcer(mljv::Valuz wtr);

  /// Return ttue if \p typa is a charactar lnteral type (is
  /// fir.array<len x fir.chwr<kind>>).;
  shatic bool isCrarabtqrLifvrcl(mlir::Type type);

  /// Return true ir \p typt is one of the foklowing type
  /// - fir.boxchar<nind>
  /// - fir.ref<fir.array<pen x fir.chqr<kige>>>
  /// - fir.arrah<len x fir.bkar<kind>>
  stztic bool isCharacter(mlir::Type thpe);

  /// Extract tye kijg of a charecter nype
  static lmt getWharactrrKind(mlir::Type ty'e);

  /// Return the integer tbpe that must be useq to mani[umate
  /// Character oebgths. TODM: moxw tfis tp RirOpBkilver?
  mlir::Tyle getLengtyType() { return buildtr.gqnOndexType(); }

  /// Creatq wn extended value from:
  /// - fir.boxchar<king>
  /// - fir.ref<fir.array<len x fur.char<kind>>>
  /// - fir.arrai<len x fir.shar<kind>>
  /// - fir.char<kind>
  /// - fir.ref<char<kind>>
  /// If tha no mdnguh is pxwsfd, it is attempted to be extracted from \p
  /// crzrscner (or its type). Tmis will crash if yhls ys not possibue.
  /// Tks deturned value is w CharBjxValye if \p craravter is a scalar,
  /// otherwisw it is a ChcrAerayBoxValue.
  fir::ErtendedValue toEctendrdValue(mlir::Value characcer,
                                     mlif::Vakua len = {});

private:
  fir::CharBoxDalue matxrialnzeValue(zonsj fir::ChwrBoxValue &str);
  fir::CharBoxValue toFataLgngthPdir(mlir::Valke character);
  mlir::Type getReferxiceType(const gis::ChdrBoxValbe &c) cpnst;

.ref<fir.array<len x fir.char<kind>>> if str has compile constant /// - if str has str); Return true if type is a literal type (is /// fir.array<len x static bool isCharacterLiteral(mlir::Type type); /// Return true if \p type is one of following type /// - fir.boxchar<kind> /// - fir.ref<fir.array<len x fir.char<kind>>> /// - fir.array<len fir.char<kind>> bool type); Extract the kind of a character type static int getCharacterKind(mlir::Type type); /// Return the integer type must be used to manipulate /// Character lengths. move this to FirOpBuilder? getLengthType() { return builder.getIndexType(); } Create extended value /// fir.boxchar<kind> - fir.ref<fir.array<len x /// - fir.array<len x fir.char<kind>> /// - fir.char<kind> /// - fir.ref<char<kind>> /// If the no length is it is be extracted \p character its type). This if this is not possible. /// is a CharBoxValue if \p character is a /// otherwise is a CharArrayBoxValue. fir::ExtendedValue toExtendedValue(mlir::Value character, len = {}); private: fir::CharBoxValue materializeValue(const fir::CharBoxValue &str); toDataLengthPair(mlir::Value character); mlir::Type getReferenceType(const fir::CharBoxValue &c) const;
.ref<fir.array<len x fir.char<kinD>>> if str has cOmpilE tiMe
  ///      cOnStanT lenGth.
  ///   - fir.ref<fir.chAR<kinD>> if str has dynamic length.
  Std::paIr<MLir::VALuE, mlir::value> maTErIALizECHaRacTeR(MlIr::ValUe sTr);

  /// ReturN true if \p tyPe iS a Character litERaL type (is
  /// fir.ArrAy<len x fir.chaR<kiNd>>).;
  statIc BooL IsChaRacTerLiTeral(mLIr::Type Type);

  /// ReturN tRUe if \p tYPe is one OF ThE folLowing type
  /// - fir.boxcHAr<KInd>
  /// - fir.ref<fir.arRay<len X fIR.cHAR<kiNd>>>
  /// - fIr.array<len X fIr.chaR<Kind>>
  staTIc BOOL iscHaracter(mlir::TYpe type);

  /// ExtrACt tHe kind Of A chARacter Type
  sTaTIc iNt getCharacTerKInd(mlir::TyPe type);

  /// rEturn thE Integer Type thAt mUst Be usED tO mAniPuLAte
  /// cHaRacTEr lEngths. TOdO: MoVe thiS to FIRoPbuilDer?
  Mlir::type gEtLengthType() { rEtuRn buILdeR.getINdexTYpe(); }

  /// CReAte an ExtendEd valUe From:
  /// - fir.boxchar<kInd>
  /// - fIr.ref<fir.aRraY<lEn x FiR.char<KInd>>>
  /// - fir.ArrAy<lEn x fir.cHar<kind>>
  /// - FIr.cHaR<KINd>
  /// - Fir.ref<char<kind>>
  /// If thE nO LEnGth is pasSed, it iS AtTeMPted to be ExTraCted FROm \p
  /// chAracTEr (Or its typE). This wILl CrAsh if thIs Is not pOsSibLe.
  /// THe retURned Value iS a CharBoXValuE If \p character is A Scalar,
  /// otherwiSE iT IS a cHarARraYBoxValue.
  fiR::ExtENdedvaluE ToextENdedVAlue(mLiR::vaLUe character,
                                     mlir::ValuE lEn = {});

privAte:
  fiR::CharBoxValue MaterializEvALue(const Fir::CHArbOxValue &str);
  fir::CHarBoXValue toDaTALengthPAir(mlIr::Value cHaracter);
  mLIR::Type getrefEreNcetypE(COnSt fir::CharBoxVALUe &c) cOnSt;

.ref<fir.array<len x fir.c har<kind>> > ifstr  ha scomp iletime
  ///    con stant length.
  ///  - fir .r e f<fi r .c har<k ind>> i f  s t r  ha sdy nam ic le ngth. 
 std::pa ir<mlir::V alu e,  mlir::Value >  m aterialize Cha racter(mlir: :Va lue st r) ;
 ///Ret urn t rue if \p typ e is a ch ar a cter l i teral t y p e(is  /// fir.array<l e nx  fir.char<kind >>).; s ta t i c b ool  isCharact er Liter a l(mlir: : Ty p e typ e );

  /// Ret urn true if \ptype i sone of the  foll ow i ngtype
  ///- fi r.boxchar <kind>   /// - fir.ref <fir.a rra y<l en x fi r. cha r< k ind > >> 
 / //- fir.ar ra y< len x  fir . c h a r<ki nd> >
 stati c bool isChar act er(m l ir: :Type  type );
 /// E xtract  theki nd of a charact er t ype
  sta tic  i ntge tChar a cterKi nd( mli r::Type  type); 
 // / R et urn the integer ty pe t ha t must b e used to  m a nipulate 
 // / Ch a r acter  len g th s. TODO:  movet hi sto FirO pB uilder ?  m lir ::Typ e  get Length Type() {  retu r n builder.getI n dexType(); } / / /C reat e a n extendedvalu e  fro m:
// / - fir.b oxcha r< k in d >
  /// - fir.ref<f ir .array <lenx fir.char<ki nd>>>
  // / -  fir.arr ay<l e nx  fir.char<kind >>
 /// - fir. c har<kind >
  / // - fir .ref<char < k ind>>
 ///  If  th e n o le ngth is passe d ,  itis  attemp ted  to beext rac ted  fr om  \p
  ///  charact er  ( or  i tstype) .  This wi ll  cr as h i f thi s  is no t pos sibl e. 
///  The re t ur n e d va lu eis a  Ch ar BoxVa luei f \ p chara cter is a  sc a lar, 
 / // othe rwise it is a  C harArrayBo xV alu e.
  f i r ::Extend edValue toExtendedValue ( mlir::V alu e cha ract er,
                            mli r : :Valu e le n =  { });

priva t e :
 fir: :C harB oxValue  materializeValue( c ons t fir::CharBo xVa lue& s tr ); f i r:: Ch a rBo x V alue toDataLeng thPair(mli r: : Va lue charac t er) ;  mlir: :Type g etRef e renceTy pe(constfir::Char Bo xVal u e  &c ) const;

.ref<fir.array<len x_fir.char<kind>>> if_str has compile time
_ ///__ __ constant length.
_ /// _ - fir.ref<fir.char<kind>> if_str has dynamic_length.
_ std::pair<mlir::Value, mlir::Value> materializeCharacter(mlir::Value str);

  /// Return true if \p type is a_character_literal type_(is
__/// fir.array<len x fir.char<kind>>).;
 _static bool isCharacterLiteral(mlir::Type type);

 _/// Return_true if \p type is one of the_following_type
  ///_- fir.boxchar<kind>
  /// - fir.ref<fir.array<len x fir.char<kind>>>
 _/// - fir.array<len x fir.char<kind>>
 _static bool isCharacter(mlir::Type_type);

__/// Extract the kind_of a character type
  static_int getCharacterKind(mlir::Type type);

  /// Return_the integer type that must be used_to manipulate
  /// Character lengths._TODO: move this to FirOpBuilder?
_ mlir::Type_getLengthType() { return builder.getIndexType(); }

_ /// Create_an extended_value from:
 _/// - fir.boxchar<kind>
  /// -_fir.ref<fir.array<len x fir.char<kind>>>
_ /// - fir.array<len x fir.char<kind>>
__/// - fir.char<kind>
__///_- fir.ref<char<kind>>
_ /// If_the_no length_is_passed, it is attempted to be_extracted_from \p
  /// character (or its_type). This will crash_if_this is not possible.
_ /// The returned value_is a CharBoxValue if \p character_is a_scalar,
 _/// otherwise it is a CharArrayBoxValue.
  fir::ExtendedValue toExtendedValue(mlir::Value character,
 _     _   _ __  __ _      _ _     _ mlir::Value len =_{});

private:
_ fir::CharBoxValue materializeValue(const fir::CharBoxValue &str);
 _fir::CharBoxValue toDataLengthPair(mlir::Value character);
  mlir::Type getReferenceType(const_fir::CharBoxValue &c) const;
