Skip to content

Commit d52ec1e

Browse files
authored
[MLIR][NFC] fix msvc debug build errors (#131393)
We found the build broken using msvc debug build as below: ``` C:\Users\bangtliu\iree\third_party\llvm-project\llvm\include\llvm/ADT/SmallVector.h(1162): error C2338: static_assert failed: 'You are trying to use a default number of inlined elements for `SmallVector<T>` but `sizeof(T)` is really big! Please use an explicit number of inlined elements with `SmallVector<T, N>` to make sure you really want that much inline storage.' C:\Users\bangtliu\iree\third_party\llvm-project\llvm\include\llvm/ADT/SmallVector.h(1162): note: the template instantiation context (the oldest one first) is C:\Users\bangtliu\iree\third_party\llvm-project\llvm\include\llvm/ADT/SmallVector.h(1194): note: see reference to class template instantiation 'llvm::CalculateSmallVectorDefaultInlinedElements<T>' being compiled with [ T=`anonymous-namespace'::LinalgOperandDef ] C:\Users\bangtliu\iree\third_party\llvm-project\mlir\tools\mlir-linalg-ods-gen\mlir-linalg-ods-yaml-gen.cpp(120): error C2976: 'llvm::SmallVector': too few template arguments C:\Users\bangtliu\iree\third_party\llvm-project\llvm\include\llvm/ADT/SmallVector.h(1195): note: see declaration of 'llvm::SmallVector' [862/7776] Building CXX object llvm-project\lib\DebugInfo\DWARF\CMakeFiles\LLVMDebugInfoDWARF.dir\DWARFDebugLine.cpp.obj ninja: build stopped: subcommand failed. ``` This PR is added to address this error.
1 parent 5265412 commit d52ec1e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ struct ScalarAssign {
117117
};
118118

119119
struct LinalgStructuredOpConfig {
120-
SmallVector<LinalgOperandDef> args;
120+
SmallVector<LinalgOperandDef, 4> args;
121121
LinalgIndexingMapsConfig indexingMaps;
122-
SmallVector<LinalgIteratorTypeDef> iteratorTypes;
122+
SmallVector<LinalgIteratorTypeDef, 4> iteratorTypes;
123123
std::vector<ScalarAssign> assignments;
124124
};
125125

0 commit comments

Comments
 (0)