[clang] [clang]: support std::meta::info for primitive types (PR #190356)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 4 06:47:51 PDT 2026


================
@@ -18517,6 +18560,23 @@ EvaluateComparisonBinaryOperator(EvalInfo &Info, const BinaryOperator *E,
     return Success(CmpResult::Equal, E);
   }
 
+  if (LHSTy->isMetaInfoType() && RHSTy->isMetaInfoType()) {
+    APValue LHSValue, RHSValue;
+    llvm::FoldingSetNodeID LID, RID;
+    if (!Evaluate(LHSValue, Info, E->getLHS()))
+      return false;
+    LHSValue.Profile(LID);
+
----------------
tbaederr wrote:

Seems like it would be more idiomatic to compare the contents of the apvalues directly here. Or are you doing this because they can be of different type? Are LHS/RHS not always reflect apvalues?

https://github.com/llvm/llvm-project/pull/190356


More information about the cfe-commits mailing list