diff options
| author | 2019-01-27 16:42:12 +0000 | |
|---|---|---|
| committer | 2019-01-27 16:42:12 +0000 | |
| commit | b773203fb58f3ef282fb69c832d8710cab5bc82d (patch) | |
| tree | e75913f147570fbd75169647b144df85b88a038c /gnu/llvm/lib/IR/LLVMContextImpl.cpp | |
| parent | tweak errno in previous (diff) | |
| download | wireguard-openbsd-b773203fb58f3ef282fb69c832d8710cab5bc82d.tar.xz wireguard-openbsd-b773203fb58f3ef282fb69c832d8710cab5bc82d.zip | |
Import LLVM 7.0.1 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/lib/IR/LLVMContextImpl.cpp')
| -rw-r--r-- | gnu/llvm/lib/IR/LLVMContextImpl.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/gnu/llvm/lib/IR/LLVMContextImpl.cpp b/gnu/llvm/lib/IR/LLVMContextImpl.cpp index 4b44a6b69ca..3c34ca55c22 100644 --- a/gnu/llvm/lib/IR/LLVMContextImpl.cpp +++ b/gnu/llvm/lib/IR/LLVMContextImpl.cpp @@ -48,6 +48,14 @@ LLVMContextImpl::~LLVMContextImpl() { while (!OwnedModules.empty()) delete *OwnedModules.begin(); +#ifndef NDEBUG + // Check for metadata references from leaked Instructions. + for (auto &Pair : InstructionMetadata) + Pair.first->dump(); + assert(InstructionMetadata.empty() && + "Instructions with metadata have been leaked"); +#endif + // Drop references for MDNodes. Do this before Values get deleted to avoid // unnecessary RAUW when nodes are still unresolved. for (auto *I : DistinctMDNodes) @@ -155,7 +163,7 @@ void Module::dropTriviallyDeadConstantArrays() { namespace llvm { -/// \brief Make MDOperand transparent for hashing. +/// Make MDOperand transparent for hashing. /// /// This overload of an implementation detail of the hashing library makes /// MDOperand hash to the same value as a \a Metadata pointer. @@ -222,8 +230,8 @@ void LLVMContextImpl::getSyncScopeNames( /// Singleton instance of the OptBisect class. /// -/// This singleton is accessed via the LLVMContext::getOptBisect() function. It -/// provides a mechanism to disable passes and individual optimizations at +/// This singleton is accessed via the LLVMContext::getOptPassGate() function. +/// It provides a mechanism to disable passes and individual optimizations at /// compile time based on a command line option (-opt-bisect-limit) in order to /// perform a bisecting search for optimization-related problems. /// @@ -233,6 +241,12 @@ void LLVMContextImpl::getSyncScopeNames( /// enabled in order to enable a consistent bisect count. static ManagedStatic<OptBisect> OptBisector; -OptBisect &LLVMContextImpl::getOptBisect() { - return *OptBisector; +OptPassGate &LLVMContextImpl::getOptPassGate() const { + if (!OPG) + OPG = &(*OptBisector); + return *OPG; +} + +void LLVMContextImpl::setOptPassGate(OptPassGate& OPG) { + this->OPG = &OPG; } |
