2018-09-18 08:39:38 +08:00
|
|
|
//===- mlir-translate.cpp - MLIR Translate Driver -------------------------===//
|
|
|
|
//
|
2020-01-26 11:58:30 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
2019-12-24 01:35:36 +08:00
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2018-09-18 08:39:38 +08:00
|
|
|
//
|
2019-12-24 01:35:36 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2018-09-18 08:39:38 +08:00
|
|
|
//
|
|
|
|
// This is a command line utility that translates a file from/to MLIR using one
|
|
|
|
// of the registered translations.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
[mlir] Remove need for static global ctors from mlir-translate
Summary: https://bugs.llvm.org/show_bug.cgi?id=45436
Reviewers: mehdi_amini, mravishankar, antiagainst, rriddle, stephenneuendorffer
Reviewed By: mehdi_amini, rriddle, stephenneuendorffer
Subscribers: frgossen, stephenneuendorffer, jholewinski, mgorny, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, bader, grosul1, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77515
2020-04-06 04:42:16 +08:00
|
|
|
#include "mlir/InitAllTranslations.h"
|
2020-09-04 16:39:30 +08:00
|
|
|
#include "mlir/Support/LogicalResult.h"
|
2020-04-06 07:21:07 +08:00
|
|
|
#include "mlir/Translation.h"
|
2018-09-18 08:39:38 +08:00
|
|
|
|
|
|
|
using namespace mlir;
|
|
|
|
|
[mlir] Remove need for static global ctors from mlir-translate
Summary: https://bugs.llvm.org/show_bug.cgi?id=45436
Reviewers: mehdi_amini, mravishankar, antiagainst, rriddle, stephenneuendorffer
Reviewed By: mehdi_amini, rriddle, stephenneuendorffer
Subscribers: frgossen, stephenneuendorffer, jholewinski, mgorny, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, bader, grosul1, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77515
2020-04-06 04:42:16 +08:00
|
|
|
namespace mlir {
|
|
|
|
// Defined in the test directory, no public header.
|
|
|
|
void registerTestRoundtripSPIRV();
|
2020-05-01 17:51:22 +08:00
|
|
|
void registerTestRoundtripDebugSPIRV();
|
[mlir] Remove need for static global ctors from mlir-translate
Summary: https://bugs.llvm.org/show_bug.cgi?id=45436
Reviewers: mehdi_amini, mravishankar, antiagainst, rriddle, stephenneuendorffer
Reviewed By: mehdi_amini, rriddle, stephenneuendorffer
Subscribers: frgossen, stephenneuendorffer, jholewinski, mgorny, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, bader, grosul1, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77515
2020-04-06 04:42:16 +08:00
|
|
|
} // namespace mlir
|
|
|
|
|
2020-05-01 17:51:22 +08:00
|
|
|
static void registerTestTranslations() {
|
|
|
|
registerTestRoundtripSPIRV();
|
|
|
|
registerTestRoundtripDebugSPIRV();
|
|
|
|
}
|
[mlir] Remove need for static global ctors from mlir-translate
Summary: https://bugs.llvm.org/show_bug.cgi?id=45436
Reviewers: mehdi_amini, mravishankar, antiagainst, rriddle, stephenneuendorffer
Reviewed By: mehdi_amini, rriddle, stephenneuendorffer
Subscribers: frgossen, stephenneuendorffer, jholewinski, mgorny, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, bader, grosul1, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77515
2020-04-06 04:42:16 +08:00
|
|
|
|
2018-09-18 08:39:38 +08:00
|
|
|
int main(int argc, char **argv) {
|
[mlir] Remove need for static global ctors from mlir-translate
Summary: https://bugs.llvm.org/show_bug.cgi?id=45436
Reviewers: mehdi_amini, mravishankar, antiagainst, rriddle, stephenneuendorffer
Reviewed By: mehdi_amini, rriddle, stephenneuendorffer
Subscribers: frgossen, stephenneuendorffer, jholewinski, mgorny, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, bader, grosul1, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D77515
2020-04-06 04:42:16 +08:00
|
|
|
registerAllTranslations();
|
|
|
|
registerTestTranslations();
|
2020-08-23 08:57:39 +08:00
|
|
|
return failed(mlirTranslateMain(argc, argv, "MLIR Translation Testing Tool"));
|
2018-09-18 08:39:38 +08:00
|
|
|
}
|