Throw 'const char*' instead of 'std::string'.

llvm-svn: 90784
This commit is contained in:
Mikhail Glushenkov 2009-12-07 19:15:57 +00:00
parent 77b0d3b217
commit fca845187d
1 changed files with 10 additions and 11 deletions

View File

@ -796,8 +796,7 @@ private:
Init* Case = d->getArg(0); Init* Case = d->getArg(0);
if (typeid(*Case) != typeid(DagInit) || if (typeid(*Case) != typeid(DagInit) ||
GetOperatorName(static_cast<DagInit*>(Case)) != "case") GetOperatorName(static_cast<DagInit*>(Case)) != "case")
throw throw "The argument to (actions) should be a 'case' construct!";
std::string("The argument to (actions) should be a 'case' construct!");
toolDesc_.Actions = Case; toolDesc_.Actions = Case;
} }
@ -898,8 +897,8 @@ int CalculatePriority(RecordVector::const_iterator B,
priority = static_cast<int>((*B)->getValueAsInt("priority")); priority = static_cast<int>((*B)->getValueAsInt("priority"));
if (++B != E) if (++B != E)
throw std::string("More than one 'PluginPriority' instance found: " throw "More than one 'PluginPriority' instance found: "
"most probably an error!"); "most probably an error!";
} }
return priority; return priority;
@ -990,7 +989,7 @@ void TypecheckGraph (const RecordVector& EdgeVector,
} }
if (NodeB == "root") if (NodeB == "root")
throw std::string("Edges back to the root are not allowed!"); throw "Edges back to the root are not allowed!";
} }
} }
@ -1010,7 +1009,7 @@ void WalkCase(const Init* Case, F1 TestCallback, F2 StatementCallback,
// Error checks. // Error checks.
if (GetOperatorName(d) != "case") if (GetOperatorName(d) != "case")
throw std::string("WalkCase should be invoked only on 'case' expressions!"); throw "WalkCase should be invoked only on 'case' expressions!";
if (d.getNumArgs() < 2) if (d.getNumArgs() < 2)
throw "There should be at least one clause in the 'case' expression:\n" throw "There should be at least one clause in the 'case' expression:\n"
@ -1030,8 +1029,8 @@ void WalkCase(const Init* Case, F1 TestCallback, F2 StatementCallback,
const DagInit& Test = InitPtrToDag(arg); const DagInit& Test = InitPtrToDag(arg);
if (GetOperatorName(Test) == "default" && (i+1 != numArgs)) if (GetOperatorName(Test) == "default" && (i+1 != numArgs))
throw std::string("The 'default' clause should be the last in the" throw "The 'default' clause should be the last in the "
"'case' construct!"); "'case' construct!";
if (i == numArgs) if (i == numArgs)
throw "Case construct handler: no corresponding action " throw "Case construct handler: no corresponding action "
"found for the test " + Test.getAsString() + '!'; "found for the test " + Test.getAsString() + '!';
@ -1551,7 +1550,7 @@ StrVector::const_iterator SubstituteSpecialCommands
const std::string& CmdName = *Pos; const std::string& CmdName = *Pos;
if (CmdName == ")") if (CmdName == ")")
throw std::string("$CALL invocation: empty argument list!"); throw "$CALL invocation: empty argument list!";
O << "hooks::"; O << "hooks::";
O << CmdName << "("; O << CmdName << "(";
@ -1746,7 +1745,7 @@ void EmitForwardOptionPropertyHandlingCode (const OptionDescription& D,
break; break;
case OptionType::Alias: case OptionType::Alias:
default: default:
throw std::string("Aliases are not allowed in tool option descriptions!"); throw "Aliases are not allowed in tool option descriptions!";
} }
} }
@ -2330,7 +2329,7 @@ void EmitPopulateLanguageMap (const RecordKeeper& Records, raw_ostream& O)
ListInit* LangsToSuffixesList = LangMapRecord->getValueAsListInit("map"); ListInit* LangsToSuffixesList = LangMapRecord->getValueAsListInit("map");
if (!LangsToSuffixesList) if (!LangsToSuffixesList)
throw std::string("Error in the language map definition!"); throw "Error in the language map definition!";
for (unsigned i = 0; i < LangsToSuffixesList->size(); ++i) { for (unsigned i = 0; i < LangsToSuffixesList->size(); ++i) {
const Record* LangToSuffixes = LangsToSuffixesList->getElementAsRecord(i); const Record* LangToSuffixes = LangsToSuffixesList->getElementAsRecord(i);