[Lldb-commits] [PATCH] D78972: Treat hasWeakODRLinkage symbols as external in REPL computations

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 28 05:19:39 PDT 2020


labath added a comment.

> I don't have a way to write a C-based test for this as I don't know how to craft a user expression in C that will make such a thing. I asked around a bit and nobody had an easy way to do this.

Grepping clang's tests for `weak_odr` was very educational. The most portable way to produce this linkage seems to be:

  template<typename T> void f() {}
  template void f<int>();

As for whether this patch is correct -- I don't know. The weak_odr functions are allowed to be replaced (that's the `weak` part), but the replacement is supposed to be equivalent (the `odr` part). So, strictly speaking, it may be ok to just export this function, but if we wanted to be closer to what happens for realz, we should check first if there isn't a more definitive version available elsewhere...


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