@@ -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 = " " ;
@@ -1353,11 +1353,11 @@ void AsmMatcherInfo::buildRegisterClasses(
13531353
13541354 const Init *DiagnosticType = Def->getValueInit (" DiagnosticType" );
13551355 if (const StringInit *SI = dyn_cast<StringInit>(DiagnosticType))
1356- CI->DiagnosticType = std::string ( SI->getValue ());
1356+ CI->DiagnosticType = SI->getValue (). str ( );
13571357
13581358 const Init *DiagnosticString = Def->getValueInit (" DiagnosticString" );
13591359 if (const StringInit *SI = dyn_cast<StringInit>(DiagnosticString))
1360- CI->DiagnosticString = std::string ( SI->getValue ());
1360+ CI->DiagnosticString = SI->getValue (). str ( );
13611361
13621362 // If we have a diagnostic string but the diagnostic type is not specified
13631363 // explicitly, create an anonymous diagnostic type.
@@ -1377,9 +1377,9 @@ void AsmMatcherInfo::buildRegisterClasses(
13771377 assert (CI && " Missing singleton register class info!" );
13781378
13791379 if (CI->ValueName .empty ()) {
1380- CI->ClassName = std::string ( Rec->getName ());
1380+ CI->ClassName = Rec->getName (). str ( );
13811381 CI->Name = " MCK_" + Rec->getName ().str ();
1382- CI->ValueName = std::string ( Rec->getName ());
1382+ CI->ValueName = Rec->getName (). str ( );
13831383 } else {
13841384 CI->ValueName = CI->ValueName + " ," + Rec->getName ().str ();
13851385 }
@@ -1415,14 +1415,14 @@ void AsmMatcherInfo::buildOperandClasses() {
14151415 else
14161416 CI->SuperClasses .push_back (SC);
14171417 }
1418- CI->ClassName = std::string ( Rec->getValueAsString (" Name" ));
1418+ CI->ClassName = Rec->getValueAsString (" Name" ). str ( );
14191419 CI->Name = " MCK_" + CI->ClassName ;
1420- CI->ValueName = std::string ( Rec->getName ());
1420+ CI->ValueName = Rec->getName (). str ( );
14211421
14221422 // Get or construct the predicate method name.
14231423 const Init *PMName = Rec->getValueInit (" PredicateMethod" );
14241424 if (const StringInit *SI = dyn_cast<StringInit>(PMName)) {
1425- CI->PredicateMethod = std::string ( SI->getValue ());
1425+ CI->PredicateMethod = SI->getValue (). str ( );
14261426 } else {
14271427 assert (isa<UnsetInit>(PMName) && " Unexpected PredicateMethod field!" );
14281428 CI->PredicateMethod = " is" + CI->ClassName ;
@@ -1431,7 +1431,7 @@ void AsmMatcherInfo::buildOperandClasses() {
14311431 // Get or construct the render method name.
14321432 const Init *RMName = Rec->getValueInit (" RenderMethod" );
14331433 if (const StringInit *SI = dyn_cast<StringInit>(RMName)) {
1434- CI->RenderMethod = std::string ( SI->getValue ());
1434+ CI->RenderMethod = SI->getValue (). str ( );
14351435 } else {
14361436 assert (isa<UnsetInit>(RMName) && " Unexpected RenderMethod field!" );
14371437 CI->RenderMethod = " add" + CI->ClassName + " Operands" ;
@@ -1440,15 +1440,15 @@ void AsmMatcherInfo::buildOperandClasses() {
14401440 // Get the parse method name or leave it as empty.
14411441 const Init *PRMName = Rec->getValueInit (" ParserMethod" );
14421442 if (const StringInit *SI = dyn_cast<StringInit>(PRMName))
1443- CI->ParserMethod = std::string ( SI->getValue ());
1443+ CI->ParserMethod = SI->getValue (). str ( );
14441444
14451445 // Get the diagnostic type and string or leave them as empty.
14461446 const Init *DiagnosticType = Rec->getValueInit (" DiagnosticType" );
14471447 if (const StringInit *SI = dyn_cast<StringInit>(DiagnosticType))
1448- CI->DiagnosticType = std::string ( SI->getValue ());
1448+ CI->DiagnosticType = SI->getValue (). str ( );
14491449 const Init *DiagnosticString = Rec->getValueInit (" DiagnosticString" );
14501450 if (const StringInit *SI = dyn_cast<StringInit>(DiagnosticString))
1451- CI->DiagnosticString = std::string ( SI->getValue ());
1451+ CI->DiagnosticString = SI->getValue (). str ( );
14521452 // If we have a DiagnosticString, we need a DiagnosticType for use within
14531453 // the matcher.
14541454 if (!CI->DiagnosticString .empty () && CI->DiagnosticType .empty ())
@@ -1461,7 +1461,7 @@ void AsmMatcherInfo::buildOperandClasses() {
14611461 // Get or construct the default method name.
14621462 const Init *DMName = Rec->getValueInit (" DefaultMethod" );
14631463 if (const StringInit *SI = dyn_cast<StringInit>(DMName)) {
1464- CI->DefaultMethod = std::string ( SI->getValue ());
1464+ CI->DefaultMethod = SI->getValue (). str ( );
14651465 } else {
14661466 assert (isa<UnsetInit>(DMName) && " Unexpected DefaultMethod field!" );
14671467 CI->DefaultMethod = " default" + CI->ClassName + " Operands" ;
@@ -3057,7 +3057,7 @@ static void emitAsmTiedOperandConstraints(CodeGenTarget &Target,
30573057 AsmMatcherInfo &Info, raw_ostream &OS,
30583058 bool HasOptionalOperands) {
30593059 std::string AsmParserName =
3060- std::string ( Info.AsmParser ->getValueAsString (" AsmParserClassName" ));
3060+ Info.AsmParser ->getValueAsString (" AsmParserClassName" ). str ( );
30613061 OS << " static bool " ;
30623062 OS << " checkAsmTiedOperandConstraints(const " << Target.getName ()
30633063 << AsmParserName << " &AsmParser,\n " ;
0 commit comments