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 | d4f195999a7774611e5f9e457a86f14d5e257324 (patch) | |
tree | b42b9fcb6b31623ba37362aee09417547ca4e244 /tools | |
parent | e5dacc55ad0122eb4b8913955cf6339fa3ff2d6e (diff) | |
download | external_llvm-d4f195999a7774611e5f9e457a86f14d5e257324.zip external_llvm-d4f195999a7774611e5f9e457a86f14d5e257324.tar.gz external_llvm-d4f195999a7774611e5f9e457a86f14d5e257324.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93161 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/lto/LTOCodeGenerator.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp index 060fc4f..93eb0a5 100644 --- a/tools/lto/LTOCodeGenerator.cpp +++ b/tools/lto/LTOCodeGenerator.cpp @@ -443,12 +443,12 @@ bool LTOCodeGenerator::generateAssemblyCode(formatted_raw_ostream& out, /// Optimize merged modules using various IPO passes void LTOCodeGenerator::setCodeGenDebugOptions(const char* options) { - std::string ops(options); - for (std::string o = getToken(ops); !o.empty(); o = getToken(ops)) { + for (std::pair<StringRef, StringRef> o = getToken(options); + !o.first.empty(); o = getToken(o.second)) { // ParseCommandLineOptions() expects argv[0] to be program name. // Lazily add that. if ( _codegenOptions.empty() ) _codegenOptions.push_back("libLTO"); - _codegenOptions.push_back(strdup(o.c_str())); + _codegenOptions.push_back(strdup(o.first.str().c_str())); } } |