[Lldb-commits] [lldb] [LLDB] Add assignment to DIL. (PR #190223)

Adrian Prantl via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 2 12:48:16 PDT 2026


================
@@ -801,6 +803,60 @@ llvm::Expected<lldb::ValueObjectSP> Interpreter::EvaluateBinaryRemainder(
   return EvaluateScalarOp(BinaryOpKind::Rem, lhs, rhs, result_type, location);
 }
 
+static bool HasFloatingRepresentation(CompilerType ct) {
+  return ct.GetTypeInfo() & lldb::eTypeIsFloat;
+}
+
+static llvm::Expected<bool> VerifyAssignmentTypes(CompilerType lhs_type,
+                                                  CompilerType rhs_type) {
+  // Make sure lhs is a legal type for DIL assignment.
+  if (!lhs_type.IsInteger() && !lhs_type.IsUnscopedEnumerationType() &&
+      !HasFloatingRepresentation(lhs_type) && !lhs_type.IsPointerType() &&
+      !lhs_type.IsScalarType())
+    return llvm::createStringError(
+        "Illegal type for lhs of assignment (not scalar numeric type)\n");
----------------
adrian-prantl wrote:

We don't terminate errors with newlines usually. It should be up to the layer above to decide whether that's appropriate 

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


More information about the lldb-commits mailing list