summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2009-04-19 00:22:35 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2009-04-19 00:22:35 +0000
commitc48ede23bd15677de01531726dd762fda8feb7cc (patch)
tree985224d7cc53ccb052dc574fdb9aefc7c7b49fd4 /llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp
parentc1b96c3590c914a96dfde4be32113bbe7f88890c (diff)
downloadbcm5719-llvm-c48ede23bd15677de01531726dd762fda8feb7cc.tar.gz
bcm5719-llvm-c48ede23bd15677de01531726dd762fda8feb7cc.zip
Add some assertions.
Fixes segfaults in some corner cases. llvm-svn: 69494
Diffstat (limited to 'llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp')
-rw-r--r--llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp b/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp
index bb4321c9b40..834fb9c14ab 100644
--- a/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp
+++ b/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp
@@ -1284,6 +1284,7 @@ void EmitCmdLineVecFill(const Init* CmdLine, const std::string& ToolName,
StrVector::const_iterator I = StrVec.begin(), E = StrVec.end();
// If there is a hook invocation on the place of the first command, skip it.
+ assert(!StrVec[0].empty());
if (StrVec[0][0] == '$') {
while (I != E && (*I)[0] != ')' )
++I;
@@ -1297,7 +1298,7 @@ void EmitCmdLineVecFill(const Init* CmdLine, const std::string& ToolName,
for (; I != E; ++I) {
const std::string& cmd = *I;
- // std::cerr << cmd;
+ assert(!cmd.empty());
O << IndentLevel;
if (cmd.at(0) == '$') {
if (cmd == "$INFILE") {
OpenPOWER on IntegriCloud