[mlir] Fix GCC5 compilation problem in MLIR->LLVM type translation
authorAlex Zinenko <zinenko@google.com>
Tue, 4 Aug 2020 12:42:17 +0000 (14:42 +0200)
committerAlex Zinenko <zinenko@google.com>
Tue, 4 Aug 2020 12:42:17 +0000 (14:42 +0200)
GCC5 seems to dislike generic lambdas calling a method of the class
containing the lambda without explicit `this`.

mlir/lib/Target/LLVMIR/TypeTranslation.cpp

index 15e0f15..b327e9e 100644 (file)
@@ -72,7 +72,7 @@ public:
                   LLVM::LLVMFunctionType, LLVM::LLVMPointerType,
                   LLVM::LLVMStructType, LLVM::LLVMFixedVectorType,
                   LLVM::LLVMScalableVectorType>(
-                [this](auto array) { return translate(array); })
+                [this](auto type) { return this->translate(type); })
             .Default([](LLVM::LLVMType t) -> llvm::Type * {
               llvm_unreachable("unknown LLVM dialect type");
             });
@@ -187,7 +187,7 @@ public:
             .Case<llvm::ArrayType, llvm::FunctionType, llvm::IntegerType,
                   llvm::PointerType, llvm::StructType, llvm::FixedVectorType,
                   llvm::ScalableVectorType>(
-                [this](auto *type) { return translate(type); })
+                [this](auto *type) { return this->translate(type); })
             .Default([this](llvm::Type *type) {
               return translatePrimitiveType(type);
             });