[mlir][Linalg] NFC - Hotfix GenericLoopNestBuilder compilation error on older gcc...
authorNicolas Vasilache <ntv@google.com>
Fri, 3 Jan 2020 20:05:39 +0000 (15:05 -0500)
committerNicolas Vasilache <ntv@google.com>
Fri, 3 Jan 2020 20:09:23 +0000 (15:09 -0500)
This fixes the error:
```
  mlir/include/mlir/Dialect/Linalg/Utils/Utils.h:72:3: error:   from definition of 'template<class LoopTy> mlir::edsc::GenericLoopNestRangeBuilder<LoopTy>::GenericLoopNestRangeBuilder(llvm::ArrayRef<mlir::edsc::ValueHandle*>, llvm::ArrayRef<mlir::Value>)' [-fpermissive]
    GenericLoopNestRangeBuilder(ArrayRef<edsc::ValueHandle *> ivs,
```

This was tested independently on a Docker image with gcc-5 by jpienaar@

mlir/lib/Dialect/Linalg/Utils/Utils.cpp

index 771d313..24f8874 100644 (file)
@@ -97,15 +97,17 @@ ValueHandle LoopNestRangeBuilder::LoopNestRangeBuilder::operator()(
   return ValueHandle::null();
 }
 
+namespace mlir {
+  namespace edsc {
 template <>
-mlir::edsc::GenericLoopNestRangeBuilder<
+GenericLoopNestRangeBuilder<
     loop::ForOp>::GenericLoopNestRangeBuilder(ArrayRef<edsc::ValueHandle *> ivs,
                                               ArrayRef<Value> ranges) {
   builder = std::make_unique<LoopNestRangeBuilder>(ivs, ranges);
 }
 
 template <>
-mlir::edsc::GenericLoopNestRangeBuilder<
+GenericLoopNestRangeBuilder<
     AffineForOp>::GenericLoopNestRangeBuilder(ArrayRef<ValueHandle *> ivs,
                                               ArrayRef<Value> ranges) {
   SmallVector<ValueHandle, 4> lbs;
@@ -121,6 +123,9 @@ mlir::edsc::GenericLoopNestRangeBuilder<
   }
   builder = std::make_unique<AffineLoopNestBuilder>(ivs, lbs, ubs, steps);
 }
+    
+} // namespace edsc
+} // namespace mlir
 
 static Value emitOrFoldComposedAffineApply(OpBuilder &b, Location loc,
                                            AffineMap map,