My Project
Parser.h
Go to the documentation of this file.
1 //===- Parser.h - MLIR Parser Library Interface -----------------*- C++ -*-===//
2 //
3 // Part of the MLIR Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file is contains the interface to the MLIR parser library.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef MLIR_PARSER_H
14 #define MLIR_PARSER_H
15 
16 #include <cstddef>
17 
18 namespace llvm {
19 class SourceMgr;
20 class SMDiagnostic;
21 class StringRef;
22 } // end namespace llvm
23 
24 namespace mlir {
25 class Attribute;
26 class Location;
27 class MLIRContext;
28 class OwningModuleRef;
29 class Type;
30 
34 OwningModuleRef parseSourceFile(const llvm::SourceMgr &sourceMgr,
35  MLIRContext *context);
36 
40 OwningModuleRef parseSourceFile(llvm::StringRef filename, MLIRContext *context);
41 
46 OwningModuleRef parseSourceFile(llvm::StringRef filename,
47  llvm::SourceMgr &sourceMgr,
48  MLIRContext *context);
49 
53 OwningModuleRef parseSourceString(llvm::StringRef moduleStr,
54  MLIRContext *context);
55 
61 // TODO(ntv) Improve diagnostic reporting.
62 Attribute parseAttribute(llvm::StringRef attrStr, MLIRContext *context);
63 Attribute parseAttribute(llvm::StringRef attrStr, Type type);
64 
70 Attribute parseAttribute(llvm::StringRef attrStr, MLIRContext *context,
71  size_t &numRead);
72 Attribute parseAttribute(llvm::StringRef attrStr, Type type, size_t &numRead);
73 
79 // TODO(ntv) Improve diagnostic reporting.
80 Type parseType(llvm::StringRef typeStr, MLIRContext *context);
81 
87 Type parseType(llvm::StringRef typeStr, MLIRContext *context, size_t &numRead);
88 } // end namespace mlir
89 
90 #endif // MLIR_PARSER_H
Definition: InferTypeOpInterface.cpp:20
Type parseType(llvm::StringRef typeStr, MLIRContext *context, size_t &numRead)
Definition: PassRegistry.cpp:413
Definition: Attributes.h:139
OwningModuleRef parseSourceString(llvm::StringRef moduleStr, MLIRContext *context)
OwningModuleRef parseSourceFile(llvm::StringRef filename, llvm::SourceMgr &sourceMgr, MLIRContext *context)
Attribute parseAttribute(llvm::StringRef attrStr, Type type, size_t &numRead)