diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-01-11 18:03:24 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-01-11 18:03:24 +0000 |
commit | c6fe3c3273f46fff995c344e728aea761ec13d4a (patch) | |
tree | b497ad63f40b50e7cc6d2e1728db90050533d343 /llvm/utils/TableGen/CodeGenInstruction.cpp | |
parent | e99a3c191e28c66dc00677d02b3090481865a6e9 (diff) | |
download | bcm5719-llvm-c6fe3c3273f46fff995c344e728aea761ec13d4a.tar.gz bcm5719-llvm-c6fe3c3273f46fff995c344e728aea761ec13d4a.zip |
Reimplement getToken and SplitString as "StringRef helper functions"
- getToken is modeled after StringRef::split but it can split on multiple
separator chars and skips leading seperators.
- SplitString is a StringRef::split variant for more than 2 elements with the
same behaviour as getToken.
llvm-svn: 93161
Diffstat (limited to 'llvm/utils/TableGen/CodeGenInstruction.cpp')
-rw-r--r-- | llvm/utils/TableGen/CodeGenInstruction.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/CodeGenInstruction.cpp b/llvm/utils/TableGen/CodeGenInstruction.cpp index c69ce962ffc..684431a6f49 100644 --- a/llvm/utils/TableGen/CodeGenInstruction.cpp +++ b/llvm/utils/TableGen/CodeGenInstruction.cpp @@ -14,6 +14,7 @@ #include "CodeGenInstruction.h" #include "Record.h" #include "llvm/ADT/StringExtras.h" +#include "llvm/ADT/STLExtras.h" #include <set> using namespace llvm; @@ -224,7 +225,8 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr) // Parse the DisableEncoding field. std::string DisableEncoding = R->getValueAsString("DisableEncoding"); while (1) { - std::string OpName = getToken(DisableEncoding, " ,\t"); + std::string OpName; + tie(OpName, DisableEncoding) = getToken(DisableEncoding, " ,\t"); if (OpName.empty()) break; // Figure out which operand this is. |