[PATCH] D134801: [clang][Interp] Implement ConditionalOperators

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 28 10:52:17 PDT 2022


tbaeder added inline comments.


================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:357
+
+  if (!this->visit(Condition))
+    return false;
----------------
shafik wrote:
> Maybe I am misunderstanding what this is doing but can't we just check the result of the condition and then just visit either the true or false branch?  
That's what this code is doing in the "eval case" (i.e Emitter = EvalEmitter), but when we're emitting bytecode, we can of course not just check the condition but need to do that when the byte code is emitted. 

That is, if I understand the question correctly.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134801/new/

https://reviews.llvm.org/D134801



More information about the cfe-commits mailing list