s/TokenizeCmdline/TokenizeCmdLine/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91592 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Mikhail Glushenkov 2009-12-17 07:48:34 +00:00
parent b5d3daba91
commit 2d366a21a1

View File

@ -26,6 +26,7 @@
using namespace llvm; using namespace llvm;
namespace {
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Typedefs /// Typedefs
@ -37,18 +38,16 @@ typedef std::vector<std::string> StrVector;
/// Constants /// Constants
// Indentation. // Indentation.
static const unsigned TabWidth = 4; const unsigned TabWidth = 4;
static const unsigned Indent1 = TabWidth*1; const unsigned Indent1 = TabWidth*1;
static const unsigned Indent2 = TabWidth*2; const unsigned Indent2 = TabWidth*2;
static const unsigned Indent3 = TabWidth*3; const unsigned Indent3 = TabWidth*3;
// Default help string. // Default help string.
static const char * const DefaultHelpString = "NO HELP MESSAGE PROVIDED"; const char * const DefaultHelpString = "NO HELP MESSAGE PROVIDED";
// Name for the "sink" option. // Name for the "sink" option.
static const char * const SinkOptionName = "AutoGeneratedSinkOption"; const char * const SinkOptionName = "AutoGeneratedSinkOption";
namespace {
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Helper functions /// Helper functions
@ -1452,10 +1451,10 @@ void EmitCaseConstructHandler(const Init* Case, unsigned IndentLevel,
EmitCaseStatementCallback<F>(Callback, O), IndentLevel); EmitCaseStatementCallback<F>(Callback, O), IndentLevel);
} }
/// TokenizeCmdline - converts from /// TokenizeCmdLine - converts from
/// "$CALL(HookName, 'Arg1', 'Arg2')/path -arg1 -arg2" to /// "$CALL(HookName, 'Arg1', 'Arg2')/path -arg1 -arg2" to
/// ["$CALL(", "HookName", "Arg1", "Arg2", ")/path", "-arg1", "-arg2"]. /// ["$CALL(", "HookName", "Arg1", "Arg2", ")/path", "-arg1", "-arg2"].
void TokenizeCmdline(const std::string& CmdLine, StrVector& Out) { void TokenizeCmdLine(const std::string& CmdLine, StrVector& Out) {
const char* Delimiters = " \t\n\v\f\r"; const char* Delimiters = " \t\n\v\f\r";
enum TokenizerState enum TokenizerState
{ Normal, SpecialCommand, InsideSpecialCommand, InsideQuotationMarks } { Normal, SpecialCommand, InsideSpecialCommand, InsideQuotationMarks }
@ -1642,7 +1641,7 @@ void EmitCmdLineVecFill(const Init* CmdLine, const std::string& ToolName,
bool IsJoin, unsigned IndentLevel, bool IsJoin, unsigned IndentLevel,
raw_ostream& O) { raw_ostream& O) {
StrVector StrVec; StrVector StrVec;
TokenizeCmdline(InitPtrToString(CmdLine), StrVec); TokenizeCmdLine(InitPtrToString(CmdLine), StrVec);
if (StrVec.empty()) if (StrVec.empty())
throw "Tool '" + ToolName + "' has empty command line!"; throw "Tool '" + ToolName + "' has empty command line!";
@ -1828,7 +1827,7 @@ class EmitActionHandlersCallback
unsigned IndentLevel, raw_ostream& O) const unsigned IndentLevel, raw_ostream& O) const
{ {
StrVector Out; StrVector Out;
TokenizeCmdline(Str, Out); TokenizeCmdLine(Str, Out);
for (StrVector::const_iterator B = Out.begin(), E = Out.end(); for (StrVector::const_iterator B = Out.begin(), E = Out.end();
B != E; ++B) { B != E; ++B) {
@ -1962,7 +1961,7 @@ class EmitActionHandlersCallback
bool IsOutFileIndexCheckRequiredStr (const Init* CmdLine) { bool IsOutFileIndexCheckRequiredStr (const Init* CmdLine) {
StrVector StrVec; StrVector StrVec;
TokenizeCmdline(InitPtrToString(CmdLine), StrVec); TokenizeCmdLine(InitPtrToString(CmdLine), StrVec);
for (StrVector::const_iterator I = StrVec.begin(), E = StrVec.end(); for (StrVector::const_iterator I = StrVec.begin(), E = StrVec.end();
I != E; ++I) { I != E; ++I) {
@ -2556,7 +2555,7 @@ public:
void onCmdLine(const std::string& Cmd) { void onCmdLine(const std::string& Cmd) {
StrVector cmds; StrVector cmds;
TokenizeCmdline(Cmd, cmds); TokenizeCmdLine(Cmd, cmds);
for (StrVector::const_iterator B = cmds.begin(), E = cmds.end(); for (StrVector::const_iterator B = cmds.begin(), E = cmds.end();
B != E; ++B) { B != E; ++B) {