[clang] [CIR] Upstream initial support for unary op (PR #131369)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 14 13:01:21 PDT 2025


================
@@ -165,6 +165,54 @@ LValue CIRGenFunction::emitDeclRefLValue(const DeclRefExpr *e) {
   return LValue();
 }
 
+LValue CIRGenFunction::emitUnaryOpLValue(const UnaryOperator *e) {
+  UnaryOperatorKind op = e->getOpcode();
+
+  // __extension__ doesn't affect lvalue-ness.
+  if (op == UO_Extension)
+    return emitLValue(e->getSubExpr());
+
+  switch (op) {
+  case UO_Deref: {
+    cgm.errorNYI(e->getSourceRange(), "UnaryOp dereference");
+    return LValue();
+  }
+  case UO_Real:
+  case UO_Imag: {
+    cgm.errorNYI(e->getSourceRange(), "UnaryOp real/imag");
----------------
erichkeane wrote:

I wonder if a MissingFeatures for `Complex` might be reasonable here, in this function?  WDYT?

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


More information about the cfe-commits mailing list