Add location specifier to MLIR Functions, and:
- Compress the identifier/kind of a Function into a single word.
- Eliminate otherFailure from verifier now that we always have a location
- Eliminate the error string from the verifier now that we always have
locations.
- Simplify the parser's handling of fn forward references, using the location
tracked by the function.
PiperOrigin-RevId: 211985101
diff --git a/lib/Transforms/ConvertToCFG.cpp b/lib/Transforms/ConvertToCFG.cpp
index 2f50713..97529ec 100644
--- a/lib/Transforms/ConvertToCFG.cpp
+++ b/lib/Transforms/ConvertToCFG.cpp
@@ -109,8 +109,8 @@
// Creates CFG function equivalent to the given ML function.
CFGFunction *ModuleConverter::convert(const MLFunction *mlFunc) {
// TODO: ensure that CFG function name is unique.
- auto *cfgFunc =
- new CFGFunction(mlFunc->getName().str() + "_cfg", mlFunc->getType());
+ auto *cfgFunc = new CFGFunction(
+ mlFunc->getLoc(), mlFunc->getName().str() + "_cfg", mlFunc->getType());
module->getFunctions().push_back(cfgFunc);
// Generates the body of the CFG function.