[llvm] r247528 - [TableGen] Simplify some code by using StringRef::find instead of std::find. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 13 11:01:20 PDT 2015
Author: ctopper
Date: Sun Sep 13 13:01:20 2015
New Revision: 247528
URL: http://llvm.org/viewvc/llvm-project?rev=247528&view=rev
Log:
[TableGen] Simplify some code by using StringRef::find instead of std::find. NFC
Modified:
llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
Modified: llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp?rev=247528&r1=247527&r2=247528&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp Sun Sep 13 13:01:20 2015
@@ -891,9 +891,9 @@ void MatchableInfo::tokenizeAsmString(co
}
// If this is "${" find the next "}" and make an identifier like "${xxx}"
- StringRef::iterator End = std::find(String.begin() + i, String.end(),'}');
- assert(End != String.end() && "Missing brace in operand reference!");
- size_t EndPos = End - String.begin();
+ size_t EndPos = String.find('}', i);
+ assert(EndPos != StringRef::npos &&
+ "Missing brace in operand reference!");
addAsmOperand(i, EndPos+1);
Prev = EndPos + 1;
i = EndPos;
More information about the llvm-commits
mailing list