[PATCH] D27410: Always issue vtables when generating coverage instrumentation

Vedant Kumar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 19 11:23:24 PST 2016


vsk added inline comments.


================
Comment at: llvm/tools/clang/test/CodeGenCXX/vtable-coverage-gen.cpp:3
+// RUN: FileCheck %s < %t 
+// CHECK: @_ZTV8Category = linkonce_odr unnamed_addr constant {{.*}}, comdat,
+
----------------
ahatanak wrote:
> I'm not sure I understood the purpose of this test, but It looks like the vtable for Category is generated in the IR with linkonce_odr without your patch.
Yes, I'm seeing the same thing and am also confused. I can reproduce the build failure without using any vtables. To me this suggests the problem could be elsewhere. Here is a minimal reproducer:

```
struct Base {
  static const Base *get();
};

struct Derived : public Base {};

const Base *Base::get() {
  static Derived d;
  return &d;
}

int main() { return 0; }
```


https://reviews.llvm.org/D27410





More information about the cfe-commits mailing list