@@ -1114,7 +1114,7 @@ bool MatchableInfo::validate(StringRef CommentDelimiter, bool IsAlias) const {
11141114    //  Verify that any operand is only mentioned once.
11151115    //  We reject aliases and ignore instructions for now.
11161116    if  (!IsAlias && TheDef->getValueAsString (" AsmMatchConverter"  ).empty () &&
1117-         Tok[0 ] == ' $'   && !OperandNames.insert (std::string ( Tok)).second ) {
1117+         Tok[0 ] == ' $'   && !OperandNames.insert (Tok. str ( )).second ) {
11181118      LLVM_DEBUG ({
11191119        errs () << " warning: '"   << TheDef->getName () << " ': " 
11201120               << " ignoring instruction with tied operand '"   << Tok << " '\n "  ;
@@ -1170,15 +1170,15 @@ static std::string getEnumNameForToken(StringRef Str) {
11701170}
11711171
11721172ClassInfo *AsmMatcherInfo::getTokenClass (StringRef Token) {
1173-   ClassInfo *&Entry = TokenClasses[std::string ( Token)];
1173+   ClassInfo *&Entry = TokenClasses[Token. str ( )];
11741174
11751175  if  (!Entry) {
11761176    Classes.emplace_front ();
11771177    Entry = &Classes.front ();
11781178    Entry->Kind  = ClassInfo::Token;
11791179    Entry->ClassName  = " Token"  ;
11801180    Entry->Name  = " MCK_"   + getEnumNameForToken (Token);
1181-     Entry->ValueName  = std::string ( Token);
1181+     Entry->ValueName  = Token. str ( );
11821182    Entry->PredicateMethod  = " <invalid>"  ;
11831183    Entry->RenderMethod  = " <invalid>"  ;
11841184    Entry->ParserMethod  = " "  ;
@@ -1352,11 +1352,11 @@ void AsmMatcherInfo::buildRegisterClasses(
13521352
13531353    const  Init *DiagnosticType = Def->getValueInit (" DiagnosticType"  );
13541354    if  (const  StringInit *SI = dyn_cast<StringInit>(DiagnosticType))
1355-       CI->DiagnosticType  = std::string ( SI->getValue ());
1355+       CI->DiagnosticType  = SI->getValue (). str ( );
13561356
13571357    const  Init *DiagnosticString = Def->getValueInit (" DiagnosticString"  );
13581358    if  (const  StringInit *SI = dyn_cast<StringInit>(DiagnosticString))
1359-       CI->DiagnosticString  = std::string ( SI->getValue ());
1359+       CI->DiagnosticString  = SI->getValue (). str ( );
13601360
13611361    //  If we have a diagnostic string but the diagnostic type is not specified
13621362    //  explicitly, create an anonymous diagnostic type.
@@ -1376,11 +1376,12 @@ void AsmMatcherInfo::buildRegisterClasses(
13761376    assert (CI && " Missing singleton register class info!"  );
13771377
13781378    if  (CI->ValueName .empty ()) {
1379-       CI->ClassName  = std::string ( Rec->getName ());
1379+       CI->ClassName  = Rec->getName (). str ( );
13801380      CI->Name  = " MCK_"   + Rec->getName ().str ();
1381-       CI->ValueName  = std::string ( Rec->getName ());
1382-     } else 
1381+       CI->ValueName  = Rec->getName (). str ( );
1382+     } else  { 
13831383      CI->ValueName  = CI->ValueName  + " ,"   + Rec->getName ().str ();
1384+     }
13841385  }
13851386}
13861387
@@ -1413,14 +1414,14 @@ void AsmMatcherInfo::buildOperandClasses() {
14131414      else 
14141415        CI->SuperClasses .push_back (SC);
14151416    }
1416-     CI->ClassName  = std::string ( Rec->getValueAsString (" Name"  ));
1417+     CI->ClassName  = Rec->getValueAsString (" Name"  ). str ( );
14171418    CI->Name  = " MCK_"   + CI->ClassName ;
1418-     CI->ValueName  = std::string ( Rec->getName ());
1419+     CI->ValueName  = Rec->getName (). str ( );
14191420
14201421    //  Get or construct the predicate method name.
14211422    const  Init *PMName = Rec->getValueInit (" PredicateMethod"  );
14221423    if  (const  StringInit *SI = dyn_cast<StringInit>(PMName)) {
1423-       CI->PredicateMethod  = std::string ( SI->getValue ());
1424+       CI->PredicateMethod  = SI->getValue (). str ( );
14241425    } else  {
14251426      assert (isa<UnsetInit>(PMName) && " Unexpected PredicateMethod field!"  );
14261427      CI->PredicateMethod  = " is"   + CI->ClassName ;
@@ -1429,7 +1430,7 @@ void AsmMatcherInfo::buildOperandClasses() {
14291430    //  Get or construct the render method name.
14301431    const  Init *RMName = Rec->getValueInit (" RenderMethod"  );
14311432    if  (const  StringInit *SI = dyn_cast<StringInit>(RMName)) {
1432-       CI->RenderMethod  = std::string ( SI->getValue ());
1433+       CI->RenderMethod  = SI->getValue (). str ( );
14331434    } else  {
14341435      assert (isa<UnsetInit>(RMName) && " Unexpected RenderMethod field!"  );
14351436      CI->RenderMethod  = " add"   + CI->ClassName  + " Operands"  ;
@@ -1438,15 +1439,15 @@ void AsmMatcherInfo::buildOperandClasses() {
14381439    //  Get the parse method name or leave it as empty.
14391440    const  Init *PRMName = Rec->getValueInit (" ParserMethod"  );
14401441    if  (const  StringInit *SI = dyn_cast<StringInit>(PRMName))
1441-       CI->ParserMethod  = std::string ( SI->getValue ());
1442+       CI->ParserMethod  = SI->getValue (). str ( );
14421443
14431444    //  Get the diagnostic type and string or leave them as empty.
14441445    const  Init *DiagnosticType = Rec->getValueInit (" DiagnosticType"  );
14451446    if  (const  StringInit *SI = dyn_cast<StringInit>(DiagnosticType))
1446-       CI->DiagnosticType  = std::string ( SI->getValue ());
1447+       CI->DiagnosticType  = SI->getValue (). str ( );
14471448    const  Init *DiagnosticString = Rec->getValueInit (" DiagnosticString"  );
14481449    if  (const  StringInit *SI = dyn_cast<StringInit>(DiagnosticString))
1449-       CI->DiagnosticString  = std::string ( SI->getValue ());
1450+       CI->DiagnosticString  = SI->getValue (). str ( );
14501451    //  If we have a DiagnosticString, we need a DiagnosticType for use within
14511452    //  the matcher.
14521453    if  (!CI->DiagnosticString .empty () && CI->DiagnosticType .empty ())
@@ -1459,7 +1460,7 @@ void AsmMatcherInfo::buildOperandClasses() {
14591460    //  Get or construct the default method name.
14601461    const  Init *DMName = Rec->getValueInit (" DefaultMethod"  );
14611462    if  (const  StringInit *SI = dyn_cast<StringInit>(DMName)) {
1462-       CI->DefaultMethod  = std::string ( SI->getValue ());
1463+       CI->DefaultMethod  = SI->getValue (). str ( );
14631464    } else  {
14641465      assert (isa<UnsetInit>(DMName) && " Unexpected DefaultMethod field!"  );
14651466      CI->DefaultMethod  = " default"   + CI->ClassName  + " Operands"  ;
@@ -3052,7 +3053,7 @@ static void emitAsmTiedOperandConstraints(CodeGenTarget &Target,
30523053                                          AsmMatcherInfo &Info, raw_ostream &OS,
30533054                                          bool  HasOptionalOperands) {
30543055  std::string AsmParserName =
3055-       std::string ( Info.AsmParser ->getValueAsString (" AsmParserClassName"  ));
3056+       Info.AsmParser ->getValueAsString (" AsmParserClassName"  ). str ( );
30563057  OS << " static bool "  ;
30573058  OS << " checkAsmTiedOperandConstraints(const "   << Target.getName ()
30583059     << AsmParserName << " &AsmParser,\n "  ;
0 commit comments