]> granicus.if.org Git - llvm/commitdiff
[Orc] Add a comment about member variable dependencies to OrcMCJITReplacement.
authorLang Hames <lhames@gmail.com>
Thu, 31 Aug 2017 01:09:56 +0000 (01:09 +0000)
committerLang Hames <lhames@gmail.com>
Thu, 31 Aug 2017 01:09:56 +0000 (01:09 +0000)
The comment explains the reason behind the change in member variable order in
r312086.

Thanks to Philip Reames for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312205 91177308-0d34-0410-b5e6-96231b3b80d8

lib/ExecutionEngine/Orc/OrcMCJITReplacement.h

index 743d5e2307cfc07176d9a5e29fce9de82d114ca7..cb48d6cb230d0883f0be3ded2532655dfe5feec9 100644 (file)
@@ -381,6 +381,9 @@ private:
   std::shared_ptr<JITSymbolResolver> ClientResolver;
   Mangler Mang;
 
+  // IMPORTANT: ShouldDelete *must* come before LocalModules: The shared_ptr
+  // delete blocks in LocalModules refer to the ShouldDelete map, so
+  // LocalModules needs to be destructed before ShouldDelete.
   std::map<Module*, bool> ShouldDelete;
   std::vector<std::shared_ptr<Module>> LocalModules;