aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-04-21 21:27:19 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-04-21 21:27:19 +0000
commit4c82a809b36bc4703a6ea2003772e1dcf2ba85c1 (patch)
tree92047fbba7cb578595513ee1617ecb3ec072cdfa /llvm/lib/CodeGen/MachineFunction.cpp
parent6c76d1d7df750364cbc9094c5ea0f9fd8ab1b9ff (diff)
downloadllvm-4c82a809b36bc4703a6ea2003772e1dcf2ba85c1.zip
llvm-4c82a809b36bc4703a6ea2003772e1dcf2ba85c1.tar.gz
llvm-4c82a809b36bc4703a6ea2003772e1dcf2ba85c1.tar.bz2
Simplify destruction of Modules in LLVContextImpl.
This avoids copying the container by simply deleting until empty. While I'd rather move to a stricter ownership semantic (unique_ptr), SmallPtrSet can't cope with unique_ptr and the ownership semantics here are a bit incestuous (Module sort of owns itself, but sort of doesn't (if the LLVMContext is destroyed before the Module, then it deregisters itself from the context... )). Ideally Modules would be given to the context, or possibly an emplace-like function to construct them there. Modules then shouldn't be destroyed by LLVM API clients, but by interacting with the owner (LLVMContext) directly (but even then, passing a Module* to LLVMContext doesn't provide an easy way to destroy the Module, since the set would be over unique_ptrs and you'd need a heterogenous lookup function which SmallPtrSet doesn't have either). llvm-svn: 206794
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
0 files changed, 0 insertions, 0 deletions