Skip to content

Commit

Permalink
fix build warning -Wreturn-type (#1308)
Browse files Browse the repository at this point in the history
We are hitting build failure in `tt-forge-fe` for latest `tt-mlir`
(build warning treated as error):

error: non-void function does not return a value in all control paths

Refactored function so that it always returns.
  • Loading branch information
pilkicTT authored Nov 18, 2024
1 parent 924b22c commit 6c64fb7
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions include/ttmlir/Target/Utils/MLIRToFlatbuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -443,12 +443,9 @@ encodingToFlatbuffer(FlatbufferObjectCache &cache, Attribute attr,
deviceAttr);
}

if (isa<ttnn::TTNNLayoutAttr>(attr)) {
return ttnnLayoutAttrToFlatbuffer(cache, cast<ttnn::TTNNLayoutAttr>(attr),
logicalShape, deviceAttr);
}

assert(false && "unsupported layout attr");
assert(isa<ttnn::TTNNLayoutAttr>(attr) && "unsupported layout attr");
return ttnnLayoutAttrToFlatbuffer(cache, cast<ttnn::TTNNLayoutAttr>(attr),
logicalShape, deviceAttr);
}

inline flatbuffers::Offset<::tt::target::TensorDesc>
Expand Down

0 comments on commit 6c64fb7

Please sign in to comment.