[Lldb-commits] [PATCH] D78972: Treat hasWeakODRLinkage symbols as external in REPL computations
Jim Ingham via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Thu May 14 10:50:27 PDT 2020
jingham added a comment.
For expression evaluation in a REPL (which we only have for Swift, but if somebody wants to make such a thing for C++ we wouldn't be displeased) the model is compiling into a single translation unit. I think that's the only thing that makes sense. You don't want to have to artificially make everything public in the REPL so that you could use it in a subsequent REPL session.
--top-level was introduced mostly because C doesn't allow inner functions, and so without a way to say "compile this expression in no function context" you couldn't define new functions. That limits the utility of the expression parser in a seemingly artificial way, and you ended up having to write any code you wanted to reuse when you were using the expression parser for injecting code to do investigations in the inferior (like heap.py) awkward. That doesn't go one way or the other to how we want to use this for more than one evaluation. We could certainly discriminate between REPL and top-level in IRExecutionUnit and give them different behaviors. But unless there's a good reason to make them different, I'd rather not.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78972/new/
https://reviews.llvm.org/D78972
More information about the lldb-commits
mailing list