summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Parser/Token.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Adjust License.txt file to use the LLVM licenseMehdi Amini2019-12-231-13/+4
| | | | PiperOrigin-RevId: 286906740
* Add support for parsing/printing non bare-identifier SymbolRefs.River Riddle2019-10-081-4/+7
| | | | | | The restriction that symbols can only have identifier names is arbitrary, and artificially limits the names that a symbol may have. This change adds support for parsing and printing symbols that don't fit in the 'bare-identifier' grammar by printing the reference in quotes, e.g. @"0_my_reference" can now be used as a symbol name. PiperOrigin-RevId: 273644768
* Fix an invalid assert when processing escaped strings.River Riddle2019-09-031-1/+1
| | | | | | | | The assert assumed that the escaped character could not appear at the end of the string. Fixes tensorflow/mlir#117 PiperOrigin-RevId: 266975471
* Update style/clang-format (NFC).Jacques Pienaar2019-07-221-14/+20
| | | | | | Update to be consistent & so that future save + clang-format workflows don't introduce extra changes. PiperOrigin-RevId: 259361174
* Avoid hardcoded 4096 constantNicolas Vasilache2019-03-291-3/+1
| | | | | | | | | | | This commit creates a static constexpr limit for the IntegerType bitwidth and uses it. The check had to be moved because Token is not aware of IR/Type and it was a sign the abstraction leaked: bitwidth limit is not a property of the Token but of the IntegerType. Added a positive and a negative test at the limit. PiperOrigin-RevId: 210388192
* [mlir] Fix tests after Chris implemented string escaping in MLIRJames Molloy2019-03-291-1/+1
| | | | | | We don't need to C-escape any more, so don't. Also, change the expected escaping syntax to be the slightly noisier version that LLVM emits. PiperOrigin-RevId: 208989483
* Escape and unescape strings in the parser and printer so they can roundtrip,Chris Lattner2019-03-291-3/+40
| | | | | | | | | | | print floating point in a structured form that we know can round trip, enumerate attributes in the visitor so we print affine mapping attributes symbolically (the majority of the testcase updates). We still have an issue where the hexadecimal floating point syntax is reparsed as an integer, but that can evolve in subsequent patches. PiperOrigin-RevId: 208828876
* [mlir] Allow C-style escapes in LexerJames Molloy2019-03-291-3/+2
| | | | | | This patch passes the raw, unescaped value through to the rest of the stack. Partial escaping is a total pain to deal with, so we either need to implement escaping properly (ideally using a third party library like absl, I don't think LLVM has one that can handle the proper gamut of escape codes) or don't escape. I chose the latter for this patch. PiperOrigin-RevId: 208608945
* Add parsing for floating point attributes.Jacques Pienaar2019-03-291-1/+8
| | | | | | This is doing it in a suboptimal manner by recombining [integer period literal] into a string literal and parsing that via to_float. PiperOrigin-RevId: 206855106
* Add support for multiple results to the printer/parser, add supportChris Lattner2019-03-291-1/+10
| | | | | | | for forward references to the parser, add initial support for SSA use-list iteration and RAUW. PiperOrigin-RevId: 205484031
* Change to assert(0,x) to llvm_unreachable(x)Jacques Pienaar2019-03-291-1/+1
| | | | | | | This avoids fall-through error in opt mode: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough] PiperOrigin-RevId: 203616256
* Add parsing for attributes and attibutes on operations. Add IR representationChris Lattner2019-03-291-4/+25
| | | | | | | for attributes on operations. Split Operation out from OperationInst so it can be shared with OperationStmt one day. PiperOrigin-RevId: 203325366
* Enhance the type system to support arbitrary precision integers, which areChris Lattner2019-03-291-0/+12
| | | | | | | | | important for low-bitwidth inference cases and hardware synthesis targets. Rename 'int' to 'affineint' to avoid confusion between "the integers" and "the int type". PiperOrigin-RevId: 202751508
* [WIP] Sketching IR and parsing support for affine maps, affine expressionsUday Bondhugula2019-03-291-0/+1
| | | | | | | | | | | Run test case: $ mlir-opt test/IR/parser-affine-map.mlir test/IR/parser-affine-map.mlir:3:30: error: expect '(' at start of map range #hello_world2 (i, j) [s0] -> i+s0, j) ^ PiperOrigin-RevId: 202736856
* Refactor information about tokens out into a new TokenKinds.def file. Use thisChris Lattner2019-03-291-0/+13
| | | | | | | | to share code a bit more, and fixes a diagnostic bug Uday pointed out where parseCommaSeparatedList would print the wrong diagnostic when the end signifier was not a ). PiperOrigin-RevId: 202676858
* Sketch out parser/IR support for OperationInst, and a new Instruction baseChris Lattner2019-03-291-1/+10
| | | | | | | | | | class. Introduce an Identifier class to MLIRContext to represent uniqued identifiers, introduce string literal support to the lexer, introducing parser and printer support etc. PiperOrigin-RevId: 202592007
* Implement parser and lexer support for most of the type grammar.Chris Lattner2019-03-291-0/+12
| | | | | | | | Semi-affine maps and address spaces are not yet supported (someone want to take this on?). We also don't generate IR objects for types yet, which I plan to tackle next. PiperOrigin-RevId: 201754283
* Implement enough of a lexer and parser for MLIR to parse extfunc's withoutChris Lattner2019-03-291-0/+37
arguments. PiperOrigin-RevId: 201706570
OpenPOWER on IntegriCloud