summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Parser/Lexer.h
Commit message (Collapse)AuthorAgeFilesLines
* Adjust License.txt file to use the LLVM licenseMehdi Amini2019-12-231-13/+4
| | | | PiperOrigin-RevId: 286906740
* Restructure comment lexing to not recurse.River Riddle2019-11-111-1/+3
| | | | | | In some files that have large amounts of comments, this can lead to a stack overflow. PiperOrigin-RevId: 279867330
* Remove the need for passing a location to parseAttribute/parseType.River Riddle2019-11-011-0/+3
| | | | | | | | Now that a proper parser is passed to these methods, there isn't a need to explicitly pass a source location. The source location can be recovered from the parser as necessary. This removes the need to explicitly decode an SMLoc in the case where we don't need to, which can be expensive. This requires adding some basic nesting support to the parser for supporting nested parsers to allow for remapping source locations of the nested parsers to the top level parser for accurate diagnostics. This is due to the fact that the attribute and type parsers use different source buffers than the top level parser, as they may be represented in string form. PiperOrigin-RevId: 278014858
* Lexer: NFC: sort helper methods alphabeticallyAlex Zinenko2019-08-081-4/+4
| | | | | | | | Lexer methods were added progressively as implementation advanced. The rest of MLIR now tends to sort methods alphabetically for better discoverability in absence of tooling. Sort the lexer methods as well. PiperOrigin-RevId: 262406992
* Introduce support for variadic function signatures for the LLVM dialectAlex Zinenko2019-08-081-0/+1
| | | | | | | | | | | | | LLVM function type has first-class support for variadic functions. In the current lowering pipeline, it is emulated using an attribute on functions of standard function type. In LLVMFuncOp that has LLVM function type, this can be modeled directly. Introduce parsing support for variadic arguments to the function and use it to support variadic function declarations in LLVMFuncOp. Function definitions are currently not supported as that would require modeling va_start/va_end LLVM intrinsics in the dialect and we don't yet have a consistent story for LLVM intrinsics. PiperOrigin-RevId: 262372651
* Update style/clang-format (NFC).Jacques Pienaar2019-07-221-3/+3
| | | | | | Update to be consistent & so that future save + clang-format workflows don't introduce extra changes. PiperOrigin-RevId: 259361174
* Implement value type abstraction for locations.River Riddle2019-03-291-1/+1
| | | | | | Value type abstraction for locations differ from others in that a Location can NOT be null. NOTE: dyn_cast returns an Optional<T>. PiperOrigin-RevId: 220682078
* Change sigil for integer set: @@ -> #Uday Bondhugula2019-03-291-1/+0
| | | | PiperOrigin-RevId: 218786684
* Change SourgeMgr to const reference in Parser/Lexer.Jacques Pienaar2019-03-291-10/+11
| | | | | | SourceMgr is not be mutated during parsing/lexing. PiperOrigin-RevId: 212145759
* Continue revising diagnostic handling to simplify and generalize it, and ↵Chris Lattner2019-03-291-8/+13
| | | | | | | | | | | | | | | | | | | improve related infra. - Add a new -verify mode to the mlir-opt tool that allows writing test cases for optimization and other passes that produce diagnostics. - Refactor existing the -check-parser-errors flag to mlir-opt into a new -split-input-file option which is orthogonal to -verify. - Eliminate the special error hook the parser maintained and use the standard MLIRContext's one instead. - Enhance the default MLIRContext error reporter to print file/line/col of errors when it is available. - Add new createChecked() methods to the builder that create ops and invoke the verify hook on them, use this to detected unhandled code in the RaiseControlFlow pass. - Teach mlir-opt about expected-error @+, it previously only worked with @- PiperOrigin-RevId: 211305770
* Support for affine integer setsUday Bondhugula2019-03-291-0/+1
| | | | | | | | | | | | | - introduce affine integer sets into the IR - parse and print affine integer sets (both inline or outlined) similar to affine maps - use integer set for IfStmt's conditional, and implement parsing of IfStmt's conditional - fixed an affine expr paren omission bug while one this. TODO: parse/represent/print MLValue operands to affine integer set references. PiperOrigin-RevId: 207779408
* Remove const reference to errorReporter.Jacques Pienaar2019-03-291-8/+8
| | | | | | Fixes use-after-free ASAN failure. PiperOrigin-RevId: 204177796
* Add basic lexing and parsing support for SSA operands and definitions. ThisChris Lattner2019-03-291-1/+1
| | | | | | | isn't actually constructing IR objects yet, it is eating the tokens and discarding them. PiperOrigin-RevId: 203616265
* Refactor information about tokens out into a new TokenKinds.def file. Use thisChris Lattner2019-03-291-1/+1
| | | | | | | | 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-0/+1
| | | | | | | | | | 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
* Add some scaffolding for parsing affine maps:MLIR Team2019-03-291-0/+1
| | | | | | | | - parsing affine map identifiers - place-holder classes for AffineMap - module contains a list of affine maps (defined at the top level). PiperOrigin-RevId: 202336919
* Change Lexer and Parser to take diagnostic reporter function.Jacques Pienaar2019-03-291-8/+5
| | | | | | Add diagnostic reporter function to lexer/parser and use that from mlir-opt to report errors instead of having the lexer/parser print the errors. PiperOrigin-RevId: 201892004
* Implement parser and lexer support for most of the type grammar.Chris Lattner2019-03-291-0/+6
| | | | | | | | 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/+65
arguments. PiperOrigin-RevId: 201706570
OpenPOWER on IntegriCloud