[Mlir-commits] [mlir] 3df97bf - Fix GCC 5 MLIR Build (NFC)

Mehdi Amini llvmlistbot at llvm.org
Tue Jan 18 22:44:39 PST 2022


Author: Mehdi Amini
Date: 2022-01-19T06:44:28Z
New Revision: 3df97bfebc8e98f1e688089a1b7e38e4ce150bf9

URL: https://github.com/llvm/llvm-project/commit/3df97bfebc8e98f1e688089a1b7e38e4ce150bf9
DIFF: https://github.com/llvm/llvm-project/commit/3df97bfebc8e98f1e688089a1b7e38e4ce150bf9.diff

LOG: Fix GCC 5 MLIR Build (NFC)

Try to fix the error:

mlir/lib/Parser/Parser.cpp:553:14: error: cannot call member function 'mlir::InFlightDiagnostic mlir::detail::Parser::emitError(llvm::SMLoc, const llvm::Twine&)' without object
              << "operation location alias was never defined";

Added: 
    

Modified: 
    mlir/lib/Parser/Parser.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Parser/Parser.cpp b/mlir/lib/Parser/Parser.cpp
index c97aad45a0744..0a5e79cf4c897 100644
--- a/mlir/lib/Parser/Parser.cpp
+++ b/mlir/lib/Parser/Parser.cpp
@@ -547,18 +547,18 @@ ParseResult OperationParser::finalize() {
   // Resolve the locations of any deferred operations.
   auto &attributeAliases = state.symbols.attributeAliasDefinitions;
   auto locID = TypeID::get<DeferredLocInfo *>();
-  auto resolveLocation = [&](auto &opOrArgument) -> LogicalResult {
+  auto resolveLocation = [&, this](auto &opOrArgument) -> LogicalResult {
     auto fwdLoc = opOrArgument.getLoc().template dyn_cast<OpaqueLoc>();
     if (!fwdLoc || fwdLoc.getUnderlyingTypeID() != locID)
       return success();
     auto locInfo = deferredLocsReferences[fwdLoc.getUnderlyingLocation()];
     Attribute attr = attributeAliases.lookup(locInfo.identifier);
     if (!attr)
-      return emitError(locInfo.loc)
+      return this->emitError(locInfo.loc)
              << "operation location alias was never defined";
     auto locAttr = attr.dyn_cast<LocationAttr>();
     if (!locAttr)
-      return emitError(locInfo.loc)
+      return this->emitError(locInfo.loc)
              << "expected location, but found '" << attr << "'";
     opOrArgument.setLoc(locAttr);
     return success();


        


More information about the Mlir-commits mailing list