Skip to content

Commit ccc4fa1

Browse files
authored
[TableGen] Fix MacOS failure in Option Emitter. (#108225)
Handle the case of same pointer used as both inputs to the `CompareOptionRecords`, to avoid emitting errors for equivalent options. Follow-up to #107696.
1 parent 7a30b9c commit ccc4fa1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/utils/TableGen/Common/OptEmitter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ static int StrCmpOptionName(const char *A, const char *B) {
4141

4242
// Returns true if A is ordered before B.
4343
bool CompareOptionRecords(const Record *A, const Record *B) {
44+
if (A == B)
45+
return false;
4446
// Sentinel options precede all others and are only ordered by precedence.
4547
bool ASent = A->getValueAsDef("Kind")->getValueAsBit("Sentinel");
4648
bool BSent = B->getValueAsDef("Kind")->getValueAsBit("Sentinel");

0 commit comments

Comments
 (0)