summaryrefslogtreecommitdiff
path: root/lib/CodeGen/BackendUtil.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2013-06-21 21:15:32 +0000
committerNick Lewycky <nicholas@mxc.ca>2013-06-21 21:15:32 +0000
commit73b8d4bdd68372bff9eddc5a02675ee345a8a94f (patch)
tree87bcdb8c312238afa6e591f7f41bab5cd13865e7 /lib/CodeGen/BackendUtil.cpp
parentf0c31d98d3db8ed76077999d10ac45ed23f7e75e (diff)
downloadclang-73b8d4bdd68372bff9eddc5a02675ee345a8a94f.tar.gz
clang-73b8d4bdd68372bff9eddc5a02675ee345a8a94f.tar.bz2
clang-73b8d4bdd68372bff9eddc5a02675ee345a8a94f.tar.xz
Fix a leak of TargetMachine in clang. We'll continue to leak it on purpose if
given -disable-free. (Reviewed by John McCall over IRC.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184595 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/BackendUtil.cpp')
-rw-r--r--lib/CodeGen/BackendUtil.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp
index e173aa9314..7d1a3c82e8 100644
--- a/lib/CodeGen/BackendUtil.cpp
+++ b/lib/CodeGen/BackendUtil.cpp
@@ -528,6 +528,7 @@ void EmitAssemblyHelper::EmitAssembly(BackendAction Action, raw_ostream *OS) {
Action != Backend_EmitLL);
TargetMachine *TM = CreateTargetMachine(UsesCodeGen);
if (UsesCodeGen && !TM) return;
+ llvm::OwningPtr<TargetMachine> TMOwner(CodeGenOpts.DisableFree ? 0 : TM);
CreatePasses(TM);
switch (Action) {