augusto2112 wrote:
@DavidSpickett thanks for reminding me. I'll add a comment describing the
situation.
Right now, for conditional breakpoints, we assume that the condition expression
is cacheable, since it's being run over and over again in the exact same
context. This works for C/C++, but not for Swift, because Swift generics aren't
monomorphized (the same problem would happen for other languages where generics
aren't monomorphized either, so a more general escape hatch seemed appropriate
to me).
To illustrate what I mean, a function such as the following (in C++ syntax but
Swift semantics):
```
template <class T>
void use(T t) {}
// In main
use(5);
use(std::string())
```
Is lowered only once as a truly generic function (unlike C++ which will
generate one version per instantiation), so it isn't safe to cache the
expression parse, as the argument type may be different in every invocation.
https://github.com/llvm/llvm-project/pull/66826
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits