[all-commits] [llvm/llvm-project] 2bb3fb: Handle PluginAttrInstances using ManagedStatic

john-brawn-arm via All-commits all-commits at lists.llvm.org
Wed Mar 4 07:04:30 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 2bb3fb05e20e272790170e86fb76dac23a67f52c
      https://github.com/llvm/llvm-project/commit/2bb3fb05e20e272790170e86fb76dac23a67f52c
  Author: John Brawn <john.brawn at arm.com>
  Date:   2020-03-04 (Wed, 04 Mar 2020)

  Changed paths:
    M clang/lib/Sema/ParsedAttr.cpp

  Log Message:
  -----------
  Handle PluginAttrInstances using ManagedStatic

We need to make sure that PluginAttrInstances is deleted before shared libraries
are unloaded, because otherwise when deleting its contents we'll try to access
a virtual destructor which no longer exists.

As shared libraries are managed using ManagedStatic we can do this by also using
ManagedStatic for PluginAttrInstances as ManagedStatics are deleted in reverse
order of construction and we know that PluginAttrInstances will only be
accessed, and thus constructed, after shared libraries have been loaded.




More information about the All-commits mailing list