Goto statements with a bad label produces error message.

Now it also produces a short list of suggestions based on string distance.
This commit is contained in:
Nipunn Koorapati
2012-04-20 14:42:14 -04:00
parent db8b08131f
commit 040421942f
5 changed files with 51 additions and 3 deletions

13
ctx.cpp
View File

@@ -1155,6 +1155,19 @@ FunctionEmitContext::GetLabeledBasicBlock(const std::string &label) {
return NULL;
}
std::vector<std::string>
FunctionEmitContext::GetLabels() {
// Initialize vector to the right size
std::vector<std::string> labels(labelMap.size());
// Iterate through labelMap and grab only the keys
std::map<std::string, llvm::BasicBlock*>::iterator iter;
for (iter=labelMap.begin(); iter != labelMap.end(); iter++)
labels.push_back(iter->first);
return labels;
}
void
FunctionEmitContext::CurrentLanesReturned(Expr *expr, bool doCoherenceCheck) {