[WIP] Sketching IR and parsing support for affine maps, affine expressions
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
diff --git a/lib/IR/AffineMap.cpp b/lib/IR/AffineMap.cpp
index 83d1d23..8631751 100644
--- a/lib/IR/AffineMap.cpp
+++ b/lib/IR/AffineMap.cpp
@@ -17,15 +17,13 @@
#include "mlir/IR/AffineMap.h"
#include "llvm/ADT/StringRef.h"
-#include "llvm/Support/raw_ostream.h"
using namespace mlir;
-AffineMap::AffineMap(unsigned dimCount, unsigned symbolCount)
- : dimCount(dimCount), symbolCount(symbolCount) {
-}
-
-void AffineMap::print(raw_ostream &os) const {
- // TODO(andydavis) Print out affine map based on dimensionCount and
- // symbolCount: (d0, d1) [S0, S1] -> (d0 + S0, d1 + S1)
+// TODO(clattner): make this ctor take an LLVMContext. This will eventually
+// copy the elements into the context.
+AffineMap::AffineMap(unsigned dimCount, unsigned symbolCount,
+ ArrayRef<AffineExpr *> exprs)
+ : numDims(dimCount), numSymbols(symbolCount), exprs(exprs) {
+ // TODO(bondhugula)
}