tensorflow/compiler/mlir/tensorflow/utils/compile_mlir_util.cc
Status ParseMlirModule(llvm::StringRef mlir_module_string,
                       mlir::MLIRContext* mlir_context,
                       mlir::OwningModuleRef* mlir_module) {
  TF_RET_CHECK(!mlir_module_string.empty())
      << "unexpected empty serialized MLIR module string";
  TF_RET_CHECK(mlir_module) << "unexpected null MLIR module pointer";

  // Make sure we catch any error reported by MLIR and forward it to the TF
  // error reporting system.
  mlir::StatusScopedDiagnosticHandler error_handler(mlir_context);

  // Parse the module.
  *mlir_module = mlir::parseSourceString(mlir_module_string, mlir_context);
  if (!*mlir_module) {
    return error_handler.Combine(
        errors::InvalidArgument("could not parse MLIR module"));
  }

  return Status::OK();
}
// Parses the MLIR module from the mlir_module_string.
Parses the MLIR module from the mlir_module_string.
Parses the MLIR module from the mlir_module_string .
Status ParseMlirModule(llvm::StringRef mlir_module_string,
                       mlir::MLIRContext* mlir_context,
                       mlir::OwningModuleRef* mlir_module) {
  TF_RET_CHECK(!mlir_module_string.empty())
      << "unexpected empty serialized MLIR module string";
  TF_RET_CHECK(mlir_module) << "unexpected null MLIR module pointer";
  mlir::StatusScopedDiagnosticHandler error_handler(mlir_context);
  *mlir_module = mlir::parseSourceString(mlir_module_string, mlir_context);
  if (!*mlir_module) {
    return error_handler.Combine(
        errors::InvalidArgument("could not parse MLIR module"));
  }
  return Status::OK();
}
Status ParseMlirModule ( llvm :: StringRef mlir_module_string , mlir :: MLIRContext * mlir_context , mlir :: OwningModuleRef * mlir_module ) { TF_RET_CHECK ( ! mlir_module_string . empty ( ) ) << " " ; TF_RET_CHECK ( mlir_module ) << " " ; mlir :: StatusScopedDiagnosticHandler error_handler ( mlir_context ) ; * mlir_module = mlir :: parseSourceString ( mlir_module_string , mlir_context ) ; if ( ! * mlir_module ) { return error_handler . Combine ( errors :: InvalidArgument ( " " ) ) ; } return Status :: OK ( ) ; }
Parses the MLIR module from the mlir_module_string.
Parses the MLIR module from the mlir_module_string .
// Make sure we catch any error reported by MLIR and forward it to the TF // error reporting system. // Parse the module.