summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Translation/Translation.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Adjust License.txt file to use the LLVM licenseMehdi Amini2019-12-231-13/+4
| | | | PiperOrigin-RevId: 286906740
* mlir-translate: support -verify-diagnosticsAlex Zinenko2019-11-071-6/+27
| | | | | | | | | | | MLIR translation tools can emit diagnostics and we want to be able to check if it is indeed the case in tests. Reuse the source manager error handlers provided for mlir-opt to support the verification in mlir-translate. This requires us to change the signature of the functions that are registered to translate sources to MLIR: it now takes a source manager instead of a memory buffer. PiperOrigin-RevId: 279132972
* Support file-to-file translation in mlir-translateLei Zhang2019-09-171-0/+22
| | | | | | | | | | | | | Existing translations are either from MLIR or to MLIR. To support cases like round-tripping some external format via MLIR, one must chain two mlir-translate invocations together using pipes. This can be problematic to support -split-input-file in mlir-translate given that it won't work across pipes. Motivated by the above, this CL adds another translation category that allows file to file. This gives users more freedom. PiperOrigin-RevId: 269636438
* Include missing header.Jacques Pienaar2019-07-081-0/+2
| | | | | | This target was failing to build with newer version of libc++. PiperOrigin-RevId: 256979592
* Fix a typo in error message.MLIR Team2019-06-091-1/+2
| | | | PiperOrigin-RevId: 251681475
* Remove unnecessary C++ specifier in CPP files. NFC.Jacques Pienaar2019-05-201-1/+1
| | | | | | | | These are only required in .h files to disambiguate between C and C++ header files. -- PiperOrigin-RevId: 248219135
* Separate translators into "from MLIR" and "to MLIR".Alex Zinenko2019-03-291-14/+40
| | | | | | | | | | | | | | | | | | | | Translations performed by mlir-translate only have MLIR on one end. MLIR-to-MLIR conversions (including dialect changes) should be treated as passes and run by mlir-opt. Individual translations should not care about reading or writing MLIR and should work on in-memory representation of MLIR modules instead. Split the TranslateFunction interface and the translate registry into two parts: "from MLIR" and "to MLIR". Update mlir-translate to handle both registries together by wrapping translation functions into source-to-source convresions. Remove MLIR parsing and writing from individual translations and make them operate on Modules instead. This removes the need for individual translators to include tools/mlir-translate/mlir-translate.h, which can now be safely removed. Remove mlir-to-mlir translation that only existed as a registration example and use mlir-opt instead for tests. PiperOrigin-RevId: 222398707
* Factor out translation registry.Alex Zinenko2019-03-291-0/+48
The mlir-translate tool is expected to discover individual translations at link time. These translations must register themselves and may need the utilities that are currently defined in mlir-translate.cpp for their entry point functions. Since mlir-translate is linking against individual translations, the translations cannot link against mlir-translate themselves. Extract out the utilities into a separate "Translation" library to avoid the potential dependency cycle. Individual translations link to that library to access TranslateRegistration. The mlir-translate tool links to individual translations and to the "Translation" library because it needs the utilities as well. The main header of the new library is located in include/mlir/Translation.h to make it easily accessible by translators. The rationale for putting it to include/mlir rather than to one of its subdirectories is that its purpose is similar to that of include/mlir/Pass.h so it makes sense to put them at the same level. PiperOrigin-RevId: 222398617
OpenPOWER on IntegriCloud