Skip to content

Commit 82d69f2

Browse files
address comments
1 parent 5ba236f commit 82d69f2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mlir/tools/mlir-tblgen/AttrOrTypeDefGen.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,10 @@ getAllTypeConstraints(const llvm::RecordKeeper &records) {
10431043
std::vector<Constraint> result;
10441044
for (llvm::Record *def :
10451045
records.getAllDerivedDefinitionsIfDefined("TypeConstraint")) {
1046+
// Ignore constraints defined outside of the top-level file.
1047+
if (llvm::SrcMgr.FindBufferContainingLoc(def->getLoc()[0]) !=
1048+
llvm::SrcMgr.getMainFileID())
1049+
continue;
10461050
Constraint constr(def);
10471051
// Generate C++ function only if "cppFunctionName" is set.
10481052
if (!constr.getCppFunctionName())

0 commit comments

Comments
 (0)